Create Jetpack

Create Jetpack

11M Downloads

[1.20.1] Disable the jetpack when another mod puts it on item cooldown

TelepathicGrunt opened this issue ยท 3 comments

commented

Describe the feature you have in mind.

If a mod put the Create Jetpack on item cooldown the same way vanilla shields gets a cooldown when hit by axe, the Jetpack should no longer activate until the cooldown is lifted.

Mods can set a cooldown by doing:
player.getCooldowns().addCooldown(jetpack.getItem(), 40);

This will send a packet to clients as well so both sides will know about the cooldown.

You can then query to see if the cooldown is active by doing
if (player.getCooldowns().isOnCooldown(jetpack.getItem())) {

Does this solve a particular problem?

This allows me, the dev for Bumblezone, to disable the Jetpack when players enters my Heavy Air block. Thus allowing me to stop people from cheesing my endgame events by flying over spikes and mobs as well as adds to the atmosphere of my ancient magical structure that can disable flight technologies.

Since cooldowns is a vanilla thing and is accessible on both sides, adding support for cooldowns should be very quick and painless and allow for other mods to disable the jetpack if they wish to for a certain amount of time.

commented

yes please add this

commented

definitely, sounds reasonable, will add this as part of the core FlightLib logic

commented

I have released a new version that should include a check of the item cooldown