Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add Statistic support #4687

Open
1 task done
kossnikita opened this issue Mar 22, 2022 · 7 comments
Open
1 task done

Add Statistic support #4687

kossnikita opened this issue Mar 22, 2022 · 7 comments
Assignees
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).

Comments

@kossnikita
Copy link

kossnikita commented Mar 22, 2022

Suggestion

The API has a class org.bukkit.Statistic which is currently not used in the Skript. Except for one expression
new ExprTimePlayed #2522
This expression can be replaced with ExprStatistic for offline players and adding a new Statistic Skript type.

Why?

Some of the statistics may be useful for conditions. For example, the number of deaths or the time since the last sleep.

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this suggestion.
@AyhamAl-Ali AyhamAl-Ali added priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements). feature Pull request adding a new feature. enhancement Feature request, an issue about something that could be improved, or a PR improving something. and removed feature Pull request adding a new feature. labels Mar 22, 2022
@Pikachu920
Copy link
Member

while statistics would be useful, I don't think removing the time played expression is necessary

@kossnikita
Copy link
Author

kossnikita commented Mar 22, 2022

This is not necessary because the syntax %offlineplayer%'s %statistic% completely replaces %offlineplayer%'s time played. Because time played is statistic.

@AyhamAl-Ali
Copy link
Member

Removing a pretty much used expression is to be avoided unless for a very good/important reason which this isn't of type

@kossnikita
Copy link
Author

But if this does not affect the work of existing scripts, then what could be wrong?
The syntax will not change in any way, as will the functionality (get and set statistics)

@Pikachu920
Copy link
Member

a couple reasons -

  1. The existing expression returns a timespan and not and int
  2. the syntax %player%'s %statistic% probably isn't viable. imagine some of the weird syntaxes that could allow (e.g. player's jump, player's drop or player's dispenser inspected

@kossnikita
Copy link
Author

Initially, I assumed that all time related statistics would be timespans. This requires additional processing.
player's number of jumps or player's number of stone drop for these examples.
Okay, I see that there can be problems with this. Although so far it seems to me that everything can be solved.
Are you suggesting that instead of adding a single expression for the statistics, add multiple expressions for each of the statistics?

@AyhamAl-Ali
Copy link
Member

There will be one expression and it will look something like this statistic [value[s]] %strings/statistics% of %offlineplayers%
Chossing the %strings/statistics% part will decide whether we should make it be as a string or add statistics enum values as literals which I don't think is needed since it may be misleading, so string would be fair and enough

@AyhamAl-Ali AyhamAl-Ali self-assigned this Mar 24, 2022
@AyhamAl-Ali AyhamAl-Ali added the PR available Issues which have a yet-to-be merged PR resolving it label Mar 25, 2022
@sovdeeth sovdeeth removed the PR available Issues which have a yet-to-be merged PR resolving it label Dec 18, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).
Projects
None yet
Development

No branches or pull requests

4 participants