Modify Entities
Entities, as you might expect, are quite different from blocks. For one thing, there are many more kinds of entities, and they have different kinds of abilities (and functions for us). With blocks, all you have to do is change the block type and perhaps add some additional information (like on a sign), but entities are more complicated.
To start off, all entities have the capabilities described in net.canarymod.api.entity.Entity. Each Entity object includes the following useful functions:
|
getLocation() |
Return the Location of the entity |
|
setFireTicks(int ticks) |
Set time to keep an entity on fire |
|
setRider(Entity rider) |
Set the entity’s rider |
|
spawn() |
Spawn this kind of Entity into the world |
|
teleport(Location ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access