Class GoatData

java.lang.Object
ch.njol.skript.entity.EntityData<org.bukkit.entity.Goat>
ch.njol.skript.entity.GoatData
All Implemented Interfaces:
SyntaxElement, YggdrasilSerializable, YggdrasilSerializable.YggdrasilExtendedSerializable

public class GoatData extends EntityData<org.bukkit.entity.Goat>
  • Constructor Details

    • GoatData

      public GoatData()
    • GoatData

      public GoatData(int screaming)
  • Method Details

    • init

      protected boolean init(Literal<?>[] exprs, int matchedPattern, SkriptParser.ParseResult parseResult)
      Description copied from class: EntityData
      Initializes this EntityData from 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:
      init in class EntityData<org.bukkit.entity.Goat>
      Parameters:
      exprs - An array of Literal expressions 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 of null.
      matchedPattern - The index of the pattern which matched.
      parseResult - Additional information from the parser.
      Returns:
      true if initialization was successful, otherwise false.
    • init

      protected boolean init(@Nullable @Nullable Class<? extends org.bukkit.entity.Goat> c, @Nullable @Nullable org.bukkit.entity.Goat goat)
      Description copied from class: EntityData
      Initializes this EntityData from either an entity class or a specific Entity.

      Example usage:

                  
                      spawn a pig at location(0, 0, 0):
                              set {_entity} to event-entity
                      spawn {_entity} at location(0, 0, 0)
                  
              

      Specified by:
      init in class EntityData<org.bukkit.entity.Goat>
      Parameters:
      c - An entity's class, e.g. Player
      goat - An actual entity, or null to get an entity data for an entity class
      Returns:
      true if initialization was successful, otherwise false.
    • set

      public void set(org.bukkit.entity.Goat entity)
      Description copied from class: EntityData
      Applies this EntityData to a newly spawned Entity.

      This is used during entity spawning to set additional data, such as a saddled pig.

      Specified by:
      set in class EntityData<org.bukkit.entity.Goat>
      Parameters:
      entity - The spawned entity.
    • match

      protected boolean match(org.bukkit.entity.Goat entity)
      Description copied from class: EntityData
      Determines whether the given Entity matches this EntityData data.

      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:
      match in class EntityData<org.bukkit.entity.Goat>
      Parameters:
      entity - The Entity to match.
      Returns:
      true if the entity matches, otherwise false.
    • getType

      public Class<? extends org.bukkit.entity.Goat> getType()
      Description copied from class: EntityData
      Returns the Class of the Entity that this EntityData represents or handles.
      Specified by:
      getType in class EntityData<org.bukkit.entity.Goat>
      Returns:
      The entity's Class, such as Pig.class.
    • getSuperType

      @NotNull public @NotNull EntityData getSuperType()
      Description copied from class: EntityData
      Returns a more general version of this EntityData with 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:
      getSuperType in class EntityData<org.bukkit.entity.Goat>
      Returns:
      A generalized EntityData representing the base entity type.
    • hashCode_i

      protected int hashCode_i()
      Description copied from class: EntityData
      Internal method used by EntityData.hashCode() to include subclass-specific fields in the hash calculation for this EntityData.
      Specified by:
      hashCode_i in class EntityData<org.bukkit.entity.Goat>
      Returns:
      A hash code representing subclass-specific data.
    • equals_i

      protected boolean equals_i(EntityData<?> data)
      Description copied from class: EntityData
      Internal helper for EntityData.equals(Object) to compare the specific data of this EntityData with another.
      Specified by:
      equals_i in class EntityData<org.bukkit.entity.Goat>
      Parameters:
      data - The EntityData to compare with.
      Returns:
      true if the data is considered equal, otherwise false.
    • isSupertypeOf

      public boolean isSupertypeOf(EntityData<?> data)
      Description copied from class: EntityData
      Determines whether this EntityData is a supertype of the given entityData.

      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:
      isSupertypeOf in class EntityData<org.bukkit.entity.Goat>
      Parameters:
      data - The EntityData to compare against.
      Returns:
      true if this is a supertype of the given entity data, otherwise false.