{ "format_version": "1.20.10", "minecraft:block": { "description": { "identifier": "craftables:cinnamon_log", "menu_category": { "category": "nature", "group": "itemGroup.name.log" }, "properties": { // Log direction property "craftables:axis": [0, 1, 2] } }, "components": { "minecraft:unit_cube": {}, "tag:craftables:cinnamon_log": {}, // Sets different textures for sides and top/bottom of log "minecraft:material_instances": { "*": { "texture": "cinnamon_log" }, "ends": { "texture": "cinnamon_log_top" }, "up": "ends", "down": "ends" }, "minecraft:destructible_by_mining": { "seconds_to_destroy": 1 }, // Sets log rotation on player placing "minecraft:on_player_placing": { "event": "craftables:set_axis" }, // Make log strippable "minecraft:on_interact": { "condition": "q.equipped_item_any_tag('slot.weapon.mainhand', 'minecraft:is_axe')", "event": "craftables:strip" } }, "events": { "craftables:set_axis": { "set_block_state": { "craftables:axis": "Math.floor(q.block_face / 2)" } }, "craftables:strip": { "sequence": [ { "run_command": { "command": "playsound hit.wood @a ~~~" }, // Damages axe of player who stripped the log "damage": { "type": "durability", "amount": 1, "target": "item" } }, { "condition": "q.block_state('craftables:axis') == 0", "run_command": { "command": "setblock ~~~ craftables:cinnamon_stripped_log [\"craftables:axis\"=0]" } }, { "condition": "q.block_state('craftables:axis') == 1", "run_command": { "command": "setblock ~~~ craftables:cinnamon_stripped_log [\"craftables:axis\"=1]" } }, { "condition": "q.block_state('craftables:axis') == 2", "run_command": { "command": "setblock ~~~ craftables:cinnamon_stripped_log [\"craftables:axis\"=2]" } } ] } }, "permutations": [ { "condition": "q.block_state('craftables:axis') == 0", "components": { "minecraft:transformation": { "rotation": [0, 0, 0] } } }, { "condition": "q.block_state('craftables:axis') == 1", "components": { "minecraft:transformation": { "rotation": [90, 0, 0] } } }, { "condition": "q.block_state('craftables:axis') == 2", "components": { "minecraft:transformation": { "rotation": [0, 0, 90] } } } ] } }