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'm wondering how I can let an entity (player, animal, monster etc.) travel through dimensions in 1.9.

 

Thx in advance.

Bektor

Developer of Primeval Forest.

  • Author

Did you try looking at the vanilla code for the Nether or End portal and associated Teleporter? I bet those would have what you need.

Already tested it back in 1.8.9, does not work.

They do it with entity.setInPortal or so, but that's teleports you in the vanilla dimension. And this method just sets a boolean

to true and the rest is done in the Entity itself.

Developer of Primeval Forest.

You didn't follow the rabbit-hole far enough - eventually it should lead you to the ConfigurationManager or whatever the class is that you get from playerMp.mcServer.getConfigurationManager(), which has some nifty methods for interdimensional travel. I use it in 1.8.0, but it may well be named something different now.

  • Author

Hm, I still can't figure out how I have to do it now in Minecraft 1.9.

 

But after looking deeper into the code I know that the class which will be returned from getConfigurationManager seems to be gone in 1.9, atleast it does no longer exists in the package and in the MinecraftServer class.

 

So any idea?

Developer of Primeval Forest.

So the method #getConfigurationManager still exists, but its return type (class) doesn't? O.o

 

I have neither Eclipse nor a 1.9 workspace on this computer, but if the method exists, its return type must exist. You can use your IDE to search, open call and type hierarchies, or just ctrl-click your way through classes and methods until you get there, but you should be able to find it.

 

The method in particular that I have used was called #transferPlayerToDimension

ServerConfigurationManager

was renamed to

PlayerList

.

 

You can see other name changes in 1.9 by searching here.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

If you are still wondering here's an example I made.

if(!event.getEntityLiving().worldObj.isRemote){
				EntityPlayerMP player = (EntityPlayerMP) event.getEntityLiving();
                if (player.timeUntilPortal > 0) {
                    player.timeUntilPortal = 10;
                } else if (player.dimension != ModConfig.DIMENSION_ID) {
                    player.timeUntilPortal = 10;
                    player.mcServer.getPlayerList().transferPlayerToDimension(player, ModConfig.DIMENSION_ID, new TeleporterCustom(player.mcServer.worldServerForDimension(ModConfig.DIMENSION_ID)));
                } else if (player.dimension == ModConfig.DIMENSION_ID) {
                    player.timeUntilPortal = 10;
                    player.mcServer.getPlayerList().transferPlayerToDimension(player, 0, new TeleporterCustom(player.mcServer.worldServerForDimension(0)));
                }
}

  • Author

Ok, thx. I'll test it out. Oh and anyone who got an idea how to let entities travel through dimensions, like tamed wolves, untamed wolves, Zombies and all of that stuff?

Developer of Primeval Forest.

  • 5 months later...

I have a code to transfere entities. I did not tested .

entityIn.getServer().getPlayerList().tranferEntityToDimension(entityIn, worldIn.provider.getDimensionType().getId(), entityIn.getServer().worldServerForDimension(worldIn.getDimensionType().getId(), entityIn.getServer().worldServerForDimension(The dimension Id), new The teleporter(entityIn.getServer().worldServerForDimension(The dimension Id))))

I have a code to transfere entities. I did not tested .

entityIn.getServer().getPlayerList().tranferEntityToDimension(entityIn, worldIn.provider.getDimensionType().getId(), entityIn.getServer().worldServerForDimension(worldIn.getDimensionType().getId(), entityIn.getServer().worldServerForDimension(The dimension Id), new The teleporter(entityIn.getServer().worldServerForDimension(The dimension Id))))

Good for you, it's just that this thread is over 6 months old, and there's no need to reply to that.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Guest
This topic is now closed to further replies.

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.