minecraft:teleport
Defines an entity's teleporting behavior.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
random_teleports | Boolean | true | If true, the entity will teleport randomly |
teleports_on_projectile_hit | Boolean | false | If true, the entity will attempt to teleport away from projectiles about to hit it |
projectile_filter | Any | — | Conditions that determine which projectiles cause the entity to attempt to teleport. If omitted, all projectiles cause a teleport attempt |
min_random_teleport_time | Decimal | 0 | Minimum amount of time in seconds between random teleports |
max_random_teleport_time | Decimal | 20 | Maximum amount of time in seconds between random teleports |
random_teleport_cube | List of decimal or Object | [32, 16, 32] | Entity will teleport to a random position within the area defined by this cube |
x | Decimal | 0 | |
y | Decimal | 0 | |
z | Decimal | 0 | |
target_distance | Decimal | 16 | Maximum distance the entity will teleport when chasing a target |
target_teleport_chance | Decimal | 1 | The chance that the entity will teleport between 0.0 and 1.0. 1.0 means 100% |
light_teleport_chance | Decimal | 0.01 | Modifies the chance that the entity will teleport if the entity is in daylight |
dark_teleport_chance | Decimal | 0.01 | Modifies the chance that the entity will teleport if the entity is in darkness |
Example from the game files
This is how vanilla Enderman uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:teleport": {
"random_teleports": true,
"max_random_teleport_time": 30,
"random_teleport_cube": [
32,
32,
32
],
"target_distance": 16,
"target_teleport_chance": 0.05,
"light_teleport_chance": 0.05,
"teleports_on_projectile_hit": true
}
}Used by 1
Vanilla entities with minecraft:teleport in their definition: