mojira.dev
MC-275797

The use_cooldown component only works for certain item interactions with entities

Confirming in 24w46a. However; please refer to the pinned comment for the most recent context on this issue.

The use_cooldown component does work for some item interactions on entities, however; some other items do not work like shearing a sheep, naming an entity, putting an item in an item frame, leading an entity, and more.

Steps to Reproduce:

  1. Spawn two pigs

  2. Get the following item stacks:

    /give @p minecraft:name_tag[minecraft:use_cooldown={seconds:3},minecraft:custom_name="pig"] 64
    /give @p carrot[minecraft:use_cooldown={seconds:3}] 64
  3. Use both items on the pigs

Expected Result:

Both items would go on cooldown once used, because they are both item usages on an entity.

Observed Behavior:

Only the carrot will go on cooldown, and the lead will not.

Screenshots/Videos:

[media]

Notes:

The carrot working is likely because the item also has an eating usage as well.

Linked issues

Attachments

Comments 2

Can confirm.

Also does not work for speeding up the growth of animals, from my testing.

In 1.21.2 and up, the carrot no longer goes on cooldown. The end result is that both the carrot and nametag do not have any cooldown after usage on an entity.

This has been added as extra context in a pinned comment in favor of altering the issue after its triage just to be safe.

[Mod] Jingy

kingbdogz

1285616

Confirmed

Expansion B

Important

Commands

component, use_cooldown

24w34a, 24w46a

Retrieved