Posted December 9, 20204 yr Hi, I am currently trying to make a block that teleports the player in my custom dimension, and I runned into an issue. Indeed, for my player.changeDimension(), I need a DimensionType, and with my DefferedRegistrer I can just get a ModDimension, so I wanted to know if there is a way to get it as a DimensionType, otherwise it's quiet annoying as I can't make it to work Thanks
December 9, 20204 yr Have you tried using player.changeDimension(yourdimensionclass.yourdimension.get()) I am not very familiar with dimensions yet, but I believe that that should work...
December 9, 20204 yr Author My dimension class extends Dimension, but when I get it with DefferedRegister, it returns a ModDimension, not a DimensionType, and that's the point
December 9, 20204 yr Author Hmm nope, I haven’y tried that, however I am not sure if I can get a dimension with biome provider 😕
December 10, 20204 yr `DimensionManager.registerOrGetDimension(ResourceLocation,ModDimension,PacketBuffer,boolean)` returns a DimensionType. Have you ever want the new operator to return a type that you didn't ask for? Well, now you can!
December 10, 20204 yr Author Ok, that seems decent, I’m gonna try to do this this afternoon, Ima tell you if it works
December 10, 20204 yr Author It crahses my game as soon as it execute that line of code, it may be because I don't know what to put as "PacketBuffer data" 😅, have you got any piece of idea ? Here is the line that make it crash : player.changeDimension(DimensionManager.registerOrGetDimension(DimensionInit.ORES_DIM.getId(), DimensionInit.ORES_DIM.get(), null, true);
December 11, 20204 yr You need to register the dimension during the event, like this: @SubscribeEvent public static void dimReg(RegisterDimensionsEvent event) { while (sky() == null); } public static DimensionType sky() { ModDimension sky = SKY_DIM.get(); return DimensionManager.registerOrGetDimension(sky.getRegistryName(), sky, null, true); } Have you ever want the new operator to return a type that you didn't ask for? Well, now you can!
December 11, 20204 yr Author Ok, I got that, but it it still not working 😅, plus I don't understand the interest of the while( sky() == null);
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.