@FunctionalInterface public interface EntityPlacer
FabricDimensions
,
FabricDimensionType
Modifier and Type | Method and Description |
---|---|
net.minecraft.block.pattern.BlockPattern.TeleportTarget |
placeEntity(net.minecraft.entity.Entity teleported,
net.minecraft.server.world.ServerWorld destination,
net.minecraft.util.math.Direction portalDir,
double horizontalOffset,
double verticalOffset)
Handles the placement of an entity going to a dimension.
|
net.minecraft.block.pattern.BlockPattern.TeleportTarget placeEntity(net.minecraft.entity.Entity teleported, net.minecraft.server.world.ServerWorld destination, net.minecraft.util.math.Direction portalDir, double horizontalOffset, double verticalOffset)
FabricDimensions.teleport(Entity, net.minecraft.world.dimension.DimensionType, EntityPlacer)
to specify placement logic when needed.
This method may have side effects such as the creation of a portal in the target dimension, or the creation of a chunk loading ticket.
portalDir
- the direction the portal is facing, meaningless if no portal was usedhorizontalOffset
- the horizontal offset of the entity relative to the front top left corner of the portal, meaningless if no portal was usedverticalOffset
- the vertical offset of the entity relative to the front top left corner of the portal, meaningless if no portal was usednull
to fall back to further handling