Date: 2026/02/14 07:48:29 UTC+00:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
woodcutter_world:
type: world
debug: false
events:
on player breaks block:
- if <context.material> matches oak_log|spruce_log|birch_log|jungle_log|acacia_log|dark_oak_log|mangrove_log|cherry_log|pale_oak_log && <context.location.above.material> matches oak_log|spruce_log|birch_log|jungle_log|acacia_log|dark_oak_log|mangrove_log|cherry_log|pale_oak_log:
- define b <context.location>
- 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 <context.location> pitch:<util.random.decimal[0.5].to[0.9]>
- playsound sound:block.chest.open <context.location> pitch:<util.random.decimal[0.5].to[0.9]> volume:0.5
- wait 1t
- modifyblock <[b].above> <context.material.name.before[_]>_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 <script.data_key[data].get[coords]> 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 <script.data_key[data].get[coords]> 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 <player.location.forward_flat.sub[<player.location>].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 <entity[falling_block].with_map[<[fb]>]> <[1].add[0.5,0,0.5]> save:e
- flag <entry[e].spawned_entity> from_tree
- wait <util.random.int[18].to[22]>t
- adjust <entry[e].spawned_entity> velocity:<[vel].mul[2].with_y[<[2].mul[-0.05].add[0.1]>]>
- adjust <entry[e].spawned_entity> gravity:true