Interface LeashFlag
public interface LeashFlag
A single condition that must be satisfied before a player can leash
(tame) a mob as a pet. Implementations are registered with
LeashFlagManager and discovered by their LeashFlagName
annotation.
Multiple flags may be configured per pet type in the skilltree; all configured flags must pass for the leash attempt to succeed.
Implementations range from simple state checks (BabyFlag,
TamedFlag) to integration gates that defer to external plugins
(WorldGuardFlag, MythicMobsFlag).
-
Method Summary
Modifier and TypeMethodDescriptionbooleancheck(Player player, LivingEntity entity, double damage, Settings settings) Evaluates whether this leash condition is met for the given player/entity pair.static ComponentgetComponentPrefix(boolean right) Returns a colored prefix component for use in player-facing feedback messages: a green checkmark (✔) when the flag passes, or a red cross (✘) when it fails.default ComponentgetMissingMessage(Player player, LivingEntity entity, double damage, Settings settings) Returns a player-facing message explaining why this flag failed, shown when the leash attempt is denied.default booleanIftrue, the/petinfohelper display skips this flag - useful for flags that are always-pass or purely internal.
-
Method Details
-
getComponentPrefix
Returns a colored prefix component for use in player-facing feedback messages: a green checkmark (✔) when the flag passes, or a red cross (✘) when it fails.- Parameters:
right-truefor pass (green ✔),falsefor fail (red ✘)- Returns:
- the prefix component
-
check
Evaluates whether this leash condition is met for the given player/entity pair.- Parameters:
player- the player attempting to leash the mobentity- the mob being leasheddamage- the final damage dealt to the mob in the leash hit (some flags gate on minimum damage)settings- flag-specific parameters from the skilltree config (e.g. required size, chance percentage)- Returns:
trueif this condition passes
-
getMissingMessage
default Component getMissingMessage(Player player, LivingEntity entity, double damage, Settings settings) Returns a player-facing message explaining why this flag failed, shown when the leash attempt is denied. Returnnull(the default) to suppress feedback for this flag.- Parameters:
player- the player whose leash attempt was deniedentity- the mob they tried to leashdamage- the damage dealt in the leash hitsettings- this flag's parameters from the config- Returns:
- the message to show, or
nullto stay silent
-
ignoredByHelper
default boolean ignoredByHelper()Iftrue, the/petinfohelper display skips this flag - useful for flags that are always-pass or purely internal.- Returns:
trueto hide this flag from the capture helper
-