Hello. For a map that I am making, I need custom pathfinding for a skeleton. All he has to do is walk in a certain direction, straight. However, the skeleton has to 'want' to walk, instead of get teleported along, kind of how a zombie wants to walk to a villager. I've been experimenting for a while and have not been able to think of anything. Help?
"stat.playOneMinute" can be used alongside those. It will increment on its own, while you can use walkOneCm to set it back to 0 if walkOneCm is higher than a certain value. walkOneCm will also increment when sprinting. Example:
Prerequisites:
Objective to hold playtime, automatically increasing at all times the player is online.
The following must be run on a clock in numerical order.
1. If the player has walked, their "IDLETIME" is set back to 0.
/scoreboard players set @a[score_WALKED_min=1] IDLETIME 0
2. Then their "WALKED" score is set back to 0 to allow future detection.
/scoreboard players set @a[score_WALKED_min=1] WALKED 0
Detection:
The speed at which the player is considered "idle" is dependent on the speed of the clock. A hopper clock will take longer to reset their "IDLETIME" score if the player has walked, so you will need to keep that in mind when determining what value is considered idle.
You'll test for the player's "IDLETIME" score being a value higher than what you consider to be idle. For example, the following says the name of players that have been stationary for 5 seconds (adjust depending on clock):
Hello. For a map that I am making, I need custom pathfinding for a skeleton. All he has to do is walk in a certain direction, straight. However, the skeleton has to 'want' to walk, instead of get teleported along, kind of how a zombie wants to walk to a villager. I've been experimenting for a while and have not been able to think of anything. Help?
Why did you just waste 5 seconds doing that?
change the motion of a skeleton
i don't know a lot about command blocks
sorry i can't help more than that but you can try google it or wait for someone who knows more to explain how
sorry if my English have mistakes it's not my main language
I think you can just rig up something like this. It's optimized for idle players, but you can modify it for your needs.