Skip to content

MCreator Player Break Procedure

NorthWestTrees edited this page Sep 25, 2024 · 4 revisions

Using tags

You can find information about this mods tool tags on this page.

When block destroyed by player

It is possible to use this trigger for the block element and make items drop when a player breaks the block.

Block trigger

image

Allowed trigger dependencies

The following dependencies can be used in the trigger.

  • x
  • y
  • z
  • world
  • entity
  • blockstate

Basic example

For a simple block-breaking system

  1. You first need to save the main-hand item to a local variable.
  2. Create a condition and test for the tool type and desired item tag.
  3. Drop your custom item.

image

Procedure download

player_break_block_procedure.zip

Fortune and Silk Touch example

For an advanced block-breaking system

  1. You first need to save the main-hand item to a local variable.
  2. Create a condition and test for the tool type and desired item tag.
  3. Test if the item has fortune, silk touch or nothing using else.
  4. If the item has fortune you then need to test for each level.
  5. For each fortune you can use repeat blocks to drop more than one item at a time.
  6. If the item has silk touch then you want to drop the block.
  7. If the block does not have silk touch or fortune then you want to drop only one item.

image

Procedure download

player_break_block_procedure.zip

Clone this wiki locally