Statistics Task
TinkerWorX opened this issue ยท 3 comments
A task that allows you to track a statistic and then use it for a quest, similar to scoreboard. Examples would be tracking how far a player has walked, how many times they've jumped and more. Should be useful some special quests, like challenging people to complete something in less than 1km walked or jump 1000 times.
Currently it can be done though commands and scoreboard tracking, but that isn't very flexible if you want to allow people to start new worlds. You'd have to have an initializer quest.
To do what you're asking I'd need to make an entirely new relative statistics tracking system on top of the existing one in Minecraft. Sorry but you're just going to have to work with the built in vanilla ones in scoreboads.
PS: Scoreboard tasks can initialise themselves without the need to run a command
Can you explain a bit? All statistics are stored in world name/stats/uuid.json
, and as far as I can tell, it should be relatively straight forward to read the different values periodically/when triggered.
Can you give a link to what you mean? Everything I've found about scoreboards require them to be setup using commands in a world.
It's not where/how the statistics are stored that's the problem. The problem lies in the fact that statistics can't easily be reset meaning once a value is recorded that's it (unless you delete the whole scoreboard and everyone else's data with it). If you wanted a task that say requires someone to get from point A to point B in N steps then you'd have to calculate from what the value of the statistic was when you arrived at A and calculate the relative distance from there. Defining triggers on when to start/stop recording relative data is another abstraction layer of subtasks in the quest which would not be easy to setup by any person.
TLDR: Statistics can't be edited/reset without destroying the scoreboard and everyone's data. Even if you could, sub-tasks to define when to start/stop recording is not feasible.
As for scoreboard setup, what information you'd normally use in the command to setup a new scoreboard can be found in the Scoreboard Task properties. As soon as the task is active, it will instantiate a new scoreboard with those properties if one doesn't already exist. There is no need to setup the scoreboard in advance unless you're visually doing something with it before the task activates.