Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- variables:
- {uhc.gamestate} = "waiting"
- on load:
- register new shaped recipe for player head named "&6Golden Head" using gold ingot, gold ingot, gold ingot, gold ingot, player head, gold ingot, gold ingot, gold ingot, gold ingot
- set {uhc.gamestate} to "waiting"
- makeCommandBlockCommand("mv modify set gamemode 2 world", 0, 0, 0)
- makeCommandBlockCommand("mv delete uhc", 0, 1, 0)
- wait 1 tick
- makeCommandBlockCommand("mvconfirm", 0, 1, 0)
- makeCommandBlockCommand("mvc uhc normal", 0, 2, 0)
- makeCommandBlockCommand("mv modify set difficulty hard uhc", 0, 3, 0)
- makeCommandBlockCommand("mvrule naturalRegeneration false uhc", 0, 4, 0)
- makeCommandBlockCommand("mvrule keepInventory false uhc", 0, 5, 0)
- makeCommandBlockCommand("mvrule commandBlockOutput false uhc", 0, 6, 0)
- makeCommandBlockCommand("mvrule sendCommandFeedback false uhc", 0, 7, 0)
- makeCommandBlockCommand("mvrule reducedDebugInfo false uhc", 0, 8, 0)
- makeCommandBlockCommand("wb uhc set 200 0 0", 0, 9, 0)
- #makeCommandBlockCommand("wb uhc fill confirm", 0, 10, 0)
- function makeCommandBlockCommand(cmd: string, x: integer, y: integer, z: integer):
- execute console command "setblock %{_x}% %{_y}% %{_z}% command_block 0 replace"
- execute console command "blockdata %{_x}% %{_y}% %{_z}% {auto:0b}"
- wait 1 tick
- execute console command "blockdata %{_x}% %{_y}% %{_z}% {auto:1b,Command:""%{_cmd}%""}"
- on inventory click:
- holder of clicked inventory is player
- clicked slot is 0
- clicked inventory is player's current inventory
- id of clicked item is 397
- data of clicked item is 3
- name of clicked item is "&6Golden Head"
- if name of slot 5 of player's current inventory is "&6Golden Head":
- cancel event
- else:
- if clicked type is left mouse button with shift or right mouse button with shift:
- give player player head with nbt "{display:{Name:""&6Golden Head""},SkullOwner:{Id:""e19442f7-4300-4004-b3cf-7d5ec3c72d0c"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2JiNjEyZWI0OTVlZGUyYzVjYTUxNzhkMmQxZWNmMWNhNWEyNTVkMjVkZmMzYzI1NGJjNDdmNjg0ODc5MWQ4In19fQ==""}]}}}"
- else:
- set cursor slot of player to player head with nbt "{display:{Name:""&6Golden Head""},SkullOwner:{Id:""e19442f7-4300-4004-b3cf-7d5ec3c72d0c"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2JiNjEyZWI0OTVlZGUyYzVjYTUxNzhkMmQxZWNmMWNhNWEyNTVkMjVkZmMzYzI1NGJjNDdmNjg0ODc5MWQ4In19fQ==""}]}}}"
- loop 9 times:
- set {_item} to slot loop-number of clicked inventory
- remove 1 from item amount of {_item}
- set slot loop-number of clicked inventory to {_item}
- delete {_item}
- command /startuhc:
- permission: uhc.admin
- trigger:
- startUHC()
- function getHighestBlock(loc: location) :: block:
- loop 256 times:
- set {_loopheight} to loop-number - 1
- block at location x-coordinate of {_loc}, {_loopheight}, z-coordinate of {_loc} in world "%{_loc}'s world%" is not air
- set {_block} to block at location x-coordinate of {_loc}, {_loopheight}, z-coordinate of {_loc} in world "%{_loc}'s world%"
- set {_blocks::%{_loopheight}%} to block at location x-coordinate of {_loc}, {_loopheight}, z-coordinate of {_loc} in world "%{_loc}'s world%"
- set {_highheight} to -1
- loop {_blocks::*}:
- loop-index parsed as integer > {_highheight}
- set {_highheight} to loop-index parsed as integer
- set {_returnvalue} to loop-value
- return {_returnvalue}
- function startUHC():
- size of all players >= 2
- {uhc.gamestate} is "waiting"
- set {uhc.gamestate} to "gaming"
- broadcast "&8[&6&lUHC&8] &7試合を開始します"
- loop all players:
- set loop-player's gamemode to survival
- milk loop-player
- send "&a[&bTIP&a] &7コンパスを手に持つと最寄りのプレイヤーの場所がわかります" to loop-player
- execute console command "execute %loop-player% ~ ~ ~ effect @s 12 30 0 true"
- heal loop-player
- set loop-player' food to 10
- clear loop-player's inventory
- give stone sword of sharpness 1 and unbreaking 3 to loop-player
- give stone pickaxe of efficiency 3 and unbreaking 3 to loop-player
- give stone axe of efficiency 3 and unbreaking 3 to loop-player
- give stone shovel of efficiency 3 and unbreaking 3 to loop-player
- set {_loc} to location random integer between -175 and 175 meter east location random integer between -175 and 175 meter south location at 0, 0, 0 in world "uhc"
- set {_block} to getHighestBlock({_loc})
- teleport loop-player to location 1 meter above location of {_block}
- on packet event play_server_world_particles:
- "Particle" penum 0 of event-packet is "DAMAGE_INDICATOR" or "SWEEP_ATTACK"
- cancel event
- on packet event play_server_named_sound_effect:
- "SoundEffects" pinfo 0 of event-packet is ENTITY_PLAYER_ATTACK_CRIT or ENTITY_PLAYER_ATTACK_KNOCKBACK or ENTITY_PLAYER_ATTACK_NODAMAGE or ENTITY_PLAYER_ATTACK_STRONG or ENTITY_PLAYER_ATTACK_SWEEP or ENTITY_PLAYER_ATTACK_WEAK
- cancel event
- on death of player:
- set {_skull} to skull from victim's skin with owner "%victim%"
- set name of {_skull} to "&c&l%victim%'s Head"
- add {_skull} to drops
- strike lightning effect at victim
- set {_loc} to location of victim
- set metadata value "DeathLocation" of victim to {_loc}
- if attacker is set:
- set {_weap} to check [name of attacker's tool is set] ? " using %name of attacker's tool%" : ""
- set {_cause} to check [projectile is an arrow] ? "shot" : "killed"
- if name of attacker is set:
- set death message to "&c%victim% was %{_cause}% by %name of attacker%%{_weap}%"
- else:
- set death message to "&c%victim% was %{_cause}% by %attacker%%{_weap}%"
- else:
- set death message to "&c%victim% died"
- wait 5 tick
- force victim to respawn
- wait 1 tick
- set player's gamemode to spectator
- set {_loc} to metadata value "DeathLocation" of player
- teleport player to {_loc}
- delete metadata value "DeathLocation" of player
- on join:
- delete metadata value "DeathLocation" of player
- if {uhc.gamestate} is "gaming":
- wait 3 tick
- teleport player to highest block at location at 0, 0, 0 in world "uhc"
- wait 3 tick
- set player's gamemode to spectator
- else:
- teleport player to location at 0, 64, 0 in world "world"
- clear player's inventory
- heal player
- set player's food to 10
- wait 2 tick
- set player's gamemode to adventure
- on break:
- player's tool is shears
- player's gamemode is survival or adventure
- id of event-block is 18
- chance of 10%:
- set event-block to air
- drop apple at event-location
- on quit:
- delete metadata value "DeathLocation" of player
- {uhc.gamestate} is "gaming"
- player's gamemode is not spectator
- set quit message to "&c%player% died"
- strike lightning effect at player
- loop 41 times:
- set {_slot} to loop-number - 1
- drop slot {_slot} of player's inventory at player
- set {_skull} to player head
- set owner of skull {_skull} to name of player
- drop {_skull} at player
- on click:
- player's gamemode is survival or adventure
- id of player's tool is 397
- data of player's tool is 3
- cancel event
- if name of player's tool is "&6Golden Head":
- execute console command "execute %player% ~ ~ ~ effect @s 10 15 2"
- execute console command "execute %player% ~ ~ ~ effect @s 22 180 0"
- execute console command "execute %player% ~ ~ ~ effect @s 1 5 1"
- else:
- execute console command "execute %player% ~ ~ ~ effect @s 10 10 2"
- execute console command "execute %player% ~ ~ ~ effect @s 1 5 1"
- set {_item} to player's tool
- set item amount of {_item} to 1
- remove {_item} from player's tool
- play sound "ENTITY_GENERIC_EAT" to player with volume 1 and pitch 5
- every tick:
- {uhc.gamestate} is "gaming"
- loop all players:
- loop all players:
- loop-player-2's gamemode is not spectator
- loop-player-2 is not loop-player-1
- if {_short} is not set:
- set {_short} to distance between loop-player-1 and loop-player-2
- set {_target} to loop-player-2
- else:
- distance between loop-player-1 and loop-player-2 < {_short}
- set {_short} to distance between loop-player-1 and loop-player-2
- set {_target} to loop-player-2
- {_target} is set
- {_short} is set
- if loop-player's tool is compass:
- send action bar from "&6&lPlayer: &f%{_target}% &6&lDistance: &f%{_short}%" to loop-player
- set compass target of loop-player to {_target}
- delete {_target}
- delete {_short}
- every tick:
- {uhc.gamestate} is "gaming"
- set {_players::*} to all players
- loop {_players::*}:
- check [loop-value's gamemode is spectator] or check [loop-value is dead]
- remove loop-value from {_players::*}
- size of {_players::*} <= 1
- set {uhc.gamestate} to "waiting"
- loop all players:
- clear loop-player's inventory
- milk loop-player
- heal loop-player
- set loop-player's food to 10
- delete metadata value "DeathLocation" of loop-player
- if {_players::*} do not contain loop-player:
- send loop-player title "&c&lGAME OVER" for 3 second
- else:
- send loop-player title "&6&lVICTORY" for 3 second
- teleport loop-player to location at 0, 64, 0 in world "world"
- set loop-player's gamemode to adventure
- broadcast "&8[&6&lUHC&8] &7ワールドをリセットしています"
- broadcast "&8[&6&lUHC&8] &7ラグに注意してください"
- async:
- set {_packet} to new play_server_keep_alive packet
- loop 12 times:
- loop all players:
- send loop-player packet {_packet}
- wait 10 second
- wait 1 tick
- makeCommandBlockCommand("mv modify set gamemode 2 world", 0, 0, 0)
- makeCommandBlockCommand("mv delete uhc", 0, 1, 0)
- wait 1 tick
- makeCommandBlockCommand("mvconfirm", 0, 1, 0)
- makeCommandBlockCommand("mvc uhc normal", 0, 2, 0)
- makeCommandBlockCommand("mv modify set difficulty hard uhc", 0, 3, 0)
- makeCommandBlockCommand("mvrule naturalRegeneration false uhc", 0, 4, 0)
- makeCommandBlockCommand("mvrule keepInventory false uhc", 0, 5, 0)
- makeCommandBlockCommand("mvrule commandBlockOutput false uhc", 0, 6, 0)
- makeCommandBlockCommand("mvrule sendCommandFeedback false uhc", 0, 7, 0)
- makeCommandBlockCommand("mvrule reducedDebugInfo false uhc", 0, 8, 0)
- makeCommandBlockCommand("wb uhc set 200 0 0", 0, 9, 0)
- #makeCommandBlockCommand("wb uhc fill confirm", 0, 10, 0)
- wait 3 tick
- broadcast "&8[&6&lUHC&8] &7ワールドのリセットが完了しました"
Advertisement
Add Comment
Please, Sign In to add comment