Lucky Blocks API
The EdToolsLuckyBlocksAPI
provides methods to interact with Lucky Blocks, allowing you to create, identify, and manage them.
Get API Instance
EdToolsLuckyBlocksAPI luckyBlocksAPI = EdToolsAPI.getInstance().getLuckyBlocksAPI();
Methods
getLuckyBlockItem(String id, Player owner)
getLuckyBlockItem(String id, Player owner)
Creates a new Lucky Block item.
id
: The ID of the Lucky Block type as defined in the configuration.owner
: The player who will own this Lucky Block.Returns: An
ItemStack
representing the Lucky Block.
isLuckyBlock(ItemStack item)
isLuckyBlock(ItemStack item)
Checks if a given item is a valid Lucky Block from this plugin.
item
: TheItemStack
to check.Returns:
true
if the item is a Lucky Block,false
otherwise.
isLuckyBlockUnlocked(ItemStack item)
isLuckyBlockUnlocked(ItemStack item)
Checks if a Lucky Block has been "unlocked" (i.e., its rewards can be given).
item
: The Lucky BlockItemStack
.Returns:
true
if it's unlocked,false
if it's still "sealed".
updateLuckyBlock(Player player, ItemStack item)
updateLuckyBlock(Player player, ItemStack item)
Updates the state or lore of a Lucky Block. This is often used after a player has met certain conditions to unlock it.
player
: The player who owns the block.item
: The Lucky BlockItemStack
to update.
Was this helpful?