#how to switch entity's dimension minecraft?

1 messages · Page 1 of 1 (latest)

frank axle
#

I just can't understand, how to do this (1.21)

frank axle
#

help please

wet spoke
#

Entity.moveToWorld

frank axle
wet spoke
#

mappings?

#

It's changeDimension in mojmap

frank axle
wet spoke
#

What mappings are you using

frank axle
#

Fabric

#

yarn

wet spoke
#

Oh oops

#

teleportTo maybe?

frank axle
#

uuuhm

#

how use it?

#

like

#

i... can't understand

#

maybe

#

but how

wet spoke
#

Check the argument type

brave light
#

TeleportTo is for portals

#

entity.teleport()

#

i believe flags can be null

#

to get the correct dimension you do:


ServerWorld serverWorld = world.getServer().getWorld(World.OVERWORLD)// or you mods dimension level key
    public static final RegistryKey<World> YOUR_LEVEL_KEY = RegistryKey.of(RegistryKeys.WORLD,
            Identifier.of("modid:moddimension"));
brave light
#

you don't have to make it a variable if you are using it directly

#

so only put world.getServer().getWorld(World.OVERWORLD)

brave light
#

and you then have to fill in the rest of the arguments

#

(world.getServer().getWorld(World.OVERWORLD), x, y, z, null, entity.getYaw(), entity.getPitch())

frank axle
#

thank you

frank axle
#

:\