Add userspace definable block placement triggers #7

Merged
vlw merged 2 commits from feat/block-triggers into master 2026-08-08 16:35:52 +02:00
Owner

This PR adds block place (and hopefully some day place) triggers which can be used to run a function when a player places a block.

This feature requires more explanation. I will create an issue to add a wiki to this repository which will explain the usage part about this datapack a little bit better. One example is the @e[tag=block] entity which can be used temporarily in the callback function to access the position where block was placed, and thus, which block was placed.

It is also possible to run commands "as the placed block" by doing something like this in the callback function:

# Replace the placed block with air (destory the block immediately)
execute at @e[type=block] run setblock ~ ~ ~ minecraft:air static
This PR adds block place (and hopefully some day place) triggers which can be used to run a function when a player places a block. This feature requires more explanation. I will create an issue to add a wiki to this repository which will explain the usage part about this datapack a little bit better. One example is the `@e[tag=block]` entity which can be used temporarily in the callback function to access the *position* where block was placed, and thus, which block was placed. It is also possible to run commands "as the placed block" by doing something like this in the callback function: ```mcfunction # Replace the placed block with air (destory the block immediately) execute at @e[type=block] run setblock ~ ~ ~ minecraft:air static ```
vlw merged commit 71d49e5dbb into master 2026-08-08 16:35:52 +02:00
vlw deleted branch feat/block-triggers 2026-08-08 16:35:53 +02:00
Sign in to join this conversation.
No description provided.