Effective Entity
Base class for a custom entity type.
A subclass configures spawned entities via editEntity, picks a base getEntityType and declares identity through getNamespacedData. Each spawned entity is tagged with the type's namespaced key in persistent data, so plain Entity instances can be matched back via getNamespacedKeyByEntity / equalByNamespacedKey. Like the item/zone bases, the object must be instantiated (e.g. init() in onEnable) to register and start tracking. For example, EffectiveEntity.equalByNamespacedKey(firstEntity, secondEntity) tells whether two entities are the same custom type.
Live instances are cached automatically as chunks/worlds load and unload; query them with getEntities. Behaviours are added via addInteractHandler and doEntityNearLookable.
A built-in /emob <entity> command spawns any registered custom entity in-game.
Inheritors
Properties
Functions
Manually adds entity to the tracking cache (spawns do this automatically).
Registers an interact handler for entities of this custom type (matched by key). To instead handle a plain vanilla EntityType, register through EffectiveEntityInteractable.addInteractHandler with a non-custom entity.
Resolves the persistent-data key for the declared additional arg name — use it to read the per-entity value via EffectiveDataContainerUtils. See getAdditionalArgs for the full flow.
Builds (but does not add to the world) an entity of this type at location — null falls back to the first world's origin. Use spawnEntity to actually place it.
createEntity variant that also applies additionalArgs to the new entity.
Makes entities of this type turn to look at nearby targets.
Configures a freshly created entity (attributes, name, equipment, …). Called on every create.
Declares extra, per-instance parameters this entity type accepts — values baked into an individual entity's persistent data at creation, so two entities of the same type can carry different settings.
Namespaced keys backing this type's getAdditionalArgs (key → PDC type), or null if none.
Currently tracked live entities of this type.
Convenience alias of getEntities for this type.
Tracked entities of this type standing on the given block position.
The base EntityType to spawn.
Owning plugin and a plugin-unique id; together they form the getNamespacedKey.
Unique identity as "<plugin-name>/<id>", both lowercased.
Removes entity from the tracking cache (matched by UUID).
Creates and spawns an entity of this type at location, adding it to the tracking cache.
spawnEntity variant that also applies additionalArgs.