Jump to content

[1.18.1] Entity Pushed by Custom Fluid


NovaMachina

Recommended Posts

I have created a custom fluid and would like to adjust the rate at which it pushes entities around. I understand that the movement is dictated by tags now and have created a tag for my custom fluid. I noticed that Entity contains updateFluidHeightAndDoFluidPushing which takes a fluid tag and a motion scale. I assumed that when I call this method in an overridden LiquidBlock#entityInside method, that the entity would be pushed accordingly. However, this does not seem to be the case. What am I missing?

Block Class

Spoiler
public class OilBlock extends LiquidBlock {
    public OilBlock(Supplier<? extends FlowingFluid> supplier, Properties properties) {
        super(supplier, properties);
    }

    @Override
    public void entityInside(BlockState pState, Level pLevel, BlockPos pPos, Entity pEntity) {
        if(pLevel.isClientSide || !pEntity.isAlive()) {
            return;
        }
        pEntity.updateFluidHeightAndDoFluidPushing(GalacticResourcesFluidTags.OIL, 0.2D);
    }
}

 

 

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.