Interface PlayerClass
Player classes define starting equipment and passive abilities that players can select before or during a game. Each class provides a unique playstyle with different kit items and special abilities.
Example Usage
ClassService classService = ZentrixProvider.get().getClassService();
// Get a specific class
Optional<PlayerClass> warrior = classService.getClass("warrior");
warrior.ifPresent(pc -> {
String name = pc.getDisplayName();
String desc = pc.getDescription();
Material icon = pc.getIconMaterial();
player.sendMessage("Class: " + name);
player.sendMessage("Description: " + desc);
});
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescription@NotNull StringGets a description of the class's passive ability.@Nullable StringGets the ability type for this class.@NotNull StringGets the description of this class.@NotNull StringGets the display name of this class.@NotNull org.bukkit.inventory.ItemStackGets a clone of the icon ItemStack used in GUIs.@NotNull org.bukkit.MaterialGets the icon material for this class.default intGets the number of items in this class's kit.@NotNull List<org.bukkit.inventory.ItemStack> Gets clones of the kit items provided by this class.getLore()Gets the lore lines displayed in the class selection GUI.@NotNull StringgetType()Gets the unique type identifier for this class.booleanChecks if this class has a passive ability.default booleanChecks if this class has any kit items.default booleanhasLore()Checks if this class has lore configured.
-
Method Details
-
getType
Gets the unique type identifier for this class.This is the internal name used to identify the class (e.g., "WARRIOR", "ARCHER", "MINER").
- Returns:
- The class type identifier (never null)
-
getDisplayName
Gets the display name of this class.This is the formatted name shown in GUIs and messages, including color codes.
- Returns:
- The display name (never null)
-
getDescription
Gets the description of this class.A brief explanation of what this class does and its playstyle.
- Returns:
- The description (never null)
-
getIconMaterial
@NotNull @NotNull org.bukkit.Material getIconMaterial()Gets the icon material for this class.This material is used to represent the class in selection GUIs.
- Returns:
- The icon material (never null)
-
getIconItem
@NotNull @NotNull org.bukkit.inventory.ItemStack getIconItem()Gets a clone of the icon ItemStack used in GUIs.This may be a custom item with special display properties. Returns a clone to prevent modification of the original.
- Returns:
- A clone of the icon ItemStack (never null)
-
getLore
Gets the lore lines displayed in the class selection GUI.These lines provide additional information about the class, such as ability details and kit contents.
- Returns:
- An unmodifiable list of lore lines (never null, may be empty)
-
getKitItems
Gets clones of the kit items provided by this class.These items are given to the player when the game starts if they have this class selected. Returns clones to prevent modification of the original items.
- Returns:
- An unmodifiable list of kit item clones (never null, may be empty)
-
getKitItemCount
default int getKitItemCount()Gets the number of items in this class's kit.- Returns:
- The kit item count
-
hasAbility
boolean hasAbility()Checks if this class has a passive ability.- Returns:
trueif an ability is configured
-
getAbilityType
Gets the ability type for this class.Returns null if the class has no ability configured.
- Returns:
- The ability type, or null if none
-
getAbilityDescription
Gets a description of the class's passive ability.Returns an empty string if no ability is configured.
- Returns:
- The ability description (never null)
-
hasKitItems
default boolean hasKitItems()Checks if this class has any kit items.- Returns:
trueif the class provides kit items
-
hasLore
default boolean hasLore()Checks if this class has lore configured.- Returns:
trueif lore lines are configured
-