· 6 years ago · May 27, 2019, 03:14 AM
1options:
2 P: &7[&bUHC&7]&b
3
4#Made with love by hakim <3
5#Contact me on discord - æ„›ã—ã¦ã‚‹#5199
6
7on mine of stone:1 or stone:3 or stone:5:
8 wait 1 tick
9 loop entities in radius 0.25 around event-block:
10 if loop-entity is a dropped item:
11 delete loop-entity
12 if player has space for (1 of cobblestone):
13 give player (1 cobblestone)
14 else:
15 drop (1 of cobblestone) at (location 0.5 above player)
16
17
18on place of crafting table:
19 register new shaped recipe for 8 arrows using air, air, flint, air, air, stick, air, air, feather
20 register new shaped recipe for 8 arrows using air, flint, air, air, stick, air, air, feather, air
21 register new shaped recipe for 8 arrows using flint, air, air, air, stick, air, feather, air, air
22
23function turnEvents(s: string):
24 if {_s} is "Final heal":
25 if {Scenarios::Chicken} is true:
26 broadcast "{@P} &fFinal heal did not happen because it is &cChicken"
27 else:
28 Broadcast(true, "&bFinal Heal", "&fDo not ask for another one")
29 loop all players:
30 send %loop-player% title "&7&l» &bFinal Heal&7&l «" with subtitle "&7You will not recieve anymore!" for 3 second
31 execute console command "/playsoundall block.anvil.use"
32 loop {UHC::AlivePlayers::*}:
33 set {_P} to loop-index parsed as offline player
34 if {_P} is online:
35 set {_P}'s health to 10
36 if {Scenarios::Superheroes} is true:
37 {UHC::Superheroes::%{_P}%} is 2
38 set {_P}'s health to 16
39 else:
40 set {UHC::FinalHeal::%{_P}%} to true
41 execute console command "/timer cancel"
42 execute console command "/timer %(({Config::PvP} * 60) - {UHC::GameTime})% &cPvP &7» &b"
43 if {_s} is "PvP":
44 execute console command "/mv modify set PvP true UHC"
45 execute console command "/mv modify set PvP true UHC_nether"
46 execute console command "/mv modify set PvP true UHC_the_end"
47 SetMoles("gay")
48 SetKiraL("Gay")
49 Broadcast(false, "&cPVP Has been Enabled", "")
50 loop all players:
51 send %loop-player% title "&7&l» &bPVP Enabled&7&l «" with subtitle "&7Good Luck" for 3 second
52 execute console command "/playsoundall mob.irongolem.death"
53 execute console command "/timer cancel"
54 execute console command "/timer %(({Config::Meetup} * 60) - {UHC::GameTime})% &6Meetup &7» &b"
55 if {_s} is "Meetup":
56 SkyHighStart("Gay")
57 EnderDragonRushPortalCreate("Gay")
58 BorderShrink(1000)
59 Broadcast(false, "&bMEETUP", "&fBorder will start shrinking until 100x100")
60 loop all players:
61 send %loop-player% title "&7&l» &bMeetup is Now&7&l «" with subtitle "&7Stop Mining and go to surface!" for 3 second
62 execute console command "/playsoundall mob.irongolem.death"
63
64function checkEvents(s: string, seconds: boolean = false):
65 if {_s} is "PvP":
66 set {_time} to ({Config::PvP} * 60)
67 if {_s} is "Meetup":
68 set {_time} to ({Config::Meetup} * 60)
69 if {_s} is "Final heal":
70 set {_time} to ({Config::Final heal} * 60)
71 if {_s} is "Border shrink":
72 {UHC::GameTime} is bigger than ({Config::Meetup} * 60)
73 set {_time} to ({Config::Border shrink every X} * 60)
74 if ({UHC::GameTime} mod {_time}) is 0:
75 set {_border} to diameter of world("UHC")
76 remove ({Config::Border shrink radius per shrink} * 2) from {_border}
77 if {_border} is bigger than 200:
78 set diameter of world("UHC") to {_border} over ("%{_time}% seconds" parsed as timespan)
79 stop
80 set {_check} to ({_time} - {UHC::GameTime})
81 if {_check} is 300:
82 broadcast "{@P} &b%{_s}% is in 5 minutes"
83 execute console command "/playsoundall gui.button.press"
84 if {_check} is 60:
85 broadcast "{@P} &b%{_s}% is in 1 minute"
86 execute console command "/playsoundall gui.button.press"
87 if {_seconds} is true:
88 if {_check} is 15:
89 broadcast "{@P} &b%{_s}% is in 15 seconds"
90 execute console command "/playsoundall gui.button.press"
91 if {_check} is 10:
92 broadcast "{@P} &b%{_s}% is in 10 seconds"
93 execute console command "/playsoundall gui.button.press"
94 if {_check} is 5:
95 broadcast "{@P} &b%{_s}% is in 5 seconds"
96 execute console command "/playsoundall gui.button.press"
97 if {_check} is 0:
98 turnEvents("%{_s}%")
99 loop all players:
100 send %loop-player% title "&7&l» &bThe UHC Has Started&7&l «" with subtitle "&7Good Luck %loop-player%" for 3 second
101
102command /border <integer>:
103 permission: staff.member
104 trigger:
105 broadcast "{@P} &cBorder Shrinking to %arg-1% in 3 seconds"
106 wait 1 second
107 broadcast "{@P} &cBorder Shrinking to %arg-1% in 2 seconds"
108 wait 1 second
109 broadcast "{@P} &cBorder Shrinking to %arg-1% in 1 second"
110 execute console command "/shrink UHC %arg-1%"
111
112function StartGameTime(s: text):
113 Broadcast(true, "&bUHC", "&fThe UHC Has Started, Good Luck!")
114 send %loop-player% title "&7&l» &bThe UHC Has Started &7&l«" with subtitle "&bGood Luck &b%loop-player%"
115 set {UHC::GameTime} to 0
116 checkEvents("Final heal")
117 execute console command "/timer cancel"
118 execute console command "/timer %({Config::Final heal} * 60)% &aFinal Heal &7» &b"
119 while {UHC::Status} is true:
120 wait 1 second
121 add 1 to {UHC::GameTime}
122 set {_Hours} to floor(({UHC::GameTime} / 60) / 60)
123 set {_Minutes} to floor(({UHC::GameTime} / 60) - ({_Hours} * 60))
124 set {_Seconds} to floor(({UHC::GameTime} - ({_Minutes} * 60)) - (({_Hours} * 60) * 60))
125 if length of "%{_Hours}%" is 1:
126 set {_Hours} to "0%{_Hours}%"
127 if length of "%{_Minutes}%" is 1:
128 set {_Minutes} to "0%{_Minutes}%"
129 if length of "%{_Seconds}%" is 1:
130 set {_Seconds} to "0%{_Seconds}%"
131 set {UHC::GameTimeT} to "%{_Hours}%:%{_Minutes}%:%{_Seconds}%"
132 loop all players:
133 Scoreboard(loop-player)
134 if ({UHC::GameTime} mod 5) is 0:
135 checkEvents("Final heal")
136 checkEvents("PvP", true)
137 checkEvents("Meetup", true)
138 checkEvents("Border shrink", true)
139
140on join:
141 {UHC::FinalHeal::%player%} is true
142 set player's health to 10
143 if {Scenarios::Superheroes} is true:
144 {UHC::Superheroes::%player%} is 2
145 set player's health to 16
146 message "{@P} You have been given final heal since you were offline"
147 delete {UHC::FinalHeal::%player%}
148
149command /spec [<text>]:
150 permission: staff.spec
151 trigger:
152 if command sender is CONSOLE:
153 if arg-1 is set:
154 execute console command "/uhc spec %arg-1%"
155 if arg-1 is set:
156 execute player command "/uhc spec %arg-1%"
157 else:
158 execute player command "/uhc spec"
159
160import:
161 java.lang.System
162
163function getConfigStatus(C: text, type: object = 1) :: item:
164 if {_C} is "Nether":
165 if world("UHC_nether") is set:
166 return light green dye named "&aOn"
167 else:
168 return gray dye named "&cOff"
169 else if {_C} is "End":
170 if world("UHC_the_end") is set:
171 return light green dye named "&aOn"
172 else:
173 return gray dye named "&cOff"
174 else if {_type} is "percent" or "string" or "number":
175 if {_type} is "percent":
176 return paper named "&6%{Config::%{_C}%}%%%"
177 if {_type} is "string":
178 return paper named "&6%{Config::%{_C}%}%"
179 if {_type} is "number":
180 return paper named "&6%{Config::%{_C}%}%"
181 else if {Config::%{_C}%} is true:
182 if {_type} is "rule":
183 return light green dye named "&aAllowed"
184 else:
185 return light green dye named "&aOn"
186 else if {Config::%{_C}%} is not set:
187 if {_type} is "rule":
188 return gray dye named "&cDisallowed"
189 else:
190 return gray dye named "&cOff"
191 else if {Config::%{_C}%} is set:
192 return paper named "&6%{Config::%{_C}%}%"
193
194function getConfigStatusText(C: text, rule: boolean = false) :: string:
195 if {_C} is "Nether":
196 if world("UHC_nether") is set:
197 return "&aOn"
198 else:
199 return "&cOff"
200 else if {_C} is "End":
201 if world("UHC_the_end") is set:
202 return "&aOn"
203 else:
204 return "&cOff"
205 else if {Config::%{_C}%} is true:
206 if {_rule} is true:
207 return "&aAllowed"
208 else:
209 return "&aOn"
210 else if {Config::%{_C}%} is false:
211 if {_rule} is true:
212 return "&cDisallowed"
213 else:
214 return "&cOff"
215 else if {Config::%{_C}%} is not set:
216 if {_rule} is true:
217 return "&cDisallowed"
218 else:
219 return "&cOff"
220
221function toggleConfig(C: text, P: object = 1, S: number = 1):
222 if {_P} is set:
223 {_P} doesn't have permission "staff.member"
224 stop
225 if {_C} is "Nether":
226 if world("UHC_nether") is set:
227 send "{@P} &bDisable Nether with /mv delete UHC_nether" to {_P}
228 else:
229 send "{@P} &bEnable Nether with /uhc gennether" to {_P}
230 else if {_C} is "End":
231 if world("UHC_the_end") is set:
232 send "{@P} &bDisable End with /mv delete UHC_the_end" to {_P}
233 else:
234 send "{@P} &bEnable End with /uhc genend" to {_P}
235 else if {Config::%{_C}%} is true:
236 delete {Config::%{_C}%}
237 broadcast "{@P} &b%{_C}% has been turned &coff"
238 {_P} != 1
239 else if {Config::%{_C}%} is false:
240 set {Config::%{_C}%} to true
241 broadcast "{@P} &b%{_C}% has been turned &aon"
242 {_P} != 1
243 else if {Config::%{_C}%} is not set:
244 set {Config::%{_C}%} to true
245 broadcast "{@P} &b%{_C}% has been turned &aon"
246 {_P} != 1
247 if {_P} is a player:
248 format gui slot {_S} of {_P} with getConfigStatus("%{_C}%") to run function toggleConfig("%{_C}%", {_P}, {_S})
249
250on chat:
251 {UHC::setConfig::%player%} is set
252 if difference between {UHC::setConfig::%player%::time} and now is more than 1 minute:
253 delete {UHC::setConfig::%player%}
254 delete {UHC::setConfig::%player%::*}
255 else:
256 cancel the event
257 if {UHC::setConfig::%player%::type} is "percent":
258 set {_m} to message
259 if {_m} contains "%%":
260 replace all "%%" with "" in {_m}
261 set {_number} to {_m} parsed as number
262 if {_number} is set:
263 {_number} is between 1 and 100
264 set {_type} to true
265 if {_type} is not set:
266 message "{@P} &c%message% is not a percentage (1%%-100%%) which is required for %{UHC::setConfig::%player%}% config"
267 delete {UHC::setConfig::%player%}
268 delete {UHC::setConfig::%player%::*}
269 else:
270 set {Config::%{UHC::setConfig::%player%}%} to {_number}
271 message "{@P} &aThe config %{UHC::setConfig::%player%}% has been set to %{_number}%%%"
272 broadcast "{@P} &b%player% has set %{UHC::setConfig::%player%}% to %{_number}%%%"
273 execute console command "/playsoundall note.pling"
274 delete {UHC::setConfig::%player%}
275 delete {UHC::setConfig::%player%::*}
276 if {UHC::setConfig::%player%::type} is "number":
277 set {_type} to message parsed as number
278 if {_type} is not set:
279 message "{@P} &c%message% is not a Number which is required for %{UHC::setConfig::%player%}% config"
280 delete {UHC::setConfig::%player%}
281 delete {UHC::setConfig::%player%::*}
282 else:
283 set {Config::%{UHC::setConfig::%player%}%} to {_type}
284 message "{@P} &aThe config %{UHC::setConfig::%player%}% has been set to %message%"
285 broadcast "{@P} &b%player% has set %{UHC::setConfig::%player%}% to %message%"
286 execute console command "/playsoundall note.pling"
287 delete {UHC::setConfig::%player%}
288 delete {UHC::setConfig::%player%::*}
289 else if {UHC::setConfig::%player%::type} is "string":
290 set {_type} to message parsed as string
291 if {_type} is not set:
292 message "{@P} &c%message% is not a Text which is required for %{UHC::setConfig::%player%}% config"
293 delete {UHC::setConfig::%player%}
294 delete {UHC::setConfig::%player%::*}
295 else:
296 set {Config::%{UHC::setConfig::%player%}%} to {_type}
297 message "{@P} &aThe config %{UHC::setConfig::%player%}% has been set to %message%"
298 broadcast "{@P} &b%player% has set %{UHC::setConfig::%player%}% to %message%"
299 execute console command "/playsoundall note.pling"
300 delete {UHC::setConfig::%player%}
301 delete {UHC::setConfig::%player%::*}
302
303function setConfigValue(C: text, P: player, type: string):
304 {_P} has permission "staff.member"
305 set {UHC::setConfig::%{_P}%} to {_C}
306 set {UHC::setConfig::%{_P}%::time} to now
307 set {UHC::setConfig::%{_P}%::type} to {_type}
308 send "{@P} &bPlease input the value for %{_C}% using chat (Must be a %{_type}%)" to {_P}
309 send "{@P} &bExpires in 1 minute" to {_P}
310
311function GameSettings(P: player):
312 open virtual chest inventory with size 6 named "&c&lUHC - &b&lGame Settings" to {_P}
313 format gui slot 0 of {_P} with crafting table named "&b&lGame Settings" to close then run function GameSettings({_P})
314 format gui slot 1 of {_P} with empty map named "&b&lMap Settings" to close then run function MapSettings({_P})
315 format gui slot 2 of {_P} with redstone named "&b&lRules Settings" to close then run function RulesSettings({_P})
316 format gui slot 3 of {_P} with compass named "&b&lMatch Settings" to close then run function MatchSettings({_P})
317 loop 9 times:
318 format gui slot (loop-number + 8) of {_P} with white glass
319 format gui slot 18 of {_P} with oak sapling named "&b&lApple drops from all trees"
320 format gui slot 27 of {_P} with getConfigStatus("Apple drops from all trees") to run function toggleConfig("Apple drops from all trees", {_P}, 27)
321 format gui slot 19 of {_P} with apple named "&b&lApple rates"
322 format gui slot 28 of {_P} with getConfigStatus("Apple rates", "percent") to close then run function setConfigValue("Apple rates", {_P}, "percent")
323 format gui slot 20 of {_P} with shears named "&b&lShears"
324 format gui slot 29 of {_P} with getConfigStatus("Shears") to run function toggleConfig("Shears", {_P}, 29)
325 format gui slot 21 of {_P} with ender pearl named "&b&lEnderpearl damage"
326 format gui slot 30 of {_P} with getConfigStatus("Enderpearl damage") to run function toggleConfig("Enderpearl damage", {_P}, 30)
327 format gui slot 22 of {_P} with saddle named "&b&lHorses"
328 format gui slot 31 of {_P} with getConfigStatus("Horses") to run function toggleConfig("Horses", {_P}, 31)
329 format gui slot 23 of {_P} with iron sword named "&b&lTeam damage"
330 format gui slot 32 of {_P} with getConfigStatus("Team damage") to run function toggleConfig("Team damage", {_P}, 32)
331 format gui slot 24 of {_P} with golden apple:0 named "&b&lAbsorption"
332 format gui slot 33 of {_P} with getConfigStatus("Absorption") to run function toggleConfig("Absorption", {_P}, 33)
333 format gui slot 25 of {_P} with player head named "&b&lGolden Heads"
334 format gui slot 34 of {_P} with getConfigStatus("Golden Heads") to run function toggleConfig("Golden Heads", {_P}, 34)
335 format gui slot 26 of {_P} with golden apple:1 named "&b&lNotch Apples"
336 format gui slot 35 of {_P} with getConfigStatus("Notch Apples") to run function toggleConfig("Notch Apples", {_P}, 35)
337 format gui slot 36 of {_P} with netherrack named "&b&lNether"
338 format gui slot 45 of {_P} with getConfigStatus("Nether") to close then run function toggleConfig("Nether", {_P}, 45)
339 format gui slot 37 of {_P} with eye of ender named "&b&lEnd"
340 format gui slot 46 of {_P} with getConfigStatus("End") to close then run function toggleConfig("End", {_P}, 46)
341 format gui slot 38 of {_P} with glowstone dust named "&b&lTier 2 Potions"
342 format gui slot 47 of {_P} with getConfigStatus("Tier 2 Potions") to run function toggleConfig("Tier 2 Potions", {_P}, 47)
343 format gui slot 39 of {_P} with potion:16452 named "&b&lPoison"
344 format gui slot 48 of {_P} with getConfigStatus("Poison") to run function toggleConfig("Poison", {_P}, 48)
345 format gui slot 40 of {_P} with potion:16457 named "&b&lStrength"
346 format gui slot 49 of {_P} with getConfigStatus("Strength") to run function toggleConfig("Strength", {_P}, 49)
347
348function MapSettings(P: player):
349 open virtual chest inventory with size 6 named "&b&lUHC - &b&lBorder Settings" to {_P}
350 format gui slot 0 of {_P} with crafting table named "&b&lGame Settings" to close then run function GameSettings({_P})
351 format gui slot 1 of {_P} with empty map named "&b&lMap Settings" to close then run function MapSettings({_P})
352 format gui slot 2 of {_P} with redstone named "&b&lRules Settings" to close then run function RulesSettings({_P})
353 format gui slot 3 of {_P} with compass named "&b&lMatch Settings" to close then run function MatchSettings({_P})
354 loop 9 times:
355 format gui slot (loop-number + 8) of {_P} with white glass
356 format gui slot 18 of {_P} with bedrock named "&b&lMap size (Radius)"
357 format gui slot 27 of {_P} with getConfigStatus("Map Size", "number") to close then run function setConfigValue("Map Size", {_P}, "number")
358 format gui slot 19 of {_P} with golden apple:0 named "&b&lFinal heal (in minutes)"
359 format gui slot 28 of {_P} with getConfigStatus("Final heal", "number") to close then run function setConfigValue("Final heal", {_P}, "number")
360 format gui slot 20 of {_P} with iron sword named "&b&lPvP Enable (in minutes)"
361 format gui slot 29 of {_P} with getConfigStatus("PvP", "number") to close then run function setConfigValue("PvP", {_P}, "number")
362 format gui slot 21 of {_P} with compass named "&b&lMeetup (in minutes)"
363 format gui slot 30 of {_P} with getConfigStatus("Meetup", "number") to close then run function setConfigValue("Meetup", {_P}, "number")
364 format gui slot 22 of {_P} with bedrock named "&b&lBorder shrink every X (in minutes)"
365 format gui slot 31 of {_P} with getConfigStatus("Border shrink every X", "number") to close then run function setConfigValue("Border shrink every X", {_P}, "number")
366 format gui slot 23 of {_P} with bedrock named "&b&lBorder shrink radius per shrink"
367 format gui slot 32 of {_P} with getConfigStatus("Border shrink radius per shrink", "number") to close then run function setConfigValue("Border shrink radius per shrink", {_P}, "number")
368
369function RulesSettings(P: player):
370 open virtual chest inventory with size 6 named "&b&lUHC - &b&lRules Settings" to {_P}
371 format gui slot 0 of {_P} with crafting table named "&b&lGame Settings" to close then run function GameSettings({_P})
372 format gui slot 1 of {_P} with empty map named "&b&lMap Settings" to close then run function MapSettings({_P})
373 format gui slot 2 of {_P} with redstone named "&b&lRules Settings" to close then run function RulesSettings({_P})
374 format gui slot 3 of {_P} with compass named "&b&lMatch Settings" to close then run function MatchSettings({_P})
375 loop 9 times:
376 format gui slot (loop-number + 8) of {_P} with white glass
377 format gui slot 18 of {_P} with diamond ore named "&b&lXray [UBL - Change with precaution]"
378 format gui slot 27 of {_P} with getConfigStatus("Xray", "rule") to run function toggleConfig("Xray", {_P}, 28)
379 format gui slot 19 of {_P} with crafting table named "&b&lToggle Sneak [UBL - Change with precaution]"
380 format gui slot 28 of {_P} with getConfigStatus("Toggle Sneak", "rule") to run function toggleConfig("Toggle Sneak", {_P}, 29)
381 format gui slot 20 of {_P} with crafting table named "&b&lToggle Sprint"
382 format gui slot 29 of {_P} with getConfigStatus("Toggle Sprint" , "rule") to run function toggleConfig("Toggle Sprint", {_P}, 30)
383 format gui slot 21 of {_P} with eye of ender named "&b&lStalking"
384 format gui slot 30 of {_P} with getConfigStatus("Stalking", "string") to close then run function setConfigValue("Stalking", {_P}, "string")
385 format gui slot 22 of {_P} with wooden plank named "&b&lTowering"
386 format gui slot 31 of {_P} with getConfigStatus("Towering", "string") to close then run function setConfigValue("Towering", {_P}, "string")
387 format gui slot 23 of {_P} with bedrock named "&b&lBorder Trapping"
388 format gui slot 32 of {_P} with getConfigStatus("Border Trapping", "rule") to run function toggleConfig("Border Trapping", {_P}, 32)
389 format gui slot 36 of {_P} with iron pickaxe named "&b&lStripmining"
390 format gui slot 45 of {_P} with getConfigStatus("Stripmining", "string") to close then run function setConfigValue("Stripmining", {_P}, "string")
391 format gui slot 37 of {_P} with cobblestone stairs named "&b&lStaircasing"
392 format gui slot 46 of {_P} with getConfigStatus("Staircasing", "string") to close then run function setConfigValue("Staircasing", {_P}, "string")
393 format gui slot 38 of {_P} with note block named "&b&lMining to sounds"
394 format gui slot 47 of {_P} with getConfigStatus("Mining to sounds", "rule") to run function toggleConfig("Mining to sounds", {_P}, 47)
395 format gui slot 39 of {_P} with compass named "&b&lMining to coords"
396 format gui slot 48 of {_P} with getConfigStatus("Mining to coords", "rule") to run function toggleConfig("Mining to coords", {_P}, 48)
397 format gui slot 40 of {_P} with stone named "&b&lPokeholing"
398 format gui slot 49 of {_P} with getConfigStatus("Pokeholing", "rule") to run function toggleConfig("Pokeholing", {_P}, 49)
399
400function MatchSettings(P: player):
401 open virtual chest inventory with size 6 named "&b&lUHC - &b&lMatch Settings" to {_P}
402 format gui slot 0 of {_P} with crafting table named "&b&lGame Settings" to close then run function GameSettings({_P})
403 format gui slot 1 of {_P} with empty map named "&b&lMap Settings" to close then run function MapSettings({_P})
404 format gui slot 2 of {_P} with redstone named "&b&lRules Settings" to close then run function RulesSettings({_P})
405 format gui slot 3 of {_P} with compass named "&b&lMatch Settings" to close then run function MatchSettings({_P})
406 loop 9 times:
407 format gui slot (loop-number + 8) of {_P} with white glass
408 format gui slot 18 of {_P} with player head named "&b&lTeamsize"
409 format gui slot 27 of {_P} with getConfigStatus("Teamsize", "string") to close then run function setConfigValue("Teamsize", {_P}, "string")
410 format gui slot 19 of {_P} with powered rail named "&b&lScenarios"
411 format gui slot 28 of {_P} with paper named "&b%activated scenarios%"
412
413#HORSES
414on spawn:
415 {Config::Horse} is not set
416 event-entity is a horse
417 cancel the event
418
419on "org.spigotmc.event.entity.EntityMountEvent":
420 {Config::Horse} is not set
421 event.getMount() is a horse
422 event.setCancelled(true)
423
424#ENDERPEARL DAMAGE
425on "org.bukkit.event.entity.EntityDamageByEntityEvent":
426 event.getEntity() is a player
427 event.getDamager() is ender pearl
428 {Config::Enderpearl damage} is not set
429 cancel the event
430
431#POTIONS
432on "org.bukkit.event.inventory.BrewEvent":
433 loop ...event.getContents():
434 if loop-value is glowstone dust:
435 {Config::Tier 2 Potions} is not set
436 event.setCancelled(true)
437 set {_M} to "Tier 2 Potions"
438 if loop-value is blaze powder:
439 {Config::Strength} is not set
440 event.setCancelled(true)
441 set {_M} to "Strength potions"
442 if loop-value is spider eye:
443 {Config::Poison} is not set
444 event.setCancelled(true)
445 set {_M} to "Poison potions"
446 event.isCancelled() is true
447 loop all players:
448 distance between the loop-player's location and event.getBlock()'s location < 10
449 send "{@P} &c%{_M}% are disabled /uhc" to loop-player
450
451on damage:
452 {Config::Poison} is not set
453 damage was caused by Poison
454 cancel the event
455 wait 1 tick
456 remove poison from victim
457
458command /uhc [<text="config">] [<text>] [<text>]:
459 aliases: /config
460 trigger:
461 set {_Host} to "%{Host}%" parsed as player
462 if arg-1 is "admin":
463 execute player command "/uhc config admin"
464 if arg-1 is "config":
465 if arg-2 is "game":
466 GameSettings(player)
467 else if arg-2 is "border":
468 MapSettings(player)
469 else if arg-2 is "rules":
470 RulesSettings(player)
471 else if arg-2 is "match":
472 MatchSettings(player)
473 else:
474 GameSettings(player)
475 else if arg-1 is "genworld":
476 if command sender has permission "staff.member":
477 if {UHC::WorldGen} is set:
478 message "{@P} &cThere is already a world generation running check ##minecraft-logs, if not restart the server"
479 else if world("UHC") is set:
480 message "{@P} &cWorld UHC already exists `/mv delete UHC` to delete it"
481 else:
482 message "{@P} &4Starting UHC world generation"
483 wait 2 ticks
484 execute command "/mv create UHC normal "
485 execute console command "/mvrule naturalRegeneration false UHC"
486 execute console command "/mvrule doDaylightCycle false UHC"
487 execute console command "/time set 0 UHC"
488 execute console command "/mv modify set pvp false UHC"
489 execute console command "/wb UHC set %{Config::Map Size}% %{Config::Map Size}% 0 0"
490 execute console command "/wb wshape UHC square"
491 BorderShrink({Config::Map Size})
492 if command sender is a player:
493 set {_world} to "UHC" parsed as world
494 teleport player to location at 0, 100, 0 in world {_world}
495 set player's gamemode to creative
496 wait 2 seconds
497 set {_loc1} to location(100, 256, 100, {_world})
498 set {_loc2} to location(-100, 5, -100, {_world})
499 loop blocks within {_loc1} and {_loc2}:
500 if loop-block is oak wood or birch wood or spruce wood or jungle wood or acacia wood or dark oak wood or leaves:
501 set loop-block to air
502 if loop-block is water or sand:
503 set loop-block to grass
504 else:
505 set {WorldGen} to true
506 wait 100 ticks
507 execute console command "/wb UHC fill 120 50"
508 execute console command "/wb fill confirm"
509 else if arg-1 is "gennether":
510 if sender has permission "staff.member":
511 if {UHC::WorldGen} is set:
512 message "{@P} &cThere is already a world generation running check ##minecraft-logs, if not restart the server"
513 else if world("UHC_nether") is set:
514 message "{@P} &cThe nether world already exists. Delete it with /mv delete UHC_nether"
515 else:
516 message "{@P} &bStarting UHC Nether generation"
517 wait 2 ticks
518 execute command "/mv create UHC_nether nether"
519 execute console command "/mvrule naturalRegeneration false UHC_nether"
520 execute console command "/mv modify set pvp false UHC_nether"
521 execute console command "/wb UHC_nether set %({Config::Map Size} / 3)% %({Config::Map Size} / 3)% 0 0"
522 execute console command "/wb wshape UHC_nether square"
523 BorderShrink(1500)
524 wait 40 ticks
525 make command sender execute command "/wb UHC_nether fill 70 50"
526 make command sender execute command "/wb fill confirm"
527 else if arg-1 is "genend":
528 if sender has permission "staff.member":
529 if {UHC::WorldGen} is set:
530 message "{@P} &cThere is already a world generation running check ##minecraft-logs, if not restart the server"
531 else if world("UHC_the_end") is set:
532 message "{@P} &cThe end world already exists. Delete it with /mv delete UHC_the_end"
533 else:
534 message "{@P} &bStarting UHC End generation"
535 wait 2 ticks
536 execute command "/mv create UHC_the_end end"
537 execute console command "/mvrule naturalRegeneration false UHC_the_end"
538 execute console command "/mv modify set pvp false UHC_the_end"
539 execute console command "/wb UHC_the_end set 200 200 0 0"
540 execute console command "/wb wshape UHC_the_end square"
541 wait 40 ticks
542 make command sender execute command "/wb UHC_the_end fill 70 50"
543 make command sender execute command "/wb fill confirm"
544 else if arg-1 is "spec":
545 if command sender is not CONSOLE:
546 player doesn't have permission "staff.member"
547 stop
548 if arg-2 is set:
549 set {_P} to arg-2 parsed as player
550 if {_P} is online:
551 if arg-3 is set:
552 if arg-3 is "On":
553 SpecMode({_P}, "On")
554 if arg-3 is "Off":
555 SpecMode({_P}, "Off")
556 else:
557 SpecMode({_P}, "Gay")
558 else:
559 message "{@P} Player isn't online???"
560 else:
561 SpecMode(player, "Gay")
562 else if arg-1 is "stop":
563 if {UHC::Status} is not set:
564 message "{@P} &cThere is no UHC currently running"
565 else:
566 delete {UHC::*}
567 delete {Scatter::Scattered}
568 loop all players:
569 loop-player's world is world("UHC")
570 execute console command "/mv tp %loop-player% Spawn"
571 execute console command "/timer cancel"
572 broadcast "{@P} &aUHC has been stopped and resetted"
573 else if arg-1 is "start":
574 if {UHC::Status} is true:
575 message "{@P} &cA UHC is currently running! You must do /uhc stop before starting another one"
576 stop
577 execute console command "/giveall steak 6"
578 execute console command "/giveall cake 1"
579 set {_world} to world("UHC")
580 {_world}.setStorm(false)
581 {_world}.setTime(0)
582 set {UHC::Status} to "starting"
583 set {UHC::Timerwaitstart} to 30
584 Broadcast(true, "&bStarting in 30 seconds!", "&fUHC Info will be opened")
585 while {UHC::Timerwaitstart} > 0:
586 loop all players:
587 Scoreboard(loop-player)
588 if {UHC::Timerwaitstart} is 28:
589 loop all players:
590 make loop-player execute command "/uhc"
591 else if {UHC::Timerwaitstart} is 3 or 2 or 1:
592 broadcast "{@P} &fStarting in %{UHC::Timerwaitstart}%"
593 execute console command "/playsoundall random.click"
594 wait 1 second
595 remove 1 from {UHC::Timerwaitstart}
596 delete {UHC::Timerwaitstart}
597 delete {UHC::Scatter}
598 set {UHC::Status} to true
599 set diameter of world("UHC") to ({Config::Map Size} * 2) over 0 seconds
600 StartGameTime("Gay")
601 loop {Scoreboard::*}:
602 set {_p} to loop-index parsed as player
603 set {_scoreboard} to {_p}.getScoreboard()
604 loop 15 times:
605 removeSlot({_scoreboard}, loop-number)
606 loop {UHC::ScatterEntities::*}:
607 delete random entity out of loop-value
608 execute console command "/butcher -a"
609 set {UHC::Butcher} to true
610 delete {Teams.Management}
611 EntropyStart("Gay")
612 LootCratesStart("Gay")
613 InfiniteEnchanterStart("Gay")
614 GoneFishinStart("Gay")
615 ChickenStart("Gay")
616 DoubleDatesStart("Gay")
617 SlavemarketDiamonds("Gay")
618 SkyHighItemStart("Gay")
619 EnderDragonRushStart("gay")
620 SuperHeroesStart("Gay")
621 GigaDrillStart("Gay")
622 BirdsStart("Gay")
623 wait 30 seconds
624 delete {UHC::Butcher}
625 broadcast "{@P} &fMobs will now start spawning"
626 else:
627 make player execute command "/uhc config %arg-1%"
628
629on spawn:
630 if {UHC::Butcher} is true:
631 cancel the event
632
633on join:
634 {UHC::Status} is true
635 if player's vehicle.hasMetadata("FreezeEntity") is true:
636 delete player's vehicle
637
638function BorderScoreboard(S: object = 1):
639 while {UHC::WorldGen} is set:
640 loop all players:
641 loop-player has permission "staff.member"
642 Scoreboard(loop-player)
643 wait 10 ticks
644
645on "com.wimbli.WorldBorder.Events.WorldBorderFillStartEvent":
646 set {UHC::WorldGen} to event.getFillTask()
647 set {UHC::WorldGen::time} to now
648 BorderScoreboard()
649 while {UHC::WorldGen} is set:
650 wait 1 minute
651
652on "com.wimbli.WorldBorder.Events.WorldBorderFillFinishedEvent":
653 delete {UHC::WorldGen}
654 loop all players:
655 loop-player has permission "staff.member"
656 Scoreboard(loop-player)
657 System.gc()
658
659on join:
660 {UHC::Status} is not set
661 player has permission "staff.member"
662 {WorldGen} is true
663 set {_world} to "UHC" parsed as world
664 teleport player to location at 0, 100, 0 in world {_world}
665 set player's gamemode to creative
666 wait 2 seconds
667 set {_loc1} to location(100, 256, 100, {_world})
668 set {_loc2} to location(-100, 5, -100, {_world})
669 loop blocks within {_loc1} and {_loc2}:
670 if loop-block is oak wood or birch wood or spruce wood or jungle wood or acacia wood or dark oak wood or leaves:
671 set loop-block to air
672 if loop-block is water or sand:
673 set loop-block to grass
674 System.gc()
675 delete {WorldGen}
676 set player's gamemode to survival
677 execute console command "/mv tp %player% spawn"
678
679on damage of player:
680 victim's world is "Spawn"
681 damage cause is void
682 cancel the event
683 execute console command "/mv tp %victim% Spawn"
684
685on command "/plugins":
686 if full command is "pl yes please":
687 stop
688 else if command sender doesn't have permission "staff.member":
689 message "{@P} &bEverything is coded in skript!"
690 cancel the event
691
692on command "/pl":
693 if full command is "pl yes please":
694 stop
695 else if command sender doesn't have permission "staff.member":
696 message "{@P} &bEverything is coded in skript!"
697 cancel the event
698
699command /fullbright:
700 trigger:
701 if player doesn't have night vision:
702 apply potion of night vision of tier 1 to player for 1 day
703 message "{@P} &bYou have been given the power of fullbright!"
704 else:
705 remove night vision from player
706 message "{@P} &cYour fullbright has been removed."
707
708on command:
709 {UHC::Status} is true
710 if command is "selfmole" or "top" or "giveall" or "tp" or "teleport" or "invsee" or "gamemode" or "gm" or "fly" or "give" or "heal":
711 player has permission "staff.member"
712 {UHC::Spectators::%player%} is not set
713 message "{@P} &bThis command requires spec mode"
714 StaffMessage("%player% just tried %command% while playing", "Normal")
715 cancel the event
716 else:
717 if command is "selfmole" or "top" or "giveall" or "tp" or "teleport" or "invsee" or "gamemode" or "gm" or "fly" or "give" or "heal":
718 player has permission "command.bypass"
719 message "{@P}You can only do this due to you bypassing it!"
720
721function SpectatorTeleport(P: player, T: player):
722 teleport {_P} to {_T}
723 send "{@P} &bYou teleported to %{_T}%" to {_P}
724
725function SpecPage1(P: player):
726 open virtual chest inventory with size 6 named "&6Player Teleporter - Page 1" to {_P}
727 loop {UHC::AlivePlayers::*}:
728 add ("%loop-index%" parsed as player) to {_Players::*}
729 set {_N} to 0
730 loop {_Players::*}:
731 {_N} < 45
732 remove loop-value from {_Players2::*}
733 if loop-value is online:
734 set {_name} to "&b%loop-value% &7[&aOnline&7]"
735 else:
736 set {_name} to "&b%loop-value% &7[&cOffline&7]"
737 format a gui slot {_N} of {_P} with loop-value's skull named "%{_name}%" to close then run function SpectatorTeleport({_P}, loop-value)
738 add 1 to {_N}
739 format a gui slot 53 of {_P} with paper named "&bNext page" to run function SpecPage2({_P})
740
741function SpecPage2(P: player):
742 open virtual chest inventory with size 6 named "&6Player Teleporter - Page 2" to {_P}
743 loop {UHC::AlivePlayers::*}:
744 add ("%loop-index%" parsed as player) to {_Players::*}
745 set {_N} to 0
746 loop {_Players::*}:
747 add 1 to {_N}
748 {_N} > 44
749 remove loop-value from {_Players2::*}
750 if loop-value is online:
751 set {_name} to "&b%loop-value% &7[&aOnline&7]"
752 else:
753 set {_name} to "&b%loop-value% &7[&cOffline&7]"
754 format a gui slot ({_N1}-0) of {_P} with loop-value's skull named "%{_name}%" to close then run function SpectatorTeleport({_P}, loop-value)
755 add 1 to {_N1}
756 format a gui slot 45 of {_P} with paper named "&bLast page" to run function SpecPage1({_P})
757
758on rightclick on chest:
759 {UHC::Spectators::%player%} is true
760 cancel the event
761 if block north of event-block is chest:
762 set {_chest2} to block north of event-block
763 if block east of event-block is chest:
764 set {_chest2} to block east of event-block
765 if block west of event-block is chest:
766 set {_chest2} to block west of event-block
767 if block south of event-block is chest:
768 set {_chest2} to block south of event-block
769 if {_chest2} is not set:
770 create a gui with virtual chest with 3 rows named "Chest":
771 set {_N} to 0
772 loop 27 times:
773 format gui slot {_N} with slot {_N} of event-block's inventory
774 add 1 to {_N}
775 open last gui to player
776 else:
777 create a gui with virtual chest with 6 rows named "Chest":
778 set {_N} to 0
779 loop 27 times:
780 format gui slot {_N} with slot {_N} of event-block's inventory
781 add 1 to {_N}
782 loop 27 times:
783 format gui slot {_N} with slot {_N} of {_chest2}'s inventory
784 add 1 to {_N}
785 open last gui to player
786
787on rightclick on trapped chest:
788 {UHC::Spectators::%player%} is true
789 cancel the event
790 if block north of event-block is trapped chest:
791 set {_chest2} to block north of event-block
792 if block east of event-block is trapped chest:
793 set {_chest2} to block east of event-block
794 if block west of event-block is trapped chest:
795 set {_chest2} to block west of event-block
796 if block south of event-block is trapped chest:
797 set {_chest2} to block south of event-block
798 if {_chest2} is not set:
799 create a gui with virtual chest with 3 rows named "Trapped chest":
800 set {_N} to 0
801 loop 27 times:
802 format gui slot {_N} with slot {_N} of event-block's inventory
803 add 1 to {_N}
804 open last gui to player
805 else:
806 create a gui with virtual chest with 6 rows named "Trapped chest":
807 set {_N} to 0
808 loop 27 times:
809 format gui slot {_N} with slot {_N} of event-block's inventory
810 add 1 to {_N}
811 loop 27 times:
812 format gui slot {_N} with slot {_N} of {_chest2}'s inventory
813 add 1 to {_N}
814 open last gui to player
815
816on rightclick with light green dye or gray dye:
817 name of player's tool contains "Vanish"
818 {UHC::Spectators::%player%} is true
819 if player has permission "staff.member":
820 if {Vanish::%player%} is true:
821 Vanish(player, "Off")
822 else:
823 Vanish(player, "On")
824 else:
825 message "{@P} &cYou must be a staff member to use this!"
826
827on rightclick with ender pearl:
828 player's tool is an ender pearl named "&6&oTeleport"
829 {UHC::Spectators::%player%} is true
830 cancel the event
831 if size of {UHC::AlivePlayers::*} < 45:
832 open virtual chest inventory with size 6 named "&6Player Teleporter" to player
833 set {_N} to 0
834 loop {UHC::AlivePlayers::*}:
835 set {_P} to loop-index parsed as offline player
836 if {_P} is online:
837 set {_name} to "&b%{_P}% &7[&aOnline&7]"
838 else:
839 set {_name} to "&b%{_P}% &7[&cOffline&7]"
840 format a gui slot {_N} of player with {_P}'s skull named "%{_name}%" to close then run function SpectatorTeleport(player, {_P})
841 add 1 to {_N}
842 else:
843 SpecPage1(player)
844
845on rightclick with an iron sword:
846 player's tool is an iron sword named "&6&oTeleport to 0,0"
847 {UHC::Spectators::%player%} is true
848 cancel the event
849 set {_world} to "UHC" parsed as world
850 teleport player to location at 0, 100, 0 in world {_world}
851
852on rightclick with end portal frame:
853 player's tool is a end portal frame named "&6&oRandom Teleport"
854 {UHC::Spectators::%player%} is true
855 cancel the event
856 set {_N1} to a random integer between 1 and size of {UHC::AlivePlayers::*}
857 set {_N2} to 0
858 loop {UHC::AlivePlayers::*}:
859 add 1 to {_N2}
860 {_N1} is {_N2}
861 set {_P} to "%loop-index%" parsed as player
862 SpectatorTeleport(player, {_P})
863
864on rightclick on player:
865 player's tool is book named "&6&oView Inventory"
866 {UHC::Spectators::%player%} is true
867 if player's target is a player:
868 make player execute command "/inv %player's target%"
869
870on rightclick with compass:
871 player's tool is a compass named "&6&oPassthrough blocks"
872 {UHC::Spectators::%player%} is true
873 cancel the event
874 if player has permission "staff.member":
875 make player execute command "/thru"
876 else:
877 message "{@P} &cYou must be a staff member to use this!"
878
879command /inv <player> [<text>]:
880 trigger:
881 if {UHC::Spectators::%player%} is true:
882 if arg-2 is "edit":
883 open arg-1's inventory to player
884 else:
885 create a gui with virtual chest with 6 rows named "&3%arg-1%'s inventory":
886 set {_N1} to 0
887 set {_N2} to 9
888 loop 26 times:
889 format gui slot {_N1} with slot {_N2} of arg-1's inventory
890 add 1 to {_N1} and {_N2}
891 set {_N1} to 27
892 set {_N2} to 0
893 loop 8 times:
894 format gui slot {_N1} with slot {_N2} of arg-1's inventory
895 add 1 to {_N1} and {_N2}
896 format gui slot {_N1} with slot {_N2} of arg-1's inventory
897 format gui slot 45 with arg-1's helmet
898 format gui slot 46 with arg-1's chestplate
899 format gui slot 47 with arg-1's leggings
900 format gui slot 48 with arg-1's boots
901 if {Scenarios::Superheroes} is true:
902 if {UHC::Superheroes::%arg-1%} is 1:
903 format gui slot 50 with fire charge named "&4Superpower (Superheroes)" with lore "&f> Strength"
904 if {UHC::Superheroes::%arg-1%} is 2:
905 format gui slot 50 with fire charge named "&4Superpower (Superheroes)" with lore "&f> 6 Extra Hearts"
906 if {UHC::Superheroes::%arg-1%} is 3:
907 format gui slot 50 with fire charge named "&4Superpower (Superheroes)" with lore "&f> Jump Boost"
908 if {UHC::Superheroes::%arg-1%} is 4:
909 format gui slot 50 with fire charge named "&4Superpower (Superheroes)" with lore "&f> Speed"
910 if {UHC::Superheroes::%arg-1%} is 5:
911 format gui slot 50 with fire charge named "&4Superpower (Superheroes)" with lore "&f> Resistance"
912 if {UHC::Superheroes::%arg-1%} is 6:
913 format gui slot 50 with fire charge named "&4Superpower (Superheroes)" with lore "&f> Invinsibility"
914 format gui slot 51 with apple named "&cHealth %arg-1's health% / %arg-1's max health%"
915 format gui slot 52 with potion:16453 named "&6Active potions effects" with lore "%all of the active potion effects of arg-1%"
916 if {UHC::AlivePlayers::%arg-1%} is true:
917 format gui slot 53 with slimeball named "&aAlive"
918 else if {UHC::Spectators::%arg-1%} is true:
919 format gui slot 53 with yellow dye named "&eSpectator"
920 else:
921 format gui slot 53 with magma cream named "&cDead"
922 open last gui to player
923 else:
924 message "{@P} This command is for spectators only!"
925
926command /invsee [<text>]:
927 trigger:
928 if arg-1 is set:
929 make player execute command "/inv %arg-1%"
930 else:
931 make player execute command "/inv"
932
933on skript load:
934 delete {UHC::*}
935
936on join:
937 wait 1 tick
938 if {UHC::Status} and {Tournaments::Status} is not set:
939 {UHC::Spectators::%player%} is not set
940 execute console command "/mv tp %player% spawn"
941 ClearAllEffects(player)
942 else:
943 if player has permission "staff.spec":
944 {UHC::AlivePlayers::%player%} is not set
945 {UHC::Spectators::%player%} is not set
946 {Tournaments::AlivePlayers::%player%} is not set
947 SpecMode(player, "On")
948 else if {UHC::Spectators::%player%} is true:
949 set player's gamemode to creative
950
951on weather change to rain:
952 if event-world is "Spawn" or "Arena":
953 set weather to sunny