Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /spawner [<text>] [<player>]:
- trigger:
- if sender is the console:
- if arg-1 is not set:
- send "&cUsage: /spawner <spawner-type> [player]"
- else if arg-2 is not set:
- set {_item} to mob spawner named "&c%arg-1% Spawner"
- add {_item} to player's inventory
- send "&fYou've been given a spawner: &c%arg-1% &cSpawner"
- else:
- set {_item} to mob spawner named "&c%arg-1% Spawner"
- add {_item} to arg-2's inventory
- send "&fSuccessfully gave %arg-1% a spawner: &c%arg-1% &cSpawner" to sender
- send "&fYou've been given a spawner: &c%arg-1% &cSpawner" to arg-2
- else if player has permission "Staff.Spawner":
- if arg-1 is not set:
- send "&cUsage: /spawner <spawner-type> [player]"
- else if arg-2 is not set:
- set {_item} to mob spawner named "&c%arg-1% Spawner"
- add {_item} to player's inventory
- send "&fYou've been given a spawner: &c%arg-1% &cSpawner"
- else:
- set {_item} to mob spawner named "&c%arg-1% Spawner"
- add {_item} to arg-2's inventory
- send "&fSuccessfully gave %arg-2% a spawnwer: &c%arg-1% &cSpawner" to sender
- send "&fYou've been given a spawner: &c%arg-1% &cSpawner" to arg-2
- on place:
- if player's tool is mob spawner:
- set {_name} to player's tool's name
- set {_name} to uncoloured {_name}
- set {_type::*} to split {_name} at " "
- if {_type::3} is set:
- set {_name} to "%{_type::1}%_%{_type::2}%"
- set {_namee} to "%{_type::1}% %{_type::2}%"
- else:
- set {_name} to {_type::1}
- set {_namee} to {_type::1}
- set entity type of spawner at event-block to {_name}
- send "&fYou placed a spawner: &c%{_namee}% &cSpawner"
- on break:
- if event-block is mob spawner:
- if player's tool is pickaxe:
- if player's tool is enchanted with silk touch:
- set dropped exp orbs to 0
- set {_name} to event-block's spawner entity type
- set {_type::*} to split {_name} at "_"
- set {_String} to the 1 first characters of {_name}
- set {_String} to {_String} in upper case
- set {_l} to the length of {_type::1}
- set {_w} to the ({_l} - 1) last characters of {_type::1}
- set {_result} to "%{_String}%%{_w}%"
- replace all "_" in {_name} with " "
- if {_type::2} is set:
- set {_String1} to the 1 first characters of {_type::2}
- set {_String1} to {_String1} in upper case
- set {_l1} to length of {_type::2}
- set {_w1} to the ({_l1} - 1) last characters of {_type::2}
- set {_result1} to "%{_String1}%%{_w1}%"
- if {_result1} is not set:
- set {_item} to 1 mob spawner named "&c%{_result}% Spawner"
- else:
- set {_item} to 1 mob spawner named "&c%{_result}% %{_result1}% Spawner"
- drop {_item} at event-location
- on spawn:
- loop entities in radius 7 around event-entity:
- if loop-entity is not a player:
- if loop-entity is not an item:
- if "%loop-value%" = "%event-entity%":
- if loop-value is alive:
- cancel event
- if {Stacked.%loop-entity's uuid%} is not set:
- add 1 to {Stacked.%loop-entity's uuid%}
- add 1 to {Stacked.%loop-entity's uuid%}
- add "{CustomName:""{\""text\"":\""&l&cStack (%{Stacked.%loop-entity's uuid%}%x)\""}"",CustomNameVisible:1}" to nbt of loop-entity
- on death:
- if victim is not a player:
- if {Stacked.%victim's uuid%} is set:
- if {Stacked.%victim's uuid%} > 1:
- set {_c} to {Stacked.%victim's uuid%}
- set {_v.%victim%} to type of victim
- spawn {_v.%victim%} at location of victim
- set {Stacked.%uuid of last spawned entity%} to ({_c} - 1)
- add "{CustomName:""{\""text\"":\""&l&cStack (%{Stacked.%uuid of last spawned entity%}%x)\""}"",CustomNameVisible:1}" to nbt of last spawned entity
- delete {Stacked.%victim's uuid%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement