Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Tower Defence game in minecraft!
- #
- variables:
- {castlehealth} = 20
- {score} = 0
- # This is where the commands for tower defence will be kept!
- # This command sets the end for the zombies to go to!
- command /tdend:
- trigger:
- set {end} to location of player
- message "&aYou have set the end zone for the zombies!"
- # This command sets the spawn for the zombies!
- command /tdspawn:
- trigger:
- set {spawn} to location of player
- message "&aYou have set the spawn for the zombies!"
- # This command is a test command for spawning zombies!
- command /zspawn:
- trigger:
- if {spawn} is not set:
- message "&4You have not set a spawn location &a(/tdspawn)"
- set {zombie} to a zombie
- spawn a zombie at {spawn}
- # This tests for if a zombie has reached the end! (test command)
- command /tdendtest:
- trigger:
- if {died} is set:
- broadcast "&4You have lost a life!"
- kill {died}
- # -------------------------------------------------------------------------------
- # This is where the towers are!
- on right click with stick:
- clicked block is obsidian:
- set {mobguard.%uuid of player%} to location of clicked block
- set block above clicked block to wool
- every 3 seconds:
- loop all players:
- loop all entities in radius 10 around {mobguard.%uuid of loop-player-1%}:
- loop-entity-2 is zombie:
- broadcast "Zombie detected!"
- else:
- broadcast "Mob detected, but no zombie."
- on death of a zombie:
- set {_player} to player
- add 1 to {score}
- broadcast "&aYou have &3%{score}% &apoints"
- on spawn of zombie:
- set name of spawned zombie to "Zombie"
Advertisement
Add Comment
Please, Sign In to add comment