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

I need to get a blocks x y and z in the world. How would i go about doing that? (Im used to constructors  and methods giving me these variables)

 

PlayerTickEvent:

 

 

@SubscribeEvent
public void onPlayerTick(TickEvent.PlayerTickEvent event) { //TODO WorldProviderHell
	EntityPlayer player = event.player;
	World world = event.player.worldObj;

	//Kill player if no space suit is worn
	if(!player.capabilities.disableDamage && !player.isPotionActive(Potion.waterBreathing)) {
		if(world.provider.dimensionId == Main.dimensionId) {
			if(player.getEquipmentInSlot(1) != null && player.getEquipmentInSlot(2) != null && player.getEquipmentInSlot(3) != null && player.getEquipmentInSlot(4) != null) {
				if(player.getEquipmentInSlot(4).getItem() == Main.spaceHelmet && player.getEquipmentInSlot(3).getItem() == Main.spaceJacket && player.getEquipmentInSlot(2).getItem() == Main.spacePants && player.getEquipmentInSlot(1).getItem() == Main.spaceBoots || player.getEquipmentInSlot(1).getItem() == Main.heavyMoonBoots) {

				} else player.attackEntityFrom(Main.onMoon, 1.0F);
			} else player.attackEntityFrom(Main.onMoon, 1.0F);
		}
	}

	//Change block forms on moon
	if(world.provider.dimensionId == Main.dimensionId) {
		if(world.getBlock(x, y, z).getMaterial() == Material.water) { //help here
			world.setBlock(x, y, z, Blocks.ice);
		}
	}
}

 

 

player.posX?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

player.posX?

that does work, although it doesnt work well as it is the player's position, not the blocks. So what happens if a player goes next to the water, THEN in turns to ice. What i want is wherever i place water, it turns to ice (thats why i need the blocks pos, not the players).

Assuming from OP's code he tried to turn water into ice on moon by using PlayerEvent. That is wrong way to go.

 

You will need to use some ChunkEvent (Populate?) or World generator. I sadly have little experience as to second one.

1.7.10 is no longer supported by forge, you are on your own.

  • Author

Are you trying to turn ALL water blocks to ice? Or is it one or more specific blocks?

 

If specific, what conditions determine when a water block should freeze?

Yes, all water blocks to ice. I managed to do this in BlockPlaceEvent, but it only works if the water block is placed from a water block, it doesn't work if its placed with a bucket which is why I'm trying to find an alternate way

Then you want the bucket events.

 

I should note that ice is trivial to turn back into flowing water.

 

*Pops a torch down*

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

Then you want the bucket events.

 

I should note that ice is trivial to turn back into flowing water.

 

*Pops a torch down*

Thanks dude. Torches will burn out on the moon ;)

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.