Interface IEntityHandler


public interface IEntityHandler
Handles the creation and management of fake entities. Provides factory methods for spawning client-side entities and utilities for managing their lifecycle.
  • Method Details

    • itemDisplay

      FakeItemDisplay itemDisplay(org.bukkit.Location loc, Consumer<org.bukkit.entity.ItemDisplay> factory)
      Creates a new FakeItemDisplay at the given location.
      Parameters:
      loc - the spawn location
      factory - a consumer to configure the ItemDisplay before spawning
      Returns:
      the created fake item display
    • textDisplay

      FakeTextDisplay textDisplay(org.bukkit.Location loc, Consumer<org.bukkit.entity.TextDisplay> factory)
      Creates a new FakeTextDisplay at the given location.
      Parameters:
      loc - the spawn location
      factory - a consumer to configure the TextDisplay before spawning
      Returns:
      the created fake text display
    • blockDisplay

      FakeBlockDisplay blockDisplay(org.bukkit.Location loc, Consumer<org.bukkit.entity.BlockDisplay> factory)
      Creates a new FakeBlockDisplay at the given location.
      Parameters:
      loc - the spawn location
      factory - a consumer to configure the BlockDisplay before spawning
      Returns:
      the created fake block display
    • interaction

      FakeInteraction interaction(org.bukkit.Location loc, Consumer<org.bukkit.entity.Interaction> factory)
      Creates a new FakeInteraction at the given location.
      Parameters:
      loc - the spawn location
      factory - a consumer to configure the Interaction before spawning
      Returns:
      the created fake interaction
    • itemDisplay

      default FakeItemDisplay itemDisplay(org.bukkit.Location loc)
      Convenience method for creating a FakeItemDisplay without providing a factory.
    • textDisplay

      default FakeTextDisplay textDisplay(org.bukkit.Location loc)
      Convenience method for creating a FakeTextDisplay without providing a factory.
    • blockDisplay

      default FakeBlockDisplay blockDisplay(org.bukkit.Location loc)
      Convenience method for creating a FakeBlockDisplay without providing a factory.
    • interaction

      default FakeInteraction interaction(org.bukkit.Location loc)
      Convenience method for creating a FakeInteraction without providing a factory.
    • remove

      boolean remove(int id)
      Removes a fake entity by its ID.
      Parameters:
      id - the entity ID
      Returns:
      true if successfully removed, false otherwise
    • get

      Optional<FakeEntity> get(int id)
      Gets a fake entity by its ID.
      Parameters:
      id - the entity ID
      Returns:
      an optional containing the fake entity if found
    • contains

      boolean contains(int id)
      Checks if a fake entity exists with the given ID.
      Parameters:
      id - the entity ID
      Returns:
      true if exists, false otherwise
    • getAll

      Collection<? extends FakeEntity> getAll()
      Gets all currently managed fake entities.
      Returns:
      a collection of fake entities