r/MinecraftCommands • u/GalSergey Datapack Experienced • Aug 22 '24
Tutorial | Java New Right Click Method (24w34a)
214
Upvotes
r/MinecraftCommands • u/GalSergey Datapack Experienced • Aug 22 '24
36
u/GalSergey Datapack Experienced Aug 22 '24
Starting with snapshot 24w34a, there is now a new right click method.
Now, to make a right click detection for any item, a new
minecraft:consumablecomponent is used, in which you can now not only specify the time for use (consume_seconds), but also custom animation, sound, and even disable particles when used (has_consume_particles:false). And now for any item you can set a cooldown using the minecraft:use_cooldown component.See an example of an item and commands for command blocks for this:
When using only command blocks you can check only the ID of the item that was used, for more precise checking, for example custom_data component you need to use advancements in the datapack.
2
u/Alankao06 Command Rookie Aug 23 '24
Would it be possible to make something without consuming the item?
12
u/hmtbthnksk Command Experienced Aug 22 '24
That looks cool I want to make a mage datapack with this one
9
u/Ok_Pickle76 Aug 22 '24
FINALLY! MY DATAPACKS WONT SUCK
1
u/Nickyos19 Aug 23 '24
Is there a way to negate the consumption slow down when eating the item (without just applying a speed effect since it distorts FOV)? Trying to look for a smoother method that doesn’t change FOV if that’s possible.
1
u/toast_ghost12 Aug 28 '24
Know the syntax for applying a potion effect when an item is consumed?
4
u/aCactusOfManyNames Aug 22 '24
I've been using this for a while, but I never knew you could specify the animation and sound effect!
2
u/Vanndatchili Aug 22 '24
common galsergey W
1
u/Vovchick09 Aug 22 '24
Hell yeah!
1
u/Aron-Jonasson Command Experienced Aug 22 '24
Okay that's awesome, gonna be super useful for my minigames
1
u/OrganicPen8826 Aug 24 '24
Interaction Entities: