Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- prefix: &f[&2Tycoon&f] &8>>
- version: 1.0
- command /tycoon [<text>] [<text>]:
- trigger:
- if player has permission "Tycoon.*":
- if arg 1 is "help":
- send "&f--------------[&2Tycoon&f]--------------"
- send "&a/Tycoon help &8>> &2Krijg de help pagina"
- send "&a/Tycoon shop create &8>> &2Maak een shop"
- send "&a/Tycoon shop &8>> &2Ga naar het shop gui"
- send "&a/Tycoon shop remove &8>> &2Verwijder de shop"
- send "&f--------------[&2Tycoon&f]--------------"
- if arg 1 is "shop":
- if arg 2 is "create":
- send "{@prefix} &2Succesvol een shop item gegeven."
- give player a book named "&6Create Shop" with lore "&5Klik om een shop te maken - Tycoon"
- #send "{@prefix} &aSuccesvol de shop gemaakt!"
- #spawn Llama at player
- #set {_Llama} to last spawned Llama
- #set name of last spawned Llama to "&6Tycoon shop"
- #add "{Age:1,NoAI:1,Silent:1b,Invulnerable:1}" to nbt tag of {_Llama}
- else if arg 2 is set:
- send "{@prefix} &4Dit command is niet goed uitgevoerd, doe &c/tycoon stop create&4."
- else:
- send "{@prefix} &4Doe &c/tycoon help &4voor meer info."
- else if arg 1 is "help":
- send "&f--------------[&2Tycoon&f]--------------"
- send "&a/Tycoon help &8>> &2Krijg de help pagina"
- send "&a/Tycoon shop &8>> &2Ga naar het shop gui"
- send "&f--------------[&2Tycoon&f]--------------"
- else if arg 1 is "shop":
- send "{@prefix} &2Shop geoopent."
- on rightclick on a villager:
- wait 1 tick
- set {_world} to world of clicked entity
- set {_locX} to x-coordinate of clicked entity
- set {_locY} to y-coordinate of clicked entity
- set {_locZ} to z-coordinate of clicked entity
- open chest with 1 rows named "&6Tycoon Shop" to player
- make gui slot 0 of player with redstone dust named "&6Machine Shop" to close then run function openShop(player, "machines")
- make gui slot 8 of player with barrier named "&4Delete Shop" to run function removeShop(player, clicked entity, "%{_locX}%", "%{_locY}%", "%{_locZ}%", "%{_world}%")
- on rightclick:
- if player is holding a book named "&6Create Shop" with lore "&5Klik om een shop te maken - Tycoon":
- set {_locX} to x-coordinate of targeted block
- set {_locY} to y-coordinate of targeted block+0.5
- set {_locZ} to z-coordinate of targeted block
- set {_block} to location of targeted block
- loop blocks in radius 5 around player:
- if location of loop-block is {_block}:
- send "{@prefix} &2Succesvol de shop gemaakt!"
- set {_gm} to gamemode of player
- if gamemode of player is not creative:
- remove 1 of tool from tool
- spawn villager at location {_locX}, {_locY}, {_locZ}
- set {_villager} to last spawned villager
- set name of last spawned villager to "&6Tycoon shop"
- add "{Profession:5,Age:1,NoAI:1,Silent:1b,Invulnerable:1}" to nbt tag of {_villager}
- add "%world of player% - %{_locX}%, %{_locY}%, %{_locZ}%" to {Tycoon::shopLocations::*}
- on death of villager:
- if attacker is a player:
- if name of villager is "&6Tycoon shop":
- set {_locX} to x-coordinate of victim
- set {_locY} to y-coordinate of victim
- set {_locZ} to z-coordinate of victim
- if {Tycoon::shopLocations::*} doesn't contain "%world of victim% - %{_locX}%, %{_locY}%, %{_locZ}%":
- stop
- else:
- remove "%world of victim% - %{_locX}%, %{_locY}%, %{_locZ}%" from {Tycoon::shopLocations::*}
- send "{@prefix} &2Succesvol de shop verwijderd!" to attacker
- play "block_wood_hit" to attacker at volume 10
- set {_item} to false
- loop items in attacker's inventory:
- if loop-item is a book named "&6Create Shop" with lore "&5Klik om een shop te maken - Tycoon":
- set {_item} to true
- stop loop
- else:
- set {_item} to false
- if {_item} is false:
- give attacker a book named "&6Create Shop" with lore "&5Klik om een shop te maken - Tycoon"
- every 1 tick:
- loop all players:
- if loop-player is holding a paper named "&6Dirt machine" with lore "&5Tycoon Machine":
- set {_block} to location of targeted block of loop-player
- loop blocks in radius 5 around loop-player:
- if location of loop-block is {_block}:
- set {_dir} to the facing of loop-player
- set {_world} to world of loop-player
- set {_x} to x-coordinate of targeted block of loop-player
- set {_y} to y-coordinate of targeted block of loop-player + 1
- set {_z} to z-coordinate of targeted block of loop-player
- set {_y2} to y-coordinate of targeted block of loop-player
- set {tycoon::scematicDrawn::%loop-player%} to true
- if {tycoon::targetedBlock::%loop-player%} is "%{_x}%, %{_y2}%, %{_z}%, %{_world}%":
- stop loop
- if {tycoon::targetedBlock::%loop-player%} is "%{_x}%, %{_y}%, %{_z}%, %{_world}%":
- stop loop
- if {tycoon::scematic::%loop-player%} is "dirt_machine":
- removeScematic(loop-player, "dirt_machine", "%{tycoon::scematic::%loop-player%::x}%", "%{tycoon::scematic::%loop-player%::y}%", "%{tycoon::scematic::%loop-player%::z}%", {tycoon::scematic::%loop-player%::dir})
- set {tycoon::targetedBlock::%loop-player%} to "%{_x}%, %{_y}%, %{_z}%, %{_world}%"
- set {tycoon::scematic::%loop-player%::x} to "%{_x}%"
- set {tycoon::scematic::%loop-player%::y} to "%{_y}%"
- set {tycoon::scematic::%loop-player%::z} to "%{_z}%"
- set {tycoon::scematic::%loop-player%::dir} to {_dir}
- set {tycoon::scematic::%loop-player%} to "dirt_machine"
- drawScematic(loop-player, "dirt_machine", "%{_x}%", "%{_y}%", "%{_z}%", {_dir})
- else:
- if {tycoon::targetedBlock::%loop-player%} is set:
- if {tycoon::scematic::%loop-player%} is "dirt_machine":
- removeScematic(loop-player, "dirt_machine", "%{tycoon::scematic::%loop-player%::x}%", "%{tycoon::scematic::%loop-player%::y}%", "%{tycoon::scematic::%loop-player%::z}%", {tycoon::scematic::%loop-player%::dir})
- delete {tycoon::scematic::%loop-player%}
- delete {tycoon::targetedBlock::%loop-player%}
- function drawScematic(p: Player, t: String, x: String, y: String, z: String, direction: Direction):
- if {_t} is "dirt_machine":
- set {_world} to world of {_p}
- set {_opposite} to getOppositeDirection({_direction})
- fill("%{_x} parsed as a number%", "%{_y} parsed as a number%", "%{_z} parsed as a number%", addNumber({_x} parsed as a number, {_y} parsed as a number, {_z} parsed as a number, {_world}, {_opposite}, 6.0), "%{_world}%", "scematic_dirt_machine", {_p})
- fill("%{_x} parsed as a number%", "%{_y} parsed as a number%", "%{_z} parsed as a number%", addNumber({_x} parsed as a number, {_y} parsed as a number, {_z} parsed as a number, {_world}, {_opposite}, 6.0), "%{_world}%", "scematic_dirt_machine", {_p})
- function removeScematic(p: player, t: String, x: String, y: String, z: String, direction: Direction):
- if {_t} is "dirt_machine":
- set {_world} to world of {_p}
- set {_opposite} to getOppositeDirection({_direction})
- remove("%{_x} parsed as a number%", "%{_y} parsed as a number%", "%{_z} parsed as a number%", addNumber({_x} parsed as a number, {_y} parsed as a number, {_z} parsed as a number, {_world}, {_opposite}, 6.0), "%{_world}%", "scematic_dirt_machine", {_p})
- command /data:
- trigger:
- set {_world} to world of player
- set {_dir} to facing of player
- set {_opposite} to getOppositeDirection({_dir})
- set {_block} to getUpStairDirection(wooden_stairs, {_dir}, 0)
- #set {_block} to getDirectionalBlock(dirt, {_opposite})
- #set {_block} to "wooden_stairs:1"
- send "%{_block}%"
- set targeted block to {_block}
- #send "%data of targeted block of player%"
- #set block at location of targeted block to stairs:1
- #add "{Facing:2}" to nbt tag of block at location of targeted block
- command /downdata:
- trigger:
- set {_world} to world of player
- set {_dir} to facing of player
- set {_loc} to location at player
- fillDir(player, "scematic_dirt_machine", "%world of player%", {_dir}, "%x-coordinate of player%", "%y-coordinate of player%", "%z-coordinate of player%", {_loc}, 0, 0, 0)
- #set {_opposite} to getOppositeDirection({_dir})
- #set {_block} to getDownStairDirection(wooden_stairs, {_dir}, 0)
- #send "%{_block}%"
- #set targeted block to {_block}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement