Railcraft

Railcraft

34M Downloads

Investigate Entity AI of Minecart Riding Entities for Issues

CovertJaguar opened this issue ยท 16 comments

commented

As demonstrated in the following video, apparently non-player entities riding minecarts can now move the minecart randomly while doing so. They can do this even against the pull of a Locomotive.

https://www.youtube.com/watch?v=qiFSU6qnrag

commented

Well first attempt is only partially successful. I disabled the AI tasks when riding, which works, pigs don't follow carrots anymore. However it doesn't seem to have stopped random wandering and running when hurt.

commented

I don't actually know which code has authority over ridden entity control translation. Kind of hard to fix without knowing that.

commented

damn should have reimplemented the pigs following carrots... i could have amde a nice minigame :P

commented

I think you should work on minecart instead of entity ai code.

commented

Nothing I can do unless I can find what is modifying the motion vector.

commented

Isn't this fixed?

commented

Not completely. Random wandering still causes carts to move.

commented

The code is in EntityMinecart#update block, which we have little control over. Thus, we cannot really fix this.

commented

@CovertJaguar So what do we do on this?

commented

Nothing, unless you want to dig into the entity movement code.

commented

By the way MinecraftForge/MinecraftForge#4665 may fix this issue once accepted.

commented

Now by overriding a method, I think I managed to fix this issue. Will push soon

commented

It is fixed; a pig can no longer pull a creative locomotive.

commented

I assume that fully Railcraft objects give one more control, so what about a "cage-cart" that disables riding NPCs' AI/movement?

Or if disabling AI/movement is not actually a thing, would it work to have a "cage-cart" that stores the entity, ala MFR safari-net, and then renders said stored entity to appear inside the cage?

commented

At worst, I'm pretty sure that you can add an AI task that prevents movement tasks from executing.

commented

@purpleposeidon yes, that's pretty simple actually