Contents
Class StatCondition
java.lang.Object
com.hypixel.hytale.server.core.modules.entity.condition.Condition
com.hypixel.hytale.server.core.modules.entity.condition.EntityStatBoundCondition
com.hypixel.hytale.server.core.modules.entity.condition.StatCondition
A condition that checks an entity's stat against a specified amount using a comparison type.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe types of comparisons that can be made for stat conditions. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<StatCondition> The codec used to parseStatConditioninstances. -
Constructor Summary
ConstructorsConstructorDescriptionStatCondition(boolean inverse, int stat, float amount) Default Constructor for aStatConditioninstance. -
Method Summary
Modifier and TypeMethodDescriptionbooleaneval0(Ref<EntityStore> ref, Instant currentTime, EntityStatValue statValue) Called to evaluate the condition for the given entity stat value.toString()Methods inherited from class EntityStatBoundCondition
eval0Methods inherited from class Condition
allConditionsMet, allConditionsMet, eval
-
Field Details
-
CODEC
The codec used to parseStatConditioninstances.
-
-
Constructor Details
-
StatCondition
public StatCondition(boolean inverse, int stat, float amount) Default Constructor for aStatConditioninstance.- Parameters:
inverse- Whether to invert the condition's result.stat- The stat index to evaluate the condition against.amount- The amount to compare the entity's stat against.
-
-
Method Details
-
eval0
public boolean eval0(@Nonnull Ref<EntityStore> ref, @Nonnull Instant currentTime, @Nonnull EntityStatValue statValue) Description copied from class:EntityStatBoundConditionCalled to evaluate the condition for the given entity stat value.- Specified by:
eval0in classEntityStatBoundCondition- Parameters:
ref- The entity reference of the entity.currentTime- The current world time.statValue- The entity stat value to evaluate.- Returns:
trueif the condition is met,falseotherwise.
-
toString
- Overrides:
toStringin classEntityStatBoundCondition
-