info:namespace:testitems:test_change_state_block_interact:name:Test Change State Block Interactresource:generate:falsemodel_path:minecraft:block/diamond_blockmaterial:PAPERspecific_properties:block:placed_model:type:REAL_NOTEcancel_drop:falseevents:placed_block:interact:replace_block:from:test_change_state_block_interactto:test_change_state_block_interact_ondecrement_durability:0test_change_state_block_interact_on:name:Test Change State Block Interact ONresource:generate:falsemodel_path:minecraft:block/emerald_blockmaterial:PAPERspecific_properties:block:placed_model:type:REAL_NOTEcancel_drop:falselight_level:15events:placed_block:interact:replace_block:from:test_change_state_block_interact_onto:test_change_state_block_interactdecrement_durability:0
This requires ItemsAdder 4.0.13 or greater.
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:testitems:test_change_state_block_interact_template:name:Test Change State Block Interacttemplate:trueresource:generate:falsemodel_path:minecraft:block/diamond_blockmaterial:PAPERspecific_properties:block:placed_model:type:REAL_NOTEcancel_drop:false
Now 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.