Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 :)

Have you tried using player.changeDimension(yourdimensionclass.yourdimension.get())

I am not very familiar with dimensions yet, but I believe that that should work...

  • 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 :/

  • Author

Hmm nope, I haven’y tried that, however I am not sure if I can get a dimension with biome provider 😕 

`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!

  • 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);

 

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!

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.