Date: 2020/05/24 07:18:39 UTC-07: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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
maple_planks:
type: item
display name: "<&7><&l>Maple Planks"
material: acacia_planks
convert_wood:
type: world
events:
after player picks up acacia_log:
- define original_block <player.inventory.find[acacia_log]>
- inventory adjust slot:<[original_block]> "display_name:<&7><&l>Maple Log"
after player picks up stripped_acacia_wood:
- define original_block <player.inventory.find[stripped_acacia_wood]>
- inventory adjust slot:<[original_block]> "display_name:<&7><&l>Stripped Maple Wood"
after player picks up stripped_acacia_log:
- define original_block <player.inventory.find[stripped_acacia_log]>
- inventory adjust slot:<[original_block]> "display_name:<&7><&l>Stripped Maple Log"
after player picks up acacia_wood:
- define original_block <player.inventory.find[acacia_wood]>
- inventory adjust slot:<[original_block]> "display_name:<&7><&l>Maple Wood"
after player picks up acacia_planks:
- define original_block <player.inventory.find[acacia_planks]>
- inventory adjust slot:<[original_block]> "display_name:<&7><&l>Maple Planks"
on acacia_planks recipe formed:
- determine <item[maple_planks]>
on player crafts acacia_planks:
- determine <item[maple_planks]>
convert_saplings:
type: world
events:
after player picks up acacia_sapling:
- define original_sapling <player.inventory.find[acacia_sapling]>
- inventory adjust slot:<[original_sapling]> "display_name:<&7><&l>Maple Sapling"
tree_listener:
type: world
events:
on structure grows:
- if <context.location.biome.name> == plains:
- modifyblock <context.location> air
- determine passively cancelled
- choose <util.random.int[1].to[6]>:
- case 1:
- ~schematic load name:maplesmall1
- schematic paste name:maplesmall1 <context.location> noair
- case 2:
- ~schematic load name:maplesmall2
- schematic paste name:maplesmall2 <context.location> noair
- case 3:
- ~schematic load name:maplesmall3
- schematic paste name:maplesmall3 <context.location> noair
- case 4:
- ~schematic load name:maplesmall4
- schematic paste name:maplesmall4 <context.location> noair
- case 5:
- ~schematic load name:maplesmall5
- schematic paste name:maplesmall5 <context.location> noair
woodcutting_listener:
type: world
events:
on player places acacia_log:
- flag server woodcutting.player_made_trees.<context.location.simple>
- announce flagged
on player left clicks block with item:
- if <server.has_flag[woodcutting.player_made_trees.<context.location.simple>]>:
- determine cancelled
- if !<context.item.has_script>:
- determine cancelled
#choose axe type
- choose <context.script.name>:
- case bronze_axe:
- define axe <item[bronze_axe]>
- default:
- determine cancelled
#choose log
- if !<player.has_flag[woodcutting.tree]>:
- choose <context.location.material>:
- case acacia_log:
- flag player woodcutting.tree.<context.location.simple>
- flag player woodcutting.chop_count:0
- spawn hologram <context.location> save:woodcutting_display
- equip <entry[woodcutting_display].spawned_entity>
- adjust <entry[woodcutting_display].spawned_entity> custom_name_visible:true
- adjust <entry[woodcutting_display].spawned_entity> custom_name:<&4>0%
- flag player woodcutting.entity:<entry[woodcutting_display].spawned_entity>
#run the script
- if <player.has_flag[woodcutting.cooldown]>:
- narrate "<&c>You swing your axe and miss."
- playsound entity_llama_spit <player.location> pitch:-2
- determine cancelled
- choose <[axe].script.name>:
- case bronze_axe:
- flag player woodcutting.cooldown duration:5s
- flag player woodcutting.chop_count:++
- flag player woodcuttingxp:+:.30
- actionbar "<&a><&l>+ .30 XP"
- playsound block_wood_break <player.location> pitch:3
- choose <player.flag[woodcutting.chop_count]>:
- case 1:
- adjust <player.flag[woodcutting.entity]> custom_name:<&c><&l>20%
- case 2:
- adjust <player.flag[woodcutting.entity]> custom_name:<&6><&l>40%
- case 3:
- adjust <player.flag[woodcutting.entity]> custom_name:<&e><&l>60%
- case 4:
- adjust <player.flag[woodcutting.entity]> custom_name:<&2><&l>80%
- case 5:
- adjust <player.flag[woodcutting.entity]> custom_name:<&a><&l>100%
- playsound block_anvil_use <player.location> pitch:3
- flag player woodcutting.tree.<context.location.simple>:!
- remove <player.flag[woodcutting.entity]>
- flag player woodcutting.entity:!
- flag player woodcutting.chop_count:!