Posted March 8, 201510 yr 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); } } }
March 8, 201510 yr 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.
March 8, 201510 yr 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).
March 8, 201510 yr 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? http://i.imgur.com/NdrFdld.png[/img]
March 8, 201510 yr 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.
March 8, 201510 yr 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
March 8, 201510 yr 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.
March 9, 201510 yr 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.