This activator works when the player clicks on the block with the left or right mouse button. It allows you to control the actions on the blocks. You can prohibit both the destruction of the blocks and their installation. You can apply these rules to both a single block and a group of blocks. The activator can be configured to prohibit the opening of any inventory that opens when you click on the relevant blocks (CHEST, HOPPER, BEACON, ..., etc.).
To create this activator use command:
/react add BLOCK_CLICK <ActivatorId> [type:
<blockType>
] [click: left/Right/Any] [loc:
<loc>
]
Placeholder | Description |
---|---|
%blocktype% | block type |
%blocklocation% | coordinates of the block |
%click% | left or right , depending on which mouse button you clicked on the block. |
/react add BLOCK_CLICK bc
/react add bc a CANCEL_EVENT true
BLOCK_CLICK:
bc:
block-type: ''
click-type: ANY
actions:
- CANCEL_EVENT=true
/react add BLOCK_CLICK bc2 type:CHEST click:right
/react add bc2 a CANCEL_EVENT true
BLOCK_CLICK:
bc2:
block-type: CHEST
click-type: RIGHT
actions:
- CANCEL_EVENT=true
In this example, if click-type: LEFT
, it will be forbidden to break all the chests, but it is allowed to open. If click-type: ANY
, then it will be forbidden to break and open the chests.
BLOCK_CLICK:
bc3:
block-type: CHEST
click-type: RIGHT
location: world,100,60,100
actions:
- CANCEL_EVENT=true
location: world,100,60,100
- chest block coordinates
/react add BLOCK_CLICK bc4 click:left
/react add bc4 f COMPARE param:%blocktype% value1:DIRT value2:GRASS value3:STONE
/react add bc4 a CANCEL_EVENT true
BLOCK_CLICK:
bc4:
block-type: ''
click-type: LEFT
flags:
- COMPARE=param:%blocktype% value1:DIRT value2:GRASS value3:STONE
actions:
- CANCEL_EVENT=true
You can come up with a lot of things with this activator.