Date: 2017/04/27 09:05:53 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
HoldPortalE:
type: entity
entity_type: e@armor_stand[arms=true;base_place=false;gravity=false;visible=false]
max_health: 1
health: 1
can_pickup_items: false
equipment: air|air|air|i@HoldPortalHead
TinyHoldPortalE:
type: entity
entity_type: e@armor_stand[arms=true;base_place=false;gravity=false;visible=false;is_small=true]
max_health: 1
health: 1
can_pickup_items: false
equipment: air|air|air|i@HoldPortalHead
HoldPortalHead:
type: item
material: i@human_skull[display_name=Chest;skull_skin=bc133ef0-71cb-4d54-adfa-79b2135b029c|eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmQ4MzJlZjAyYmJhN2I5YTZiNzlkNGE5NmYzYjFiMjRhZmEwMzA5ODQ1NjUyZmVjZDYxZDRlOTg1Zjc2ODIifX19]
display name: <&7><&l>Reward Chest
lore:
- <&9>Epic
HoldPortalItem:
type: item
material: i@human_skull[display_name=Chest;skull_skin=bc133ef0-71cb-4d54-adfa-79b2135b029c|eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmQ4MzJlZjAyYmJhN2I5YTZiNzlkNGE5NmYzYjFiMjRhZmEwMzA5ODQ1NjUyZmVjZDYxZDRlOTg1Zjc2ODIifX19]
display name: <&5><&l>Hold Portal
lore:
- <&8>Miscellaneous
- <&7>With this you can make
- <&7>a portal between 2 locations
- <&7>inside of your own Hold or
- <&7>your Hold and an ally's Hold.
- <&7>Left click to set the First Position
- <&7>Right click to set the Second Position
RightClickHoldPortalItem:
type: world
events:
on player right clicks with HoldPortalItem:
- ^determine cancelled passively
- ^flag <pl> RightPortal:<pl.location.simple>
- ^narrate "<&5>Second Position set to: <&d><pl.location.simple>"
- if <pl.flag[LeftPortal]> != null narrate "<&5>Both locations are set, if you want to create the portal type /hold portalconfirm"
LeftClickHoldPortalItem:
type: world
events:
on player left clicks with HoldPortalItem:
- ^determine cancelled passively
- ^flag <pl> LeftPortal:<pl.location.simple>
- ^narrate "<&5>First Position set to: <&d><pl.location.simple>"
- if <pl.flag[RightPortal]> != null narrate "<&5>Both locations are set, if you want to create the portal type /hold portal"
HoldPortalCommand:
type: world
events:
on hold command:
- if <context.args.get[1]||null> != null {
- if <context.args.get[1]> == portal && <context.args.get[2]||null> == null {
- ^flag <pl> HoldPortalConfirm:1 duration:10s
- ^narrate "<&5>If you want to make the Portals at: <&d><pl.flag[LeftPortal]> <&5>and <&d><pl.flag[RightPortal]> <&5>type /hold portal confirm, within 10 seconds."
- ^determine passively FULFILLED
}
- if <context.args.get[1]> == portal && <context.args.get[2]||null> == confirm {
- if <pl.flag[HoldPortalConfirm]> == 1 {
- ^flag <pl> LeftPortal:!
- ^flag <pl> LeftPortal:!
- ^flag <pl> HoldPortalConfirm:!
- ^determine passively FULFILLED
- ^chunkload <pl.flag[LeftPortal].as_location.chunk> duration:10s
- ^chunkload <pl.flag[RightPortal].as_location.chunk> duration:10s
- ^spawn HoldPortalE <pl.flag[LeftPortal].as_location> save:Portal
- ^flag <entry[Portal].spawned_entities.get[1]> Owner:<pl.name>
- ^flag <entry[Portal].spawned_entities.get[1]> Number:1
- ^flag <entry[Portal].spawned_entities.get[1]> LocationOther:<pl.flag[RightPortal].as_location>
- ^flag <entry[Portal].spawned_entities.get[1]> IDOther:0
- ^flag <pl> ID1:<entry[Portal].spawned_entities.get[1]>
- ^spawn TinyHoldPortalE <pl.flag[LeftPortal].as_location.add[0,0.6,0]>
- ^spawn TinyHoldPortalE <pl.flag[LeftPortal].as_location.add[0,1.0,0]>
- ^spawn TinyHoldPortalE <pl.flag[LeftPortal].as_location.add[0.2,0.8,0]>
- ^spawn TinyHoldPortalE <pl.flag[LeftPortal].as_location.add[-0.2,0.8,0]>
- ^spawn TinyHoldPortalE <pl.flag[LeftPortal].as_location.add[0,0.8,0.2]>
- ^spawn TinyHoldPortalE <pl.flag[LeftPortal].as_location.add[0,0.8,-0.2]>
- ^wait 1t
- ^spawn HoldPortalE <pl.flag[RightPortal].as_location> save:Portal
- ^flag <entry[Portal].spawned_entities.get[1]> Owner:<pl.name>
- ^flag <entry[Portal].spawned_entities.get[1]> Number:2
- ^flag <entry[Portal].spawned_entities.get[1]> LocationOther:<pl.flag[LeftPortal].as_location>
- ^flag <entry[Portal].spawned_entities.get[1]> IDOther:0
- ^flag <pl> ID2:<entry[Portal].spawned_entities.get[1]>
- ^spawn TinyHoldPortalE <pl.flag[RightPortal].as_location.add[0,0.6,0]>
- ^spawn TinyHoldPortalE <pl.flag[RightPortal].as_location.add[0,1.0,0]>
- ^spawn TinyHoldPortalE <pl.flag[RightPortal].as_location.add[0.2,0.8,0]>
- ^spawn TinyHoldPortalE <pl.flag[RightPortal].as_location.add[-0.2,0.8,0]>
- ^spawn TinyHoldPortalE <pl.flag[RightPortal].as_location.add[0,0.8,0.2]>
- ^spawn TinyHoldPortalE <pl.flag[RightPortal].as_location.add[0,0.8,-0.2]>
- ^flag <pl.flag[ID1].as_entity> IDOther:<pl.flag[ID2]>
- ^flag <pl.flag[ID2].as_entity> IDOther:<pl.flag[ID1]>
} else {
- ^narrate "<&5>Use /hold portal."
- ^determine passively FULFILLED
}
}
}
RightClickHoldPortal:
type: world
events:
on player right clicks at HoldPortalE:
- narrate "t"
RightClickHoldPortal:
type: world
events:
on player right clicks at TinyHoldPortalE:
- narrate "<context.entity.location.find.living_entities.within[2].filter[scriptname.is[equals].to[HoldPortalE]].get[1].flag[Del]>"
SHoldPortalE:
type: task
script:
- spawn HoldPortalE <p@headlessjoey.location> save:Portal
- flag <entry[Portal].spawned_entities.get[1]> Del:1
- spawn TinyHoldPortalE <p@headlessjoey.location.add[0,0.6,0]>
- spawn TinyHoldPortalE <p@headlessjoey.location.add[0,1.0,0]>
- spawn TinyHoldPortalE <p@headlessjoey.location.add[0.2,0.8,0]>
- spawn TinyHoldPortalE <p@headlessjoey.location.add[-0.2,0.8,0]>
- spawn TinyHoldPortalE <p@headlessjoey.location.add[0,0.8,0.2]>
- spawn TinyHoldPortalE <p@headlessjoey.location.add[0,0.8,-0.2]>
HoldPortalR:
type: task
script:
- ^remove <pl.location.find.living_entities.within[2].filter[scriptname.contains_any[TinyHoldPortalE|HoldPortalE]]>
###################