Difference between revisions of "BKCommonLib/CommonEntity"
(Created page with "« Go back ==Introduction== The CommonEntity class provides additional advanced entity utilities Bukkit does not provide. Most evidently, these are: Utilitie...") |
Bergerkiller (talk | contribs) |
||
Line 27: | Line 27: | ||
==Entity Controllers== | ==Entity Controllers== | ||
− | CommonEntity is the hub for Entity Controllers. For more information, see [ | + | CommonEntity is the hub for Entity Controllers. For more information, see [https://wiki.traincarts.net/p/BKCommonLib/Controller this page]. |
==Entity Network Controllers== | ==Entity Network Controllers== | ||
− | For spawned CommonEntities, network controllers can be assigned as well. For more information, see [ | + | For spawned CommonEntities, network controllers can be assigned as well. For more information, see [https://wiki.traincarts.net/p/BKCommonLib/NetworkController this page]. |
Revision as of 23:16, 26 July 2021
Introduction
The CommonEntity class provides additional advanced entity utilities Bukkit does not provide. Most evidently, these are:
Utilities to alter entity position, velocity Perform cross-world teleportation of all entity types Added properties (isInWater, isMoving, etc.) Entity controllers Entity network controllers In addition, it contains several 'specialized' CommonEntity extensions. For example, minecarts, players and items have an additional class to handle the entity-specific methods. More CommonEntity extensions are added as the project goes on, but it partially depends on what Bukkit is unable to provide by default.
Usage
The basic usage of CommonEntity instances is as follows:
Creating a new entity and spawning it afterwards
CommonEntity<?> entity = CommonEntity.create(EntityType.CREEPER); // Some pre-spawn conditions, and what not entity.spawn(location);
Obtaining a (new) CommonEntity from an existing Entity
CommonEntity<?> entity = CommonEntity.get(entity); CommonPlayer player = CommonEntity.get(playerEntity); CommonItem item = CommonEntity.get(itemEntity);
Entity Controllers
CommonEntity is the hub for Entity Controllers. For more information, see this page.
Entity Network Controllers
For spawned CommonEntities, network controllers can be assigned as well. For more information, see this page.