Skip to content

Feature (Module): Add BetterFirework Module - #154

Merged
emyfops merged 18 commits into
1.21.5from
feature/module/BetterFirework
Nov 27, 2025
Merged

Feature (Module): Add BetterFirework Module#154
emyfops merged 18 commits into
1.21.5from
feature/module/BetterFirework

Conversation

@IceTank

Copy link
Copy Markdown
Contributor

This Module adds better Fireworks utility. Features include:

  • Auto takeoff while standing or falling by interacting with fireworks
  • Auto takeoff on middle click (pick block key)
  • Auto firework use on middle click
  • Silent firework use from inventory with middle click

@github-actionsgithub-actionsBot added the triage Requires labelling or review label Sep 28, 2025
@IceTankIceTank changed the title Add BetterFirework ModuleFeature (Module): Add BetterFirework ModuleSep 28, 2025
@IceTankIceTank added the feature Suggests or adds a new feature label Sep 28, 2025
Comment threadsrc/main/kotlin/com/lambda/module/modules/movement/BetterFirework.kt Outdated
Comment threadsrc/main/kotlin/com/lambda/module/modules/movement/BetterFirework.kt Outdated
Comment on lines +169 to +186
private fun SafeContext.getFireworkAtHotbar(): Int {
for (i in 0..8) {
val itemStack: ItemStack = player.getInventory().getStack(i)
if (itemStack.item !== Items.FIREWORK_ROCKET) continue
return i
}
return -1
}

private fun SafeContext.getFireworkInInventoryScreen(): Int {
val screenHandler: PlayerScreenHandler = player.playerScreenHandler
for (i in PlayerScreenHandler.INVENTORY_START..<PlayerScreenHandler.INVENTORY_END) {
val itemStack = screenHandler.getSlot(i).stack
if (itemStack.item !== Items.FIREWORK_ROCKET) continue
return i
}
return -1
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have utils to find and swap items

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could not find any utils that tell me what inventory index the found items are in. We looked at this like 3 weeks ago. You couldn't find any either.

Comment threadsrc/main/kotlin/com/lambda/module/modules/movement/BetterFirework.kt Outdated
@IceTank
IceTankforce-pushed the feature/module/BetterFirework branch from cfc96c2 to c1b167eCompareOctober 14, 2025 14:35
@IceTank

Copy link
Copy Markdown
ContributorAuthor

@Edouard127 so we merge?

@beanbag44
beanbag44 self-requested a review October 31, 2025 11:46

@beanbag44beanbag44 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just small things. Also, for single line if blocks, its often cleaner to omit the braces and keep them on the same line or at least the action after the check. Like this:

if (something) doSomething()
else if (something else) doSomethingElse()

tag = ModuleTag.MOVEMENT,
) {
private var fireworkInteract by setting("Firework Interact", true, "Automatically start flying when right clicking fireworks")
private var fireworkInteractCancel by setting("Firework Interact Cancel", false, "Cancel block interactions while holding fireworks") { fireworkInteract }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its annoying sometimes when you fly into a wall and try to use a firework for it to spam it on a block. Maybe this could be a general setting rather than an extension of fireworkInteract

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just enable the Module

description = "Automatic takeoff with fireworks",
tag = ModuleTag.MOVEMENT,
) {
private var fireworkInteract by setting("Firework Interact", true, "Automatically start flying when right clicking fireworks")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have used the name "Right Click Fly" instead of "Firework Interact"

interaction.clickSlot(player.playerScreenHandler.syncId, swap, 0, SlotActionType.SWAP, mc.player)

if (player.getInventory().selectedSlot != 0) {
player.networkHandler.sendPacket(UpdateSelectedSlotC2SPacket(0))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should request the hotbar manager with keep ticks set to 0 for silent swap

enum class TakeoffState {
NONE,
JUMPING,
START_FLYING

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should be in camel case

@IceTank
IceTankforce-pushed the feature/module/BetterFirework branch from daebacd to e76fb57CompareNovember 1, 2025 21:31

@beanbag44beanbag44 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one thing, aside from that i think its good

tag = ModuleTag.MOVEMENT,
) {
private var fireworkInteract by setting("Right Click Fly", true, "Automatically start flying when right clicking fireworks").group(Group.General)
private var fireworkInteractCancel by setting("Right Click Cancel", false, "Cancel block interactions while holding fireworks") { fireworkInteract }.group(Group.General)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i meant that this shouldn't be dependent on right click fly to be a feature. This should be its own option, separate from firework interact

@IceTank
IceTankforce-pushed the feature/module/BetterFirework branch from ec590d4 to 99a3940CompareNovember 2, 2025 15:05
Comment threadsrc/main/kotlin/com/lambda/module/modules/movement/BetterFirework.kt Outdated
Comment threadsrc/main/kotlin/com/lambda/module/modules/movement/BetterFirework.kt Outdated
Comment threadsrc/main/kotlin/com/lambda/module/modules/movement/BetterFirework.kt Outdated
@IceTankIceTank self-assigned this Nov 23, 2025
@IceTank

Copy link
Copy Markdown
ContributorAuthor

@emyfops you approve?

Set default options that actually work

@emyfopsemyfops left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@emyfops
emyfops merged commit 9554ee9 into 1.21.5Nov 27, 2025
1 check failed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

featureSuggests or adds a new featuretriageRequires labelling or review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@IceTank@emyfops@beanbag44