Enchantment
in package
Uses
NotCloneable, NotSerializable
Manages enchantment type data.
Table of Contents
- $maxLevel : int
- $name : Translatable|string
- $primaryItemFlags : int
- $rarity : int
- $secondaryItemFlags : int
- __clone() : mixed
- __construct() : mixed
- __serialize() : array<string|int, mixed>
- __unserialize() : void
- getMaxLevel() : int
- Returns the maximum level of this enchantment that can be found on an enchantment table.
- getName() : Translatable|string
- Returns a translation key for this enchantment's name.
- getPrimaryItemFlags() : int
- Returns a bitset indicating what item types can have this item applied from an enchanting table.
- getRarity() : int
- Returns an int constant indicating how rare this enchantment type is.
- getSecondaryItemFlags() : int
- Returns a bitset indicating what item types cannot have this item applied from an enchanting table, but can from an anvil.
- hasPrimaryItemType() : bool
- Returns whether this enchantment can apply to the item type from an enchanting table.
- hasSecondaryItemType() : bool
- Returns whether this enchantment can apply to the item type from an anvil, if it is not a primary item.
Properties
$maxLevel
private
int
$maxLevel
$name
private
Translatable|string
$name
$primaryItemFlags
private
int
$primaryItemFlags
$rarity
private
int
$rarity
$secondaryItemFlags
private
int
$secondaryItemFlags
Methods
__clone()
public
final __clone() : mixed
Return values
mixed —__construct()
public
__construct(Translatable|string $name, int $rarity, int $primaryItemFlags, int $secondaryItemFlags, int $maxLevel) : mixed
Parameters
- $name : Translatable|string
- $rarity : int
- $primaryItemFlags : int
- $secondaryItemFlags : int
- $maxLevel : int
Return values
mixed —__serialize()
public
final __serialize() : array<string|int, mixed>
Return values
array<string|int, mixed> —__unserialize()
public
final __unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
Return values
void —getMaxLevel()
Returns the maximum level of this enchantment that can be found on an enchantment table.
public
getMaxLevel() : int
Return values
int —getName()
Returns a translation key for this enchantment's name.
public
getName() : Translatable|string
Return values
Translatable|string —getPrimaryItemFlags()
Returns a bitset indicating what item types can have this item applied from an enchanting table.
public
getPrimaryItemFlags() : int
Return values
int —getRarity()
Returns an int constant indicating how rare this enchantment type is.
public
getRarity() : int
Return values
int —getSecondaryItemFlags()
Returns a bitset indicating what item types cannot have this item applied from an enchanting table, but can from an anvil.
public
getSecondaryItemFlags() : int
Return values
int —hasPrimaryItemType()
Returns whether this enchantment can apply to the item type from an enchanting table.
public
hasPrimaryItemType(int $flag) : bool
Parameters
- $flag : int
Return values
bool —hasSecondaryItemType()
Returns whether this enchantment can apply to the item type from an anvil, if it is not a primary item.
public
hasSecondaryItemType(int $flag) : bool
Parameters
- $flag : int