Package de.Keyle.MyPet.api.skill
Interface ToggleableSkill
- All Known Subinterfaces:
Fishing,Lumberjack,Mining,Sniff
public interface ToggleableSkill
A skill the owner can switch on or off at runtime (from the pet menu) independently of whether
the skilltree granted it. The on/off flag is persisted per pet via
TOGGLE_CODEC.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordPersisted on/off flag for a toggleable skill. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SkillStateCodec<ToggleableSkill.ToggleState> Shared NBT codec for the on/off flag — reuse it for every toggleable skill's state codec. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTrue if the owner currently has this skill switched on.voidsetEnabled(boolean enabled) Switches this skill on or off for the pet.
-
Field Details
-
TOGGLE_CODEC
Shared NBT codec for the on/off flag — reuse it for every toggleable skill's state codec.
-
-
Method Details
-
isEnabled
boolean isEnabled()True if the owner currently has this skill switched on.- Returns:
trueif the owner has switched this skill on
-
setEnabled
void setEnabled(boolean enabled) Switches this skill on or off for the pet.- Parameters:
enabled-trueto switch the skill on
-