Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cooldown timer for using items #5823

Open
Wuzzy2 opened this issue May 26, 2017 · 4 comments
Open

Cooldown timer for using items #5823

Wuzzy2 opened this issue May 26, 2017 · 4 comments
Labels
Feature request Issues that request the addition or enhancement of a feature @ Script API

Comments

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented May 26, 2017

This is a feature request.

I propose to add an optional cooldown timer for items.
It can be any amount of time, from very short to very long.

Whenever a player uses an item which requires cooldown, this and same items can not be used again before the cooldown ends. Attempting to use the item again before the cooldown timer ends will do nothing and will also not cause any punch/use animations to be played in the wieldhand.

“Using” here refers to anything that involves:

  • on_use
  • on_secondary_use
  • on_place
  • on_punch (no matter if miss or hit; also counts for weapons like swords; this restriction will apply on top of the reduced damage mechanic)
  • (name me others I might have forgotten)

The engine could also provide a simple visual clue in the hotbar as a simple “progress” bar below the wear bar. It starts off full and becomes empty over time, until the cooldown has ended. Maybe the item in hotbar could also be “grayed out” or something like that. If multiple items are affeced, all those should have the hotbar effect.

Finally, I suggest to also add group support for this. Modders could be able to either add colldown just for the single item they define it for (the default), or they can choose to apply the cooldown to an entire group.
If such a “cooldown” group is defined, the user will be prevented to use any item which is member of the specified cooldown group for the remainder of the cooldown time. The

Use cases:

  • Minetest Game: Preventing players of spam-eating 100 bread in 10 seconds. Currently, bread is massively OP as you can eat at inhumane speeds and survive PvP and lava for very long times as long you have stockpiled hundreds of breads ;-)
  • Nerf anything else that insta-heals you
  • Preventing player from spamming arrows with bow and arrow (throwing mod)
  • Simple non-automatic rifles (1 click = 1 shot)
  • Preventing player from teleporting very quickly multiple times in succession without delay by using the point teleporter (item which teleports you to the node you pointed at) (teletool mod)
  • MineClone 2: Cooldown timer 1 of second after using ender pearl (this is a throwable item which teleports the player to impact location
  • MineClone 2: Cooldown timer of ca. 2 seconds after eating anything else (already implemented with a hack, but has completely wrong animations and effects)
  • MineClone 2: Cooldown timer of 1 second after eating chorus fruit (teleports player randomly after eating)

Explanation of cooldown groups:

  • After eating bread with 2 seconds cooldown, but with no cooldown group defined, the user will be unable to eat any bread for 2 seconds
  • After eating bread with 2 seconds cooldown with cooldown group “food”, the user will be unable to eat any food (bread, apples, cheese, you name it) for 2 seconds

See also this abandoned PR: #4319

@SmallJoker SmallJoker added the Feature request Issues that request the addition or enhancement of a feature label May 26, 2017
@Fixer-007
Copy link
Contributor

Fixer-007 commented Dec 10, 2017

This should also fix punching pointed block when picking up an item/eating food bug ^.

@paramat
Copy link
Contributor

paramat commented Sep 3, 2018

1 year bump for core dev opinions.

@Ezhh
Copy link
Contributor

Ezhh commented Sep 6, 2018

I think this would be a good feature to have. I can imagine a few good uses for it.

@ClobberXD
Copy link
Contributor

ClobberXD commented Sep 6, 2018

I suggest to also add group support for this. Modders could be able to either add colldown just for the single item they define it for (the default), or they can choose to apply the cooldown to an entire group.

I'd prefer a cooldown field in the item def itself. If not provided, cooldown is disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Issues that request the addition or enhancement of a feature @ Script API
Projects
None yet
Development

No branches or pull requests

7 participants