Class endstone::EnchantmentOffer¶
ClassList > endstone > EnchantmentOffer
Represents an offer made by an enchanting table. More...
#include <endstone/enchantments/enchantment_offer.h>
Public Types¶
| Type | Name |
|---|---|
| typedef std::unordered_map< const Enchantment *, int > | Enchantments |
Public Functions¶
| Type | Name |
|---|---|
| EnchantmentOffer (Enchantments enchants, int cost) Creates an enchanting offer. |
|
| int | getCost () const Gets the minimum player level required to select this offer. |
| const Enchantments & | getEnchants () const Gets the enchantments applied by this offer. |
| void | setCost (int cost) Sets the minimum player level required to select this offer. |
| void | setEnchants (Enchantments enchants) Sets the enchantments applied by this offer. |
Detailed Description¶
Bedrock stores every enchantment that selecting an offer applies rather than a single hinted enchantment. Enchantments in an offer must be entries obtained from Endstone's Enchantment registry.
Public Types Documentation¶
typedef Enchantments¶
Public Functions Documentation¶
function EnchantmentOffer¶
Creates an enchanting offer.
Parameters:
enchantsthe enchantments and levels applied by the offercostthe minimum player level required to select the offer, between 1 and 255
function getCost¶
Gets the minimum player level required to select this offer.
Returns:
the minimum required player level
function getEnchants¶
Gets the enchantments applied by this offer.
Returns:
the enchantments and their levels
function setCost¶
Sets the minimum player level required to select this offer.
Parameters:
costthe minimum required player level, between 1 and 255
function setEnchants¶
Sets the enchantments applied by this offer.
Parameters:
enchantsthe enchantments and their levels
The documentation for this class was generated from the following file include/endstone/enchantments/enchantment_offer.h