Started by
Kozak K0KS
on
Topic category: Help with Minecraft modding (Java Edition)
Someone explain to me how to make a right-click on a given block perform an action (for example: give an item to the player, etc.)
Topic category: Help with Minecraft modding (Java Edition)
Someone explain to me how to make a right-click on a given block perform an action (for example: give an item to the player, etc.)
Custom items have a "when right clicked on block" trigger
Custom blocks have a "when right clicked" trigger
For vanilla blocks or to make it so that you only right click the block if you have the item needed in hand, use the global trigger On player right clicks a block
Example of a setup for this
Global Trigger: On player right clicks a block
If [item in [*main-hand of event/target entity*] = [*stick*]] and [get block at x y z = [*gold_block*]]]
do [add 1 [*gold_nugget*] to [event/target] inventory]
Thx