Jump to content

[1.15.2] Entity spin in custom fluid


Slexom

Recommended Posts

My little muddy pig love mud so much he don't care if I show him a juicy carrot. So, instead of going out of the mud and follow me, he spin on the spot. I've spent last hour reading all the various goal, trying to find some incompatibility, or some pathfinding issue. I've seen there was a similar bug in 1.14.x and 1.15.1, can it be related? Or I simply messed up the entity goals?

The code of the entity is long, here the link to the github repo: https://github.com/Slexom/earth2java/blob/1.2.2/src/main/java/net/slexom/earthtojavamobs/entity/MuddyPigEntity.java

 

Edited by Slexom

My mod:

Earth2Java - Mobs [1.15.2]

 

Link to comment
Share on other sites

Why does the MuddyPigEntity.GoToMudGoal have a higher priority than TemptGoal? Seems like an obvious issue.

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Link to comment
Share on other sites

Changing priority do nothing. I've already did tests on priority.

Also, the GoToMudGoal not execute while inside mud.

 

public boolean shouldExecute() {
            return !this.muddy_pig.isInMud() && super.shouldExecute();
        }

And yes, the isInMud flag work properly or the texture would not change accordingly.

Edited by Slexom

My mod:

Earth2Java - Mobs [1.15.2]

 

Link to comment
Share on other sites

Update.

The pigs spin also when they are not tempted. When tempted they spin if the player is far more than ~3 blocks else they just look. The spin issue is found only when they are in the Mud fluid.
The mud is a normal fluid with some settings about tick rate and density and is tagged as minecraft:water and earthtojavamobs:mud, the MudFlowingFluidBlock extends a FlowingFluidBlock with the only change on lava interaction.

Here the fluid code: FluidInit.java

 

EDIT:

Look like they are unable to swim in the custom fluid...

Edited by Slexom
edit

My mod:

Earth2Java - Mobs [1.15.2]

 

Link to comment
Share on other sites

After some test. 

The entity is unablento swim when is on the source block. Look like it can't find a path to wherever it want to go and start spinning. 

If the block is not a source, so is a flowing fluid, the entity is able to swim and go out of the fluid. 

It can be some bad configuration of the block? But the various parts look fine to me.

My mod:

Earth2Java - Mobs [1.15.2]

 

Link to comment
Share on other sites

More tests.

Any entity inside the fluid SOURCE block have this bug.
Removing the water tag don't trigger this issue, but entity act like if the block is air.

Using a lead is possible to move out of the mud entities if far enough to force pull it.

 

I don't really know where to look or what to do more...

 

My mod:

Earth2Java - Mobs [1.15.2]

 

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.