Package me.eXo8_.fakeentity.api
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 Summary
Modifier and TypeMethodDescriptiondefault FakeBlockDisplayblockDisplay(org.bukkit.Location loc) Convenience method for creating aFakeBlockDisplaywithout providing a factory.blockDisplay(org.bukkit.Location loc, Consumer<org.bukkit.entity.BlockDisplay> factory) Creates a newFakeBlockDisplayat the given location.booleancontains(int id) Checks if a fake entity exists with the given ID.get(int id) Gets a fake entity by its ID.Collection<? extends FakeEntity> getAll()Gets all currently managed fake entities.default FakeInteractioninteraction(org.bukkit.Location loc) Convenience method for creating aFakeInteractionwithout providing a factory.interaction(org.bukkit.Location loc, Consumer<org.bukkit.entity.Interaction> factory) Creates a newFakeInteractionat the given location.default FakeItemDisplayitemDisplay(org.bukkit.Location loc) Convenience method for creating aFakeItemDisplaywithout providing a factory.itemDisplay(org.bukkit.Location loc, Consumer<org.bukkit.entity.ItemDisplay> factory) Creates a newFakeItemDisplayat the given location.booleanremove(int id) Removes a fake entity by its ID.default FakeTextDisplaytextDisplay(org.bukkit.Location loc) Convenience method for creating aFakeTextDisplaywithout providing a factory.textDisplay(org.bukkit.Location loc, Consumer<org.bukkit.entity.TextDisplay> factory) Creates a newFakeTextDisplayat the given location.
-
Method Details
-
itemDisplay
FakeItemDisplay itemDisplay(org.bukkit.Location loc, Consumer<org.bukkit.entity.ItemDisplay> factory) Creates a newFakeItemDisplayat the given location.- Parameters:
loc- the spawn locationfactory- a consumer to configure theItemDisplaybefore spawning- Returns:
- the created fake item display
-
textDisplay
FakeTextDisplay textDisplay(org.bukkit.Location loc, Consumer<org.bukkit.entity.TextDisplay> factory) Creates a newFakeTextDisplayat the given location.- Parameters:
loc- the spawn locationfactory- a consumer to configure theTextDisplaybefore spawning- Returns:
- the created fake text display
-
blockDisplay
FakeBlockDisplay blockDisplay(org.bukkit.Location loc, Consumer<org.bukkit.entity.BlockDisplay> factory) Creates a newFakeBlockDisplayat the given location.- Parameters:
loc- the spawn locationfactory- a consumer to configure theBlockDisplaybefore spawning- Returns:
- the created fake block display
-
interaction
FakeInteraction interaction(org.bukkit.Location loc, Consumer<org.bukkit.entity.Interaction> factory) Creates a newFakeInteractionat the given location.- Parameters:
loc- the spawn locationfactory- a consumer to configure theInteractionbefore spawning- Returns:
- the created fake interaction
-
itemDisplay
Convenience method for creating aFakeItemDisplaywithout providing a factory. -
textDisplay
Convenience method for creating aFakeTextDisplaywithout providing a factory. -
blockDisplay
Convenience method for creating aFakeBlockDisplaywithout providing a factory. -
interaction
Convenience method for creating aFakeInteractionwithout 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
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
-