Enchantment

Class that represents an enchantment and its level.

Constructors

this
this(sel.data.enchantment.Enchantment enchantment, ubyte level)
Undocumented in source.
this
this(sel.data.enchantment.Enchantment enchantment, string level)
Undocumented in source.

Alias This

enchantment

Members

Functions

opEquals
bool opEquals(Object o)
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

id
ubyte id [@property getter]

Gets the enchantment's id. SEL currently uses Minecraft's id to uniquely identify an enchantment.

Static functions

fromBedrock
Enchantment fromBedrock(ubyte id, ubyte level)

Creates an enchantment using its Minecraft's id.

fromJava
Enchantment fromJava(ubyte id, ubyte level)

Creates an enchantment using its Minecraft: Java Edition's id.

fromString
Enchantment fromString(string name, ubyte level)

Creates an enchantment from a string.

Variables

enchantment
sel.data.enchantment.Enchantment enchantment;
Undocumented in source.
level
ubyte level;
Undocumented in source.

Examples

auto e = new Enchantment(Enchantments.sharpness, "V");
Enchantment.fromString("luck of the sea", 5);
assert(e.bedrock && e.bedrock.id == 9);
assert(e.minecraft.id == 16);
assert(!Enchantment.fromMinecraft(71).pocket);

Meta