Jump to content

Recommended Posts

Posted

I have made a custom fluid (whose Material is Material.water -- more about that later).  And placed blocks of it into the world to test what happens when the player is inside it.  Just sitting there, the player doesn't drown (as I would expect from reading the EntityLivingBase.onEntityUpdate() method).  When I swim upward, there is a point (and it is very short-lived) where the breath meter shows up, but it goes away quickly.

 

My question is two-fold.  First, what else would I need to do to get people to drown in my fluid?  Second, is there not some hook to allow customizing an entity's behavior in a custom fluid?  I want entities (well most of them) to drown in my fluid, but not be able to swim in it, or see the little blue bubbles.

 

Here is my Fluid and Block code:

 

 

public class MyFluid extends Fluid {
public MyFluid(String fluidName) {
	super(fluidName);

	this.isGaseous = true;
}	
}

public class MyBlock extends BlockFluidBase {
public MyBlockextends (int id, Fluid fluid) {
	super(id, fluid, Material.water);
	this.setCreativeTab(myTab);
}
@Override
public boolean isAirBlock(World world, int x, int y, int z) {
	if (world.getBlockId(x, y, z)==this.blockID) 
		return true;
	return super.isAirBlock(world, x, y, z);
}
}

 

 

The best protection for all you meat-related data.

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.