Solved fishing

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

skanto123

Active Member
Jan 8, 2018
70
0
0
34
on script load:
import "org.bukkit.event.player.PlayerFishEvent"

on "org.bukkit.event.player.PlayerFishEvent":
if "%event.getState().name()%" is "CAUGHT_FISH":
chance of 50%:
message "&bSweet, sparkling surprise! That's a diamond!" to event.getPlayer()
give 1 diamond named "&bDiamond" with lore "&ctest" to player
broadcast "&b%player% just caught a diamond"

I want to make it so when a player catches a fish it gives the player a diamond and broadcasts it to the server I am using skript with Skript-Mirror ADDON
 
You were pretty close man, I modified it a bit and tested it and it seems to work.

code_language.skript:
on "org.bukkit.event.player.PlayerFishEvent":
  if "%event.getState().name()%" is "CAUGHT_FISH":
    chance of 50%:
      message "&bSweet, sparkling surprise! That's a diamond!" to event.getPlayer()
      set {_player} to event.getPlayer()
      give diamond named "&bDiamond" with lore "&ctest" to {_player}
      broadcast "&b%event.getPlayer()% just caught a diamond"
 
Status
Not open for further replies.