Skip to content

Statistics#8694

Open
AnOwlBe wants to merge 41 commits into
SkriptLang:dev/featurefrom
AnOwlBe:Statistics
Open

Statistics#8694
AnOwlBe wants to merge 41 commits into
SkriptLang:dev/featurefrom
AnOwlBe:Statistics

Conversation

@AnOwlBe

@AnOwlBe AnOwlBe commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Problem

Notch added statistics in 2011 and Bukkit added them to their API at some point later on.

Nowdays they are a very useful utility for getting how many times a player e.g. broke sand or killed another player etc without having to deal with tracking that information yourself.

Solution

Added ExprStatistic usage example:
send player kills statistic of me
send mine block stat using tnt (itemtype) of me
send me's deaths statistic
add 52 to player kills stat of me
remove 2490 from player kills stat of me
set player kills stat of me to 5

Added an EvtPlayerStatisticChange called when the server updates the statistic of a player (from my testing it is not called if you modify the statistic of a player only when the server does it eg when you jump etc)

Added an EnumClassInfo for statistics.

Testing Completed

Manual testing done everything appears to work fine

Supporting Information

Continued version of #7568 with a decent chunk of changes


Completes: #4687
Related: #7568 #4704 #1246
AI assistance: Some for finding root of some problems

@AnOwlBe
AnOwlBe requested a review from a team as a code owner June 9, 2026 02:26
@AnOwlBe
AnOwlBe requested review from TheMug06 and erenkarakal and removed request for a team June 9, 2026 02:26
@skriptlang-automation skriptlang-automation Bot added needs reviews A PR that needs additional reviews needs triage An issue that hasn't been classified or verified yet labels Jun 9, 2026
@skriptlang-automation

This comment has been minimized.

@erenkarakal erenkarakal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just some nitpicks, the code itself seems fine

@skriptlang-automation skriptlang-automation Bot added the feature Pull request adding a new feature. label Jun 9, 2026
@github-project-automation github-project-automation Bot moved this to In Review in 2.16 Releases Jun 9, 2026
@skriptlang-automation skriptlang-automation Bot removed the needs triage An issue that hasn't been classified or verified yet label Jun 9, 2026
@AnOwlBe
AnOwlBe requested a review from erenkarakal June 9, 2026 07:04

@ShaneBeee ShaneBeee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some small nitpicks, looks good otherwise.

Co-authored-by: Shane Bee <shanebolenback@me.com>
@AnOwlBe
AnOwlBe requested a review from ShaneBeee June 9, 2026 18:34
@AnOwlBe

AnOwlBe commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author
image I just followed what was said in burb's statistic pr the methods were private yet it was still suggested javadocs for the methods image

@Absolutionism Absolutionism left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add a test file to ensure getting and all changers work for ExprStatistic
as well as for each possible runtime error

Comment on lines +3 to +6
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's going on with these gradle changes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsure I made the branch like 3d ago then worked on it then pushed it then made the pr and its just showing that these were added last month

@skriptlang-automation skriptlang-automation Bot removed the needs reviews A PR that needs additional reviews label Jun 9, 2026
@AnOwlBe

AnOwlBe commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

oh lol forgot to put a commit message

eh should be fine

@AnOwlBe
AnOwlBe requested a review from ShaneBeee June 14, 2026 23:20
Comment thread src/main/resources/lang/default.lang
Comment thread src/main/java/org/skriptlang/skript/bukkit/entity/player/PlayerModule.java Outdated
@AnOwlBe
AnOwlBe requested a review from APickledWalrus June 30, 2026 22:30
Comment thread src/main/resources/lang/default.lang Outdated
Comment thread src/main/resources/lang/default.lang Outdated
Comment thread src/main/java/org/skriptlang/skript/bukkit/entity/player/PlayerModule.java Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Pull request adding a new feature.

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

6 participants