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

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.