Turn Block ON-OFF
You can turn on and off blocks on interact.
First create your block template. This is the base block that will be used to create the on and off blocks.
In this example I use built-in Minecraft models to avoid creating new models just for this example.
info:
namespace: test
items:
test_change_state_block_interact_template:
name: Test Change State Block Interact
template: true
resource:
generate: false
model_path: minecraft:block/diamond_block
material: PAPER
specific_properties:
block:
placed_model:
type: REAL_NOTE
cancel_drop: falseNow create the off block. This block has an event listener on interaction that replaces itself with the on block (that will be created next).

Now create the on block. This block has an event listener on interaction that replaces itself with the off block (that we created before).
As you can see I specified the light_level: 15 property, to turn the light on.

Last updated
Was this helpful?