How to make it so that after clicking an item to a given block (then the action will start)

Started by Kozak K0KS on Thu, 11/17/2022 - 18:12

Topic category: Help with modding (Java Edition)

Last seen on 23:29, 28. Dec 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to make it so that after clicking an item to a given block (then the action will start)
Thu, 11/17/2022 - 18:12

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.)

Last seen on 03:11, 29. Nov 2022
Joined Dec 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Custom items have a "when…
Sun, 11/20/2022 - 06:05

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]

Last seen on 23:29, 28. Dec 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Thx
Sat, 12/03/2022 - 17:09

Thx