Bentobox: Getting island level?

Created on 26 Aug 2018  路  2Comments  路  Source: BentoBoxWorld/BentoBox

How can i get player's island level from Level addon API?

Question

Most helpful comment

This has not been documented yet, but you can try to do the following :

UUID uuid = null; // Replace null with the UUID of the player you want to get the island level.
World world = null; // Replace null with the world of the gamemode you want to get the island level from. I did not work on this part of the API, so I don't know how that #get would work.
long level;
BentoBox.getInstance().getAddonsManager().getAddonByName("Level").ifPresent(addon -> {
    Level levelAddon = (Level) addon;
    level = levelAddon.getIslandLevel(world, UUID);
}

All 2 comments

This has not been documented yet, but you can try to do the following :

UUID uuid = null; // Replace null with the UUID of the player you want to get the island level.
World world = null; // Replace null with the world of the gamemode you want to get the island level from. I did not work on this part of the API, so I don't know how that #get would work.
long level;
BentoBox.getInstance().getAddonsManager().getAddonByName("Level").ifPresent(addon -> {
    Level levelAddon = (Level) addon;
    level = levelAddon.getIslandLevel(world, UUID);
}

Thanks solved the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Klaerke91 picture Klaerke91  路  6Comments

wellnesscookie picture wellnesscookie  路  6Comments

wellnesscookie picture wellnesscookie  路  5Comments

Bobbbe picture Bobbbe  路  5Comments

voodootje0 picture voodootje0  路  6Comments