Skip to content

Commit

Permalink
Fix fishing event docs (#7357)
Browse files Browse the repository at this point in the history
fix

Co-authored-by: Moderocky <admin@moderocky.com>
  • Loading branch information
Efnilite and Moderocky authored Jan 3, 2025
1 parent 1acc433 commit 6abee66
Showing 1 changed file with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.skriptlang.skript.bukkit.fishing.elements;

import ch.njol.skript.Skript;
import ch.njol.skript.doc.*;
import ch.njol.skript.lang.Literal;
import ch.njol.skript.lang.SkriptEvent;
import ch.njol.skript.lang.SkriptParser.ParseResult;
Expand All @@ -15,21 +14,6 @@
import java.util.ArrayList;
import java.util.List;

@Name("Fishing")
@Description({
"Called when a player triggers a fishing event.",
"An entity hooked event is triggered when an entity gets caught by a fishing rod.",
"A fish escape event is called when the player fails to click on time, and the fish escapes.",
"A fish approaching event is when the bobber is waiting to be hooked, and a fish is approaching."
})
@Examples({
"on fishing line cast:",
"\tsend \"You caught a fish!\" to player",
"on fishing state of caught entity:",
"\tpush event-entity vector from entity to player"
})
@RequiredPlugins("Paper (bobber lured)")
@Since("2.10")
public class EvtFish extends SkriptEvent {

private enum State {
Expand Down Expand Up @@ -71,7 +55,21 @@ private static PlayerFishEvent.State getOptional(String name) {
patterns.add(state.pattern);
}

Skript.registerEvent("Fishing", EvtFish.class, PlayerFishEvent.class, patterns.toArray(new String[0]));
Skript.registerEvent("Fishing", EvtFish.class, PlayerFishEvent.class, patterns.toArray(new String[0]))
.description(
"Called when a player triggers a fishing event.",
"An entity hooked event is triggered when an entity gets caught by a fishing rod.",
"A fish escape event is called when the player fails to click on time, and the fish escapes.",
"A fish approaching event is when the bobber is waiting to be hooked, and a fish is approaching."
)
.examples(
"on fishing line cast:",
"\tsend \"You caught a fish!\" to player",
"on fishing state of caught entity:",
"\tpush event-entity vector from entity to player"
)
.requiredPlugins("Paper (bobber lured)")
.since("2.10");

EventValues.registerEventValue(PlayerFishEvent.class, Entity.class, PlayerFishEvent::getCaught);
}
Expand Down

0 comments on commit 6abee66

Please sign in to comment.