Package ch.njol.skript.entity
Class EndermanData
java.lang.Object
ch.njol.skript.entity.EntityData<org.bukkit.entity.Enderman>
ch.njol.skript.entity.EndermanData
- All Implemented Interfaces:
SyntaxElement,YggdrasilSerializable,YggdrasilSerializable.YggdrasilExtendedSerializable
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.njol.yggdrasil.YggdrasilSerializable
YggdrasilSerializable.YggdrasilExtendedSerializable, YggdrasilSerializable.YggdrasilRobustEnum, YggdrasilSerializable.YggdrasilRobustSerializable -
Field Summary
Fields inherited from class ch.njol.skript.entity.EntityData
LANGUAGE_NODE, m_adult, m_age_pattern, m_baby, matchedPattern, serializer, WORLD_1_17_CONSUMER, WORLD_1_17_CONSUMER_METHOD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanDeprecated, for removal: This API element is subject to removal in a future version.protected booleanequals_i(EntityData<?> obj) Internal helper forEntityData.equals(Object)to compare the specific data of thisEntityDatawith another.@NotNull EntityDataReturns a more general version of thisEntityDatawith specific data removed.Class<org.bukkit.entity.Enderman> getType()protected intInternal method used byEntityData.hashCode()to include subclass-specific fields in the hash calculation for thisEntityData.protected booleaninit(Literal<?>[] exprs, int matchedPattern, SkriptParser.ParseResult parseResult) Initializes thisEntityDatafrom the matched pattern and its associated literals.protected booleaninit(@Nullable Class<? extends org.bukkit.entity.Enderman> c, @Nullable org.bukkit.entity.Enderman e) Initializes thisEntityDatafrom either an entity class or a specificEntity.booleanisSupertypeOf(EntityData<?> e) Determines whether thisEntityDatais a supertype of the givenentityData.booleanmatch(org.bukkit.entity.Enderman entity) Determines whether the givenEntitymatches thisEntityDatadata.voidset(org.bukkit.entity.Enderman entity) Applies thisEntityDatato a newly spawnedEntity.toString(int flags) Methods inherited from class ch.njol.skript.entity.EntityData
canSpawn, create, create, create, deserialize, equals, fromClass, fromEntity, getAgeAdjective, getAll, getAll, getAll, getInfo, getInfo, getName, getSyntaxTypeName, hashCode, init, isBaby, isInstance, isPlural, onRegistrationStop, parse, parseWithoutIndefiniteArticle, register, register, serialize, spawn, spawn, spawn, spawn, toString, toString, toString, toString, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.njol.skript.lang.SyntaxElement
getParser, preInit
-
Constructor Details
-
EndermanData
public EndermanData() -
EndermanData
-
-
Method Details
-
init
protected boolean init(Literal<?>[] exprs, int matchedPattern, SkriptParser.ParseResult parseResult) Description copied from class:EntityDataInitializes thisEntityDatafrom the matched pattern and its associated literals.This is used when parsing entity data from user-written patterns such as "a saddled pig".
- Specified by:
initin classEntityData<org.bukkit.entity.Enderman>- Parameters:
exprs- An array ofLiteralexpressions from the matched pattern, in the order they appear. If an optional value was omitted by the user, it will still be present in the array with a value ofnull.matchedPattern- The index of the pattern which matched.parseResult- Additional information from the parser.- Returns:
trueif initialization was successful, otherwisefalse.
-
init
protected boolean init(@Nullable @Nullable Class<? extends org.bukkit.entity.Enderman> c, @Nullable @Nullable org.bukkit.entity.Enderman e) Description copied from class:EntityDataInitializes thisEntityDatafrom either an entity class or a specificEntity.Example usage:
spawn a pig at location(0, 0, 0): set {_entity} to event-entity spawn {_entity} at location(0, 0, 0)- Specified by:
initin classEntityData<org.bukkit.entity.Enderman>- Parameters:
c- An entity's class, e.g. Playere- An actual entity, or null to get an entity data for an entity class- Returns:
trueif initialization was successful, otherwisefalse.
-
set
public void set(org.bukkit.entity.Enderman entity) Description copied from class:EntityDataApplies thisEntityDatato a newly spawnedEntity.This is used during entity spawning to set additional data, such as a saddled pig.
- Specified by:
setin classEntityData<org.bukkit.entity.Enderman>- Parameters:
entity- The spawned entity.
-
match
public boolean match(org.bukkit.entity.Enderman entity) Description copied from class:EntityDataDetermines whether the givenEntitymatches thisEntityDatadata.For example:
spawn a pig at location(0, 0, 0): set {_entity} to event-entity if {_entity} is a pig: # will pass if {_entity} is a saddled pig: # will not pass- Specified by:
matchin classEntityData<org.bukkit.entity.Enderman>- Parameters:
entity- TheEntityto match.- Returns:
trueif the entity matches, otherwisefalse.
-
getType
Description copied from class:EntityData- Specified by:
getTypein classEntityData<org.bukkit.entity.Enderman>- Returns:
- The entity's
Class, such asPig.class.
-
toString
- Overrides:
toStringin classEntityData<org.bukkit.entity.Enderman>
-
hashCode_i
protected int hashCode_i()Description copied from class:EntityDataInternal method used byEntityData.hashCode()to include subclass-specific fields in the hash calculation for thisEntityData.- Specified by:
hashCode_iin classEntityData<org.bukkit.entity.Enderman>- Returns:
- A hash code representing subclass-specific data.
-
equals_i
Description copied from class:EntityDataInternal helper forEntityData.equals(Object)to compare the specific data of thisEntityDatawith another.- Specified by:
equals_iin classEntityData<org.bukkit.entity.Enderman>- Parameters:
obj- TheEntityDatato compare with.- Returns:
trueif the data is considered equal, otherwisefalse.
-
deserialize
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
deserializein classEntityData<org.bukkit.entity.Enderman>
-
isSupertypeOf
Description copied from class:EntityDataDetermines whether thisEntityDatais a supertype of the givenentityData.This is used to check whether the current entity data represents a broader category than another. For example:
if a zombie is a monster: # passes: "monster" is a supertype of "zombie" if a monster is a zombie: # fails: "zombie" is not a supertype of "monster"- Specified by:
isSupertypeOfin classEntityData<org.bukkit.entity.Enderman>- Parameters:
e- TheEntityDatato compare against.- Returns:
trueif this is a supertype of the given entity data, otherwisefalse.
-
getSuperType
Description copied from class:EntityDataReturns a more general version of thisEntityDatawith specific data removed.For example, calling this on
"a saddled pig"would return"a pig". This is typically used to obtain the base entity type without any modifiers or traits.- Specified by:
getSuperTypein classEntityData<org.bukkit.entity.Enderman>- Returns:
- A generalized
EntityDatarepresenting the base entity type.
-