Package de.Keyle.MyPet.api.entity
Class PersistedPet.Builder
java.lang.Object
de.Keyle.MyPet.api.entity.PersistedPet.Builder
- Enclosing class:
PersistedPet
Step-by-step construction of a
PersistedPet, for callers setting more than one field.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the pet.exp(double v) Sets the accumulated experience.health(double v) Sets the current health.Sets the addon-owned persisted state; empty whennull.lastUsed(long v) Sets the last-activity timestamp.maxDistanceStep(int v) Sets the follow-distance step; normalized to1..5on build.minDistanceStep(int v) Sets the personal-space step; normalized to1..5on build.Sets the raw name, in MiniMessage form.Sets the species; also seeds health from the type's starting HP when health is still unset.respawnTime(int v) Sets the respawn timer, in seconds.saturation(double v) Sets the hunger level.Sets the per-skill persisted state; empty whennull.Sets the assigned skilltree.Sets the pet's persistent id.Sets the sound-volume override; empty (inherit the owner's setting) whennull.wantsToRespawn(boolean v) Sets whether the pet returns on the owner's next login.worldGroup(String v) Sets the world group; ignored whennull.
-
Method Details
-
uuid
Sets the pet's persistent id.- Parameters:
v- the value to set- Returns:
- this builder, for chaining
-
petType
Sets the species; also seeds health from the type's starting HP when health is still unset.- Parameters:
v- the value to set- Returns:
- this builder, for chaining
-
petName
Sets the raw name, in MiniMessage form.- Parameters:
v- the value to set- Returns:
- this builder, for chaining
-
worldGroup
Sets the world group; ignored whennull.- Parameters:
v- the value to set- Returns:
- this builder, for chaining
-
exp
Sets the accumulated experience.- Parameters:
v- the value to set- Returns:
- this builder, for chaining
-
health
Sets the current health.- Parameters:
v- the value to set- Returns:
- this builder, for chaining
-
saturation
Sets the hunger level.- Parameters:
v- the value to set- Returns:
- this builder, for chaining
-
respawnTime
Sets the respawn timer, in seconds.- Parameters:
v- the value to set- Returns:
- this builder, for chaining
-
wantsToRespawn
Sets whether the pet returns on the owner's next login.- Parameters:
v- the value to set- Returns:
- this builder, for chaining
-
lastUsed
Sets the last-activity timestamp.- Parameters:
v- the value to set- Returns:
- this builder, for chaining
-
skilltree
Sets the assigned skilltree.- Parameters:
v- the value to set- Returns:
- this builder, for chaining
-
skillInfo
Sets the per-skill persisted state; empty whennull.- Parameters:
v- the value to set- Returns:
- this builder, for chaining
-
info
Sets the addon-owned persisted state; empty whennull.- Parameters:
v- the value to set- Returns:
- this builder, for chaining
-
volume
Sets the sound-volume override; empty (inherit the owner's setting) whennull.- Parameters:
v- the override in [0, 1], or empty to inherit- Returns:
- this builder, for chaining
-
minDistanceStep
Sets the personal-space step; normalized to1..5on build.- Parameters:
v- the value to set- Returns:
- this builder, for chaining
-
maxDistanceStep
Sets the follow-distance step; normalized to1..5on build.- Parameters:
v- the value to set- Returns:
- this builder, for chaining
-
build
Builds the pet.- Returns:
- a new
PersistedPetwith the values set on this builder
-