Adds an effect to entity.
effect ID, should be one one of EPotionEffect values
effect amplifier
effect time in ticks
Optional
ambience: booleanif true, particles are ambient
Optional
particles: booleanif true, particles are not displayed
Adds an effect to entity.
effect ID, should be one one of EPotionEffect values
effect amplifier
effect time in ticks
if true, particles are ambient
if true, particles are not displayed
if true, flashing are displayed
Clears effect, applied to the mob.
effect ID, should be one of the EPotionEffect
Damages entity.
damage value in half-hearts
Optional
cause: numberexisting DamageSource or any inclusive value between 25 and 32
Optional
properties: { additional damage source properties
Optional
attacker?: numberEntity that caused damage, determines actor of damage source.
Optional
bool1?: booleanIf true
, damage can be reduced by armor.
Retrieves nearest to the coordinates entity of the specified entity type.
search range center coordinates
Optional
type: numberentity type ID. Parameter is no longer supported and should be 0 in all cases
Optional
maxRange: numberif specified, determines search radius
Overheating method, capture entities by BlockSource.fetchEntitiesInAABB
and pass over them by checking radius between coords and entity.
Instance to performing commands on requested addon
entity if it spawned by Inner Core or null
instead.
Includes only entities spawned locally (with Entity.spawnAddon).
Returns array of all entities numeric IDs in given range in blocks.
search range center coordinates
determines search radius
Optional
type: numberentity type ID
Overheating method, capture entities by BlockSource.fetchEntitiesInAABB
and pass over them by checking radius between coords and entity.
Returns array of all entities numeric IDs in given range in blocks.
Local method, use BlockSource.listEntitiesInAABB instead.
An array of all server entities UIDs.
Consider using Entity.getAll instead.
armor slot index, should be one of the EArmorType values
Armor slot contents for entity.
Creates an object used to change entity's attributes.
entity uid
one of Attribute or your custom one
Object used to manipulate entity's attributes.
Entity's current carried item information.
Compound tag for the specified entity.
Custom entity object by it's numeric entity UID.
Current dimension numeric ID, one of the EDimension values or custom dimension ID.
Distance between specified entity and a fixed coordinate set.
Gets item from specified drop entity
Instance that is in the dropped item.
Object with duration and level of the potion effect with given numeric ID on the given entity. These fields are set to 0, if the given effect doesn't affect the given entity at the moment.
Use attributes instead, or Saver.
Use attributes instead, or Saver.
Optional
handleNames: booleanOptional
handleEnchant: booleanConsider use Entity.getCarriedItem instead.
Retrieves entity's current movement information.
Object that contains normalized moving vector, moving speed and moving xz speed (with no Y coordinate).
Entity's current offhand item information.
Creates or gets an existing Entity.PathNavigation instance for the specified mob
Navigation used to control entity's target position and the way to get there.
Use callbacks and Entity.getAll instead.
Entity render type, should be one of the EMobRenderType values.
Numeric entity type, one of the EEntityType.
String type for entities defined via add-ons, otherwise null
.
Includes only entities spawned locally (with Entity.spawnAddon), test entities manually with Entity.getTypeName or use BlockSource.listEntitiesInAABB with appropriate arguments.
numeric ID of the potion effect, one of EPotionEffect values
Whether the given entity is affected by the potion effect with given numeric ID.
An object that allows to manipulate entity health.
Consider using Entity.getHealth, Entity.setHealth, Entity.getMaxHealth and Entity.setMaxHealth instead.
Same as Entity.lookAt but uses Vector as param type.
Makes entity move using pitch/yaw angle to determine direction.
angle to define entity's direction
additional move parameters
Makes entity move towards it's current look angle.
additional move parameters
Makes entity move to the target coordinates.
additional move parameters
Optional
extra: objectUse attributes instead, or Saver.
Use attributes instead, or Saver.
Sets armor slot contents for the entity.
armor slot index, should be one of the EArmorType values
item ID
item count
item data
Optional
extra: ItemExtraDataitem extra
Sets current carried item for the entity.
item ID
item count
item data
Optional
extra: ItemExtraDataitem extra
Sets compound tag for the specified entity.
Sets item to the specified drop entity
item ID
item count
item data
Optional
extra: ItemExtraDataitem extra
Sets current offhand item for the entity.
item ID
item count
item data
Optional
extra: ItemExtraDataitem extra
Sets entity render type.
entity render type, should be one of the EMobRenderType values
Spawns vanilla entity on the specified coordinates.
numeric entity type, one of the EEntityType
Optional
skin: stringskin to set for the entity. Leave empty or null to use default skin of the mob
Numeric ID of spawn entity or -1 if entity was not created.
Client-side method, use BlockSource.spawnEntity instead.
Spawns custom entity defined in behavior packs or game itself.
Instance to performing commands on entity.
Client-side method, use BlockSource.spawnEntity instead.
Same as Entity.spawnAddon, but uses Vector object to represent coordinates.
Instance to performing commands on entity.
Client-side method, use BlockSource.spawnEntity instead.
Same as Entity.spawn, but uses Vector object to represent coordinates.
Optional
skin: stringClient-side method, use BlockSource.spawnEntity instead.
Spawns custom entity on the specified coords. Allows to pass some values to controllers via extra param.
custom entity string ID
Optional
extra: objectobject that contains some data for the controllers
You are should implement addon entity and spawn it with BlockSource.spawnEntity instead.
Same as Entity.spawnCustom, but uses Vector object to represent coordinates.
Optional
extra: anyYou are should implement addon entity and spawn it with BlockSource.spawnEntity instead.
Damage sources, which are used to determine entity damage type:
Type | Name | Message | Translation |
---|---|---|---|
0 | Generic | "death.attack.generic" (fallback damage source) | * died |
1 | Cactus | "death.attack.cactus" (only when standing on cactus) | * was pricked to death |
2 | Mob | "death.attack.mob" | * was slain by * |
3 | Impact | n/a | |
4 | In Wall | "death.attack.inWall" | * suffocated in a wall |
5 | Fall | "death.attack.fall" OR "death.fell.accident.generic" | * hit the ground too hard OR * fell from a high place |
6 | In Fire | "death.attack.inFire" | * went up in flames |
7 | On Fire | "death.attack.onFire" | * burned to death |
8 | Lava | "death.attack.lava" | * tried to swim in lava |
9 | Drown | "death.attack.drown" | * drowned |
10 | Explosion | "death.attack.explosion" | * blew up |
11 | Explosion (Player) | "death.attack.explosion" | * was blown up by * |
12 | Out Of World | "death.attack.outOfWorld" | * fell out of the world |
13 | Command | n/a | |
14 | Magic | "death.attack.magic" | * was killed by magic |
15 | Wither | "death.attack.wither" | * withered away |
16 | Starve | "death.attack.starve" | * starved to death |
17 | Anvil | "death.attack.anvil" | * was squashed by a falling anvil |
18 | Thorns | "death.attack.thorns" | * was killed trying to hurt * |
19 | Projectile | n/a | |
20 | Falling Block | "death.attack.fallingBlock" | * was squashed by a falling block |
21 | Fly Into Wall | "death.attack.flyIntoWall" | * experienced kinetic energy |
22 | Magma | "death.attack.magma" | * discovered floor was lava |
23 | Fireworks | "death.attack.fireworks" | * went off with a bang |
24 | Lightning Bolt | "death.attack.lightningBolt" | * was struck by lightning |
Path navigation result, which is used in result callback:
Result code | Meaning |
---|---|
0 | Path successfully completed |
1 | Cannot reach target, no available path |
2 | Cannot reach target, out of range |
3 | Entity has been unloaded or removed |
4 | Cancelled by stop() or similar method |
5 | Player left level or server closed |
6 | Result function will be replaced |
Copyright © 2024 Nernar. Copyright © 2020 #mineprogramming. Built with ❤ and TypeDoc.
Module used to manipulate entities (mobs, drop, arrows, etc.) in the world. Every entity has it's unique numeric ID which is often used across this module as the first function parameter.