Jump to content

Liquid placed from buckets isnt working in BlockPlace event


Manslaughter777

Recommended Posts

I want to make it so when liquid is placed in my dimension they "freeze". This works fine when i place water from its block, but when i place it from a bucket it does not work...

 

The PlaceBlock event class:

 

 

@SubscribeEvent
public void onBlockPlace(BlockEvent.PlaceEvent event) { 
	EntityPlayer player = event.player;
	World world = event.world;

	Block block = event.block;
	Block placedBlock = event.placedBlock;

	ItemStack heldItem = event.itemInHand;

	int x = event.x;
	int y = event.y;
	int z = event.z;

	if(world.provider.dimensionId == Main.dimensionId) {

		if(block.getMaterial() == Material.water) {
			world.setBlock(x, y, z, Blocks.ice);

		} else if(placedBlock.getMaterial() == Material.lava) {
			world.setBlock(x, y, z, Blocks.obsidian);
		}
	}
}

 

 

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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