Skip to content

Conversation

@IceTank
Copy link
Contributor

@IceTank IceTank commented Sep 28, 2025

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-actions github-actions bot added the triage Requires labelling or review label Sep 28, 2025
@IceTank IceTank changed the title Add BetterFirework Module Feature (Module): Add BetterFirework Module Sep 28, 2025
@IceTank IceTank added the feature Suggests or adds a new feature label Sep 28, 2025
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
Collaborator

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
Contributor Author

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.

@IceTank IceTank force-pushed the feature/module/BetterFirework branch from cfc96c2 to c1b167e Compare October 14, 2025 14:35
@IceTank
Copy link
Contributor Author

IceTank commented Oct 27, 2025

@Edouard127 so we merge?

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

@beanbag44 beanbag44 left a comment

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
Collaborator

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
Contributor Author

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
Collaborator

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
Collaborator

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
Collaborator

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 IceTank force-pushed the feature/module/BetterFirework branch from daebacd to e76fb57 Compare November 1, 2025 21:31
Copy link
Collaborator

@beanbag44 beanbag44 left a comment

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
Collaborator

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 IceTank force-pushed the feature/module/BetterFirework branch from ec590d4 to 99a3940 Compare November 2, 2025 15:05
@IceTank IceTank self-assigned this Nov 23, 2025
@IceTank IceTank requested a review from beanbag44 November 23, 2025 17:55
@IceTank
Copy link
Contributor Author

IceTank commented Nov 24, 2025

@emyfops you approve?

Set default options that actually work
Copy link
Collaborator

@emyfops emyfops left a comment

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.5 Nov 27, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Suggests or adds a new feature triage Requires labelling or review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants