Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- prefix: &7[&9Fish&7]
- defaultIcon: raw fish
- defaultMinChance: 1
- defaultMaxChance: 100
- defaultBiome1: ocean
- defaultBiome2: deep ocean
- defaultBiome3: river
- function menu(p: player, pg: integer, type: text):
- set {_i} to {_pg}*(3*9) - ((3*9)- 1)
- if {_type} is "MENU":
- create a gui with virtual chest with 4 rows named "&1Fish Menu Page %{_pg}%":
- loop 3*9 times:
- if {fish::list::%{_i}%} is set:
- if {fish::list::%{_i}%::biome::1} is set:
- set {_biome::1} to {fish::list::%{_i}%::biome::1}
- if {fish::list::%{_i}%::biome::2} is set:
- set {_biome::2} to {fish::list::%{_i}%::biome::2}
- if {fish::list::%{_i}%::biome::3} is set:
- set {_biome::3} to {fish::list::%{_i}%::biome::3}
- make next gui to {fish::list::%{_i}%::icon} named "&b%{fish::list::%{_i}%}%" with lore "||&3&lBiome||&f- &7%{_biome::1}%||&f- &7%{_biome::2}%||&f- &7%{_biome::3}%||&e&lChance&c %{fish::list::%{_i}%::chance::min}%%% - %{fish::list::%{_i}%::chance::max}%%%||||&7%{fish::list::%{_i}%::description}%":
- if {_p} has permission "fish.get":
- give {fish::list::%{_i}%::fish} to {_p}
- add 1 to {_i}
- make gui slot 4*9 - 1 to green glass pane named "&aNext Page &8[&c%{_pg} + 1%&8]":
- menu({_p}, "%{_pg} + 1%" parsed as integer, "%{_type}%")
- if {_pg} > 1:
- make gui slot 4*9 - 9 to red glass pane named "&3Previous Page &8[&c%{_pg} - 1%&8]":
- menu({_p}, "%{_pg} - 1%" parsed as integer, "%{_type}%")
- open last gui to {_p}
- stop
- on fishing:
- if "%fishing state%" is "CAUGHT_FISH":
- set {_biome} to event-player's biome
- loop {fish::list::*}:
- if "%{fish::list::%loop-index%::biome::1}%" or "%{fish::list::%loop-index%::biome::2}%" or "%{fish::list::%loop-index%::biome::3}%" is "%{_biome}%":
- add loop-index to {_caught::*}
- set {_fish} to random element of {_caught::*}
- set {_chance} to random number between {fish::list::%{_fish}%::chance::min} and {fish::list::%{_fish}%::chance::max}
- chance of {_chance}%:
- send "&eYou've caught an &b%{fish::list::%{_fish}%}%"
- clear caught item
- drop {fish::list::%{_fish}%::fish} at event-player
- stop
- command /fish [<text>] [<text>] [<Text>]:
- trigger:
- if arg 1 isn't set:
- menu(player, 1, "MENU")
- stop
- if player has permission "fish.admin":
- if arg 1 is "chance":
- if arg 2 is set:
- if arg 3 is set:
- set {_chance::*} to arg 3 split at "-"
- loop {fish::list::*}:
- if {fish::list::%loop-index%} is "%arg 2%":
- set {fish::list::%loop-index%::chance::min} to {_chance::1} parsed as number
- set {fish::list::%loop-index%::chance::max} to {_chance::2} parsed as number
- send "{@prefix} &eChance of &b%Arg 2% &e has been updated to &6%{_chance::1}%%% - %{_chance::2}%%%"
- stop
- if arg 1 is "biome":
- if arg 2 is set:
- if arg 3 is set:
- set {_biome::*} to arg 3 split at ":"
- loop {fish::list::*}:
- if {fish::list::%loop-index%} is "%Arg 2%":
- set {fish::list::%loop-index%::biome::%{_biome::1}%} to "%{_biome::2}%"
- send "{@prefix} &eBiome of &b%arg 2% &efor index &c%{_biome::1}% &ehas been updated"
- send "{@prefix} &b%arg 2% &enow can be found at &6%{fish::list::%loop-index%::biome::*}%"
- stop
- if arg 1 is "seticon":
- if arg 2 is set:
- loop {fish::list::*}:
- if {fish::list::%loop-index%} is "%arg 2%":
- set {fish::list::%loop-index%::icon} to 1 of player's tool
- send "{@prefix} &eIcon for &b%arg 2% &ehas been updated"
- stop
- if arg 1 is "desc" or "Description":
- if arg 2 is set:
- if arg 3 is set:
- loop {fish::list::*}:
- if {fish::list::%loop-index%} is "%arg 2%":
- set {fish::list::%loop-index%::description} to colored arg 3
- set {fish::list::%loop-index%::fish} to {fish::list::%loop-index%::icon} named "&b%{fish::list::%loop-index%}%" with lore "||&7%{fish::list::%loop-index%::description}%"
- send "{@prefix} &eDescription for &b%arg 2% &ehas been updated"
- stop
- if arg 1 is "add" or "new" or "create":
- if arg 2 is set:
- if "%{fish::list::*}%" contains "%arg 2%":
- send "{@prefix} &cFish named &b%arg 2%&c already created"
- stop
- add arg 2 to {fish::list::*}
- loop {fish::list::*}:
- if {fish::list::%loop-index%} is "%arg 2%":
- set {_icon} to {@defaultIcon}
- if player's tool is fish:
- set {_icon} to 1 of player's tool
- set {fish::list::%loop-index%::icon} to {_icon}
- set {fish::list::%loop-index%::biome::1} to {@defaultBiome1}
- set {fish::list::%loop-index%::biome::2} to {@defaultBiome2}
- set {fish::list::%loop-index%::biome::3} to {@defaultBiome3}
- set {fish::list::%loop-index%::fish} to {fish::list::%loop-index%::icon} named "&b%{fish::list::%loop-index%}%" with lore "||&7%{fish::list::%loop-index%::description}%"
- set {fish::list::%loop-index%::description} to "&r"
- set {fish::list::%loop-index%::chance::min} to {@defaultMinChance}
- set {fish::list::%loop-index%::chance::max} to {@defaultMaxChance}
- send "{@prefix} &aNew fish has been added named &b%arg 2%"
- stop
- if arg 1 is "del" or "delete" or "remove" or "rem":
- if arg 2 is set:
- loop {fish::list::*}:
- if {fish::list::%loop-index%} is "%arg 2%":
- delete {fish::list::%loop-index%}
- clear {fish::list::%loop-index%::*}
- send "{@prefix} &cFish &b%arg 2% &chas been removed"
- stop
Add Comment
Please, Sign In to add comment