Skip to content

A Minecraft server extension which can track various statistics about players and other entities.

License

Notifications You must be signed in to change notification settings

GufliMC/BrickStats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BrickStats

A simple Minecraft plugin for tracking stats of various entities (not just players).

Install

Get the release and place it in your server.

API

Gradle

repositories {
    maven { url "https://repo.jorisg.com/snapshots" }
}

dependencies {
    compileOnly 'com.guflimc.brick.stats:api:+'
}

Javadocs

Check the javadocs for all platforms here.

Examples

// read total stats
int total_blocks_placed = StatsAPI.get().read(player.getUniqueId(), Keys.BLOCKS_PLACED);

// get a read-only stats container for any uuid, the values in this container may change
StatsContainer container = StatsAPI.get().readAll(player.getUniqueId());

// get a sub statistic
int grass_blocks_placed = container.read(Keys.BLOCKS_PLACED.of(Material.GRASS_BLOCK));

// write stats, using an updater function is recommended.
StatsKey birds_spotted = new StatsKey("birds_spotted");
StatsAPI.get().update(player.getUniqueId(), birds_spotted, x -> x + 2);

// track stats across teams, any stat write for a player will also be triggered for their team.
StatsAPI.get().registerRelationProvider((playerId) -> TeamsAPI.get().findTeam(playerId).map(Team::id));

// get the amount of blocks everyone in a specific team has placed
int total_team_blocks_placed = StatsAPI.get().read(teamId, Keys.BLOCKS_PLACED);

// get the amount of blocks a specific player has placed while in a specific team
int blocks_placed_while_in_team = StatsAPI.get().read(teamId, Keys.BLOCKS_PLACED, player.getUniqueId());

// relations don't just have to be teams, you can also use them for limited time events, 
// or just anything, each unique id can be a relation.

// stats can be tracked for any id, so they must be unique across players and custom providers.

About

A Minecraft server extension which can track various statistics about players and other entities.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages