Skip to content

Activator BLOCK_BREAK

MaxDikiy edited this page Sep 6, 2017 · 5 revisions

This activator works when the player destroys the block.

To create this activator, use the command:

/react add BLOCK_BREAK <ActivatorId> [block]:<ItemFormat(BlocksOnly!)] [loc:<Location>]

Temporary placeholders operating in this activator:

Placeholder Description
%block% Broken block, represented in Item Format
%blocktype% Block type
%blockdata% Block data value
%blocklocation% Coordinates of the block
%is_drop% If there is or not a drop when the block is destroyed.
If you change this temporary variable using the VAR_TEMP_SET action, you can enable or disable the drop. The possible values are: true/false

Examples

  1. The ban on the destruction of all the blocks in the world:
    We look at the sky when we enter this command
    /react add BLOCK_BREAK bb
    /react add bb a CANCEL_EVENT true
    or
BLOCK_BREAK:
    bb:
      block: ''
      actions:
      - CANCEL_EVENT=true
  1. The ban on the destruction of all chests in the world:
    /react add BLOCK_BREAK bb2 block:type:CHEST
    /react add bb2 a CANCEL_EVENT true
    or
BLOCK_BREAK:
  bb2:
    block: type:CHEST
    actions:
    - CANCEL_EVENT=true
  1. Prohibition of the destruction of one chest. We put the chest at the right point, look at it and enter the command:
    /react add BLOCK_BREAK bc3
    Or we enter the command explicitly: /react add BLOCK_BREAK bb3 block:type:CHEST loc:world,100,60,100
    /react add bb3 a CANCEL_EVENT true
    or
BLOCK_BREAK:
  bb3:
    block: type:CHEST
    location: world,100,60,100
    actions:
    - CANCEL_EVENT=true

location: world,100,60,100 - location of the CHEST

  1. Prohibit the destruction of only certain blocks of the world:
    /react add BLOCK_BREAK bb4
    /react add bb4 f COMPARE param:%blocktype% value1:DIRT value2:GRASS value3:STONE
    /react add bb4 a CANCEL_EVENT true
    or
BLOCK_BREAK:
  bb4:
    block: ''
    flags:
    - COMPARE=param:%blocktype% value1:DIRT value2:GRASS value3:STONE
    actions:
    - CANCEL_EVENT=true
  1. Show message when you break red wool blocks /react add BLOCK_BREAK break_red_wool block:{type:WOOL color:RED}
    /react add break_red_wool a MESSAGE &cIt was fine red wool...
    или
BLOCK_BREAK:
  break_red_wool:
    block: type:WOOL color:RED
    actions:
    - MESSAGE=&cIt was fine red wool...
Clone this wiki locally