"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):
"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):
Is there a way to detect if a player doesnt move, with the stat.walkOneCm or stat.sprintOneCm?
Subscribe on YT! Im awesome!
"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.
Objective to hold walking distance.Clock Commands:
The following must be run on a clock in numerical order.
1. If the player has walked, their "IDLETIME" is set back to 0.
2. Then their "WALKED" score is set back to 0 to allow future detection.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):
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
Thanks a million!
Subscribe on YT! Im awesome!
I know I am a year late, But for others who are looking, you could make it say:
/say @a[score_IDLETIME=100,score_IDLETIME_min=100]
This makes it say it only once.