minecraft:teleport for you with a switch.Get GodCraftOverview
minecraft:teleport is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Lets the entity teleport around randomly or toward its target, like an enderman.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
dark_teleport_chance | Decimal | "0.01" | Changes how likely a random teleport is when the entity is in darkness. |
light_teleport_chance | Decimal | "0.01" | Changes how likely a random teleport is when the entity is in daylight. |
max_random_teleport_time | Decimal | "20" | Longest time in seconds between random teleports. |
min_random_teleport_time | Decimal | "0" | Shortest time in seconds between random teleports. |
projectile_filter | Minecraft Filter | none | Decides which projectiles make the entity try to teleport; leave it out for all of them. |
random_teleport_cube | Vector [a, b, c] | "[32, 16, 32]" | Size of the box around the entity where random teleports can land. |
random_teleports | Boolean | "true" | If true, the entity teleports randomly now and then. |
target_distance | Decimal | "16" | Farthest the entity will teleport while chasing a target. |
target_teleport_chance | Decimal | "1" | Chance from 0.0 to 1.0 of teleporting toward its target. |
teleports_on_projectile_hit | Boolean | "false" | If true, the entity dodges incoming projectiles by teleporting. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:teleport": {
"dark_teleport_chance": "0.01",
"light_teleport_chance": "0.01",
"max_random_teleport_time": "20",
"min_random_teleport_time": "0",
"projectile_filter": {},
"random_teleport_cube": "[32, 16, 32]",
"random_teleports": "true",
"target_distance": "16"
}
}