Entity rotation and movement

Started by znibsss on

Topic category: Help with modding (Java Edition)

Last seen on 20:30, 11. Dec 2023
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Entity rotation and movement

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.

Last seen on 11:41, 17. May 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How on earth did you get it…
Tue, 11/14/2023 - 16:13

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.

Last seen on 20:30, 11. Dec 2023
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry for me not replying, I…
Sun, 11/19/2023 - 18:17

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?

Last seen on 20:30, 11. Dec 2023
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
BTW I already made him not…
Sun, 11/19/2023 - 18:18

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.

Last seen on 20:30, 11. Dec 2023
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
also he isnt rly spinning he…
Sun, 11/19/2023 - 18:40

also he isnt rly spinning he more is like stuttering

Last seen on 11:41, 17. May 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've never really attempted…
Sun, 11/19/2023 - 18:44

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.

Last seen on 20:30, 11. Dec 2023
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well the problem is that the…
Tue, 11/21/2023 - 20:20

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.