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

Is there a Player method I could use to force players to spawn at a specific location in a dimension other than the Overworld?  I've tried using the following

 

public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer player,
		EnumFacing side, float hitX, float hitY, float hitZ) {
	if (worldIn.isRemote) {
		return true;
	}
                else {
		player.setSpawnChunk(pos, true, player.worldObj.provider.getDimensionId());
	}
	return true;
}

 

It seems to only work in the Overworld though.

I've had problems with this in the past.  setspawn and get spawn seem to report the same position no matter what world you are in.  Change it in one, and it changes it in another. 

 

Probably something I did wrong and there is another way to get to the goal, but I finally implemented my own teleporter class that looks at a different place for spawnpoints per world and I made it so all teleports use my method instead.

Long time Bukkit & Forge Programmer

Happy to try and help

I think what I typed mislead what I meant.

 

Let me try an example. 

- normal dimensions -1,0,1

- Add other world groups every 5 starting up at 30, so 30,31,32 : 35,36,37, ect.  The first being the overworld.

 

When you get the world object reprsented by say dimension 35 and setspawn, it seems to be the spawn for every dimention.  If I search for getspawn from all the other dimensions (say 0, 30, 40, ect), they all report the spawnpoint just set for 35.

 

That is what I meant by what I said.  If that is the intended impact, so be it, but it seems weird.

 

 

 

Long time Bukkit & Forge Programmer

Happy to try and help

I don't want to drift off his topic.  Only brought this up because it was relevant and I think this will work for him if used right (unlike what i'm doing).

 

I'm going off memory, but I think it is world.getspawn.  In 1.8 it returns a BlockPos.  Also from memory, it goes into its WorldInfo to get the position.  I've looked at a few times and been baffled as to why it doesn't work.  It seems like it should be per dimension, but iterating through the worlds after setting it, seems to impact every dimension at the same time. 

 

I'll post the exact code later in a seperate post and let this one continue for just Mr Tea Cup

 

 

Long time Bukkit & Forge Programmer

Happy to try and help

oh, gotcha.  That matches its behavior

 

Is there a per dimension world-spawnpoint built in?

Long time Bukkit & Forge Programmer

Happy to try and help

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.