Started by
znibsss
on
Topic category: Help with Minecraft modding (Java Edition)
Hey, my entity "scaffolds" or "godbridges" with dirt, but every 3 blocks or so he start spinning on himself, how can I prevent that? Btw my entity targets the player.
How on earth did you get it to do this in the first place??? I'm genuinely curious!
The problem you're likely having is that minecraft pathfinding is stupid, and breaks easily if there's isn't any location to go to. (Once it's three blocks up, the pathfinding will no longer allow it to drop down, and there's thus no location for it to pathfind to.) You might have to use a motion override function to force it to jump down or stop spinning.
Sorry for me not replying, I wasn't home atm. So anyways, minecraft know where to put it but once it places a block I think it just like doesn't know where to make him go for a brief moment so thats why it is spinning. But how do I make it so the motion ovverride will make him look the right way and be smooth?
BTW I already made him not godbridge/scaffold if he is above the player since I couldn't get it to stop if he gets near the player, it just didn't work.
also he isnt rly spinning he more is like stuttering
I've never really attempted anything involving mobs placing blocks, so I'm not 100% sure on the specific issue you're having; though it probably has something to do with the pathfinding conflicting with the entity's block placing behavior.
You could try using the 'make entity navigate to' block which will override the entity's current pathfinding to your desired location, and might help with the issue if you just reset it by having it go to its current position. The motion override function literally just adds velocity to an entity, making it more of a brute force solution, but also a possibility.
Well the problem is that the entity doesn't place blocks, I just made it that on entity tick update it basically set the block under him to a certain block with other conditions so it is well made. I want to make it so when it can place blocks under him, the pathfinding AI just sets all the blocks under him like they were solid since when he will walk he will place the blocks. And when the condition is not fulfilled and that it will not place blocks it will have it normal pathfinding AI.