Class GlowLeashHitch

All Implemented Interfaces:
net.kyori.adventure.audience.Audience, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowEntity>, org.bukkit.command.CommandSender, org.bukkit.entity.Entity, org.bukkit.entity.Hanging, org.bukkit.entity.LeashHitch, org.bukkit.material.Attachable, org.bukkit.material.Directional, org.bukkit.metadata.Metadatable, org.bukkit.Nameable, org.bukkit.permissions.Permissible, org.bukkit.permissions.ServerOperator, org.bukkit.persistence.PersistentDataHolder

public class GlowLeashHitch extends GlowHangingEntity implements org.bukkit.entity.LeashHitch
  • Constructor Details

    • GlowLeashHitch

      public GlowLeashHitch(org.bukkit.Location location)
    • GlowLeashHitch

      public GlowLeashHitch(org.bukkit.Location location, org.bukkit.block.BlockFace clickedface)
      Creates a leash hitch entity, for when a leash is hitched to a block such as a fencepost.
      Parameters:
      location - the location
      clickedface - the side of the block that was clicked (TODO: what difference does this make?)
  • Method Details

    • getLeashHitchAt

      public static org.bukkit.entity.LeashHitch getLeashHitchAt(org.bukkit.block.Block block)
      Get the Leash Hitch to which entities should be attached at the block. Useful if multiple Leash Hitches could exist.
      Parameters:
      block - the Block to get the relevant Leash Hitch for
      Returns:
      either an already existing Leash Hitch, or a newly spawned one
    • isAllowedLeashHolder

      public static boolean isAllowedLeashHolder(org.bukkit.entity.EntityType type)
      Checks if an Entity of the specified type is allowed to be a leash holder.
      Parameters:
      type - type of the entity which wishes to become a leash holder
      Returns:
      if the type is allowed as a leash holder true, otherwise false
    • createSpawnMessage

      public List<com.flowpowered.network.Message> createSpawnMessage()
      Description copied from class: GlowEntity
      Creates a list of Messages which can be sent to a client to spawn this entity. Implementations in concrete subclasses may return a shallowly immutable list.
      Specified by:
      createSpawnMessage in class GlowEntity
      Returns:
      A list of messages which can spawn this entity.
    • getType

      public org.bukkit.entity.EntityType getType()
      Specified by:
      getType in interface org.bukkit.entity.Entity
      Overrides:
      getType in class GlowEntity
    • setFacingDirection

      public boolean setFacingDirection(org.bukkit.block.BlockFace blockFace, boolean force)
      Specified by:
      setFacingDirection in interface org.bukkit.entity.Hanging
    • setFacingDirection

      public void setFacingDirection(org.bukkit.block.BlockFace blockFace)
      Specified by:
      setFacingDirection in interface org.bukkit.material.Directional
    • shouldSave

      public boolean shouldSave()
      Description copied from class: GlowEntity
      Checks whether this entity should be saved as part of the world.
      Overrides:
      shouldSave in class GlowEntity
      Returns:
      True if the entity should be saved.
    • pulse

      public void pulse()
      Description copied from class: GlowEntity
      Called every game cycle. Subclasses should implement this to implement periodic functionality e.g. mob AI.
      Overrides:
      pulse in class GlowEntity
    • entityInteract

      public boolean entityInteract(GlowPlayer player, InteractEntityMessage message)
      Overrides:
      entityInteract in class GlowEntity