Date: 2025/01/04 12:46:55 UTC-08: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
spawn_woodsman:
type: item
debug: true
material: stick
display name: summon woodsman
recipes:
1:
type: shaped
input:
- air|air|air
- air|oak_log|air
- air|stick|air
spawn_woodsmand_handler:
type: world
debug: true
events:
on player right clicks block with:spawn_woodsman:
- create player WoodsMan <context.location.add[0,1,0]> save:WoodsMan
- equip <entry[WoodsMan].created_npc> hand:iron_axe
- adjust <entry[WoodsMan].created_npc> can_pickup_items:true
- assignment set script:woodsman_npc_assignment npc:<entry[WoodsMan].created_npc>
woodsman_npc_assignment:
type: assignment
debug: true
actions:
on assignment:
- trigger name:click state:true
- define woodsman_chest_location <npc.location.add[1,0,0]>
- wait 1t
- foreach <npc.location.find_blocks[*log].within[50]> as:WOOD:
- walk <npc> <[WOOD].right> auto_range
- wait 1s system
- while <npc.is_navigating>:
- wait 3s system
- chat "distance above <[WOOD].y.sub[<npc.location.y>]>"
- if <[WOOD].y.sub[<npc.location.y>]> < 4:
- break <[WOOD]> <npc> radius:3
- foreach <npc.location.find_blocks[*leaves].within[50]> as:LEAVES:
- ~walk <npc> <[LEAVES].below> auto_range
- wait 1s system
- while <npc.is_navigating>:
- wait .1s system
- chat "distance above <[LEAVES].y.sub[<npc.location.y>]>"
- if <[LEAVES].y.sub[<npc.location.y>]> < 4:
- break <[LEAVES]> <npc> radius:3
on click:
- chat "hello"