Date: 2023/09/26 14:34:14 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
builder_wand_test:
type: world
debug: true
events:
on player right clicks block with:job_hammer_test:
- if <player.cursor_on.material.is_block>:
#Mode selection part
- if <player.is_sneaking>:
- define mode <player.item_in_hand.flag[mode]>
- define modes <list[ligne|colonne|mur|sol]>
- define current <player.item_in_hand.flag[mode]>
- define index <[modes].find[<[mode]>]>
- define new_mode <[modes].get[<[index].add[1]>].if_null[<[modes].first>]>
- playsound <player.location> sound:entity_experience_orb_pickup
- inventory flag slot:HAND mode:<[new_mode]>
- actionbar "Marteau mode: <[new_mode]>"
- else:
- if !<player.cursor_on.material.advanced_matches[air|hopper|chest|piston|sticky_piston|observer|note_block]>:
- define block <player.cursor_on.material.name>
#display shape part
#Choose direction
- choose <player.location.yaw.simple>:
- case north:
- choose <player.item_in_hand.flag[mode]>:
#Choose mode
- case ligne:
- define cuboid <player.cursor_on.to_cuboid[<player.cursor_on.add[0,0,-3]>]>
- run build_hammer_reverse
- case sol:
- define cuboid <player.cursor_on.to_cuboid[<player.cursor_on.add[2,0,-2]>]>
- run build_hammer_reverse
- case colonne:
- define cuboid <player.cursor_on.to_cuboid[<player.cursor_on.add[0,3,0]>]>
- run build_hammer
- case mur:
- define cuboid <player.cursor_on.above.to_cuboid[<player.cursor_on.add[2,3,0]>]>
- run build_hammer
build_hammer:
type: task
definitions: build_hammer
script:
- inject path:builder_wand_test instantly
- if !<player.cursor_on.has_flag[holobuild_o]>:
- debugblock clear
- flag <player.cursor_on> holobuild_o:<player.uuid> expire:2s
- debugblock <[cuboid].blocks> color:lime players:<player> d:2s
#Build shape part
- else:
- if <player.inventory.contains_item[<[block]>].quantity[9]>:
- debugblock clear
- foreach <[cuboid].blocks> as:shape:
- foreach next if:!<player.flag[island_cubo].contains[<[shape]>]>
- modifyblock <[shape]> <[block]> delayed
- playeffect at:<[shape]> effect:white_ash quantity:10 offset:1 visibility:20
- wait 10t
build_hammer_reverse:
type: task
definitions: build_hammer
script:
- inject path:builder_wand_test instantly
- if !<player.cursor_on.has_flag[holobuild_o]>:
- debugblock clear
- flag <player.cursor_on> holobuild_o:<player.uuid> expire:2s
- debugblock <[cuboid].blocks> color:lime players:<player> d:2s
#Build shape part
- else:
- if <player.inventory.contains_item[<[block]>].quantity[9]>:
- debugblock clear
- foreach <[cuboid].blocks.reverse> as:shape:
- foreach next if:!<player.flag[island_cubo].contains[<[shape]>]>
- modifyblock <[shape]> <[block]> delayed
- playeffect at:<[shape]> effect:white_ash quantity:10 offset:1 visibility:20
- wait 10t