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% Spawner"
- 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% Spawner" to sender
- send "&fYou've been given a spawner: &c%arg-1% Spawner" 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% Spawner"
- 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% Spawner" to sender
- send "&fYou've been given a spawner: &c%arg-1% Spawner" 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}% Spawner"
- 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 5 around event-entity:
- if loop-entity is not a player:
- if loop-entity is not an item:
- if "%loop-value%" = "%event-entity%":
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement