woodcutter_world: type: world debug: false events: on player breaks block: - if matches oak_log|spruce_log|birch_log|jungle_log|acacia_log|dark_oak_log|mangrove_log|cherry_log|pale_oak_log && matches oak_log|spruce_log|birch_log|jungle_log|acacia_log|dark_oak_log|mangrove_log|cherry_log|pale_oak_log: - define b - repeat 5: - define b <[b].below> - if <[b].material> matches dirt: - determine passively cancelled - run woodcutter_task def:<[b].above>|0 - playsound sound:entity.creaking.deactivate pitch: - playsound sound:block.chest.open pitch: volume:0.5 - wait 1t - modifyblock <[b].above> _sapling - repeat stop woodcutter_task: type: task debug: false data: coords: - 1,0,0 - 1,0,1 - 1,0,-1 - 1,1,0 - 1,1,1 - 1,1,-1 - -1,0,0 - -1,0,1 - -1,0,-1 - -1,1,0 - -1,1,1 - -1,1,-1 - 0,1,0 - 0,1,1 - 0,1,-1 - 0,0,1 - 0,0,-1 script: - if <[1].has_flag[woodcut_cooldown]>: - stop - flag <[1]> woodcut_cooldown expire:3 - choose <[1].material.name>: - case air: - stop - case oak_log spruce_log birch_log jungle_log acacia_log dark_oak_log mangrove_log cherry_log pale_oak_log: - wait 1t - foreach as:shift: - run woodcutter_task def:<[1].add[<[shift]>]>|<[2].add[1]>|0 - case oak_leaves spruce_leaves birch_leaves jungle_leaves acacia_leaves dark_oak_leaves mangrove_leaves cherry_leaves pale_oak_leaves: - wait 1t - foreach as:shift: - define loc <[1].add[<[shift]>]> - if <[loc].material.distance||-1> > <[3]||0>: - run woodcutter_task def:<[loc]>|<[2].add[1]>|<[3].add[1]||1> - default: - stop - define vel ].normalize.div[1024].mul[<[2].mul[12].add[4]>]> - definemap fb: fallingblock_type: <[1].material> fallingblock_hurt_entities: false fallingblock_drop_item: false gravity: false velocity: <[vel]> - modifyblock <[1]> air - wait 1t - spawn ]> <[1].add[0.5,0,0.5]> save:e - flag from_tree - wait t - adjust velocity:<[vel].mul[2].with_y[<[2].mul[-0.05].add[0.1]>]> - adjust gravity:true