EnchantmentLevelSetEvent

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.neoforge.api.event.enchantment.EnchantmentLevelSetEvent;

Extends

EnchantmentLevelSetEvent extends Event.

Listening to the event

This event can be listened to like so:

script.zs
events.register<crafttweaker.neoforge.api.event.enchantment.EnchantmentLevelSetEvent>(event => {
println("EnchantmentLevelSetEvent ran!");
});

Members

Getter
script.zs
// EnchantmentLevelSetEvent.enchantLevel as int
event.enchantLevel

Return Type: int

Setter
script.zs
// EnchantmentLevelSetEvent.enchantLevel = (level as int);
event.enchantLevel = myInt;

Parameters:

level Type: int
Getter
script.zs
// EnchantmentLevelSetEvent.enchantRow as int
event.enchantRow

Return Type: int

Getter
script.zs
// EnchantmentLevelSetEvent.item as IItemStack
event.item

Return Type: IItemStack

Getter
script.zs
// EnchantmentLevelSetEvent.level as Level
event.level

Return Type: Level

Getter
script.zs
// EnchantmentLevelSetEvent.originalLevel as int
event.originalLevel

Return Type: int

Getter
script.zs
// EnchantmentLevelSetEvent.pos as BlockPos
event.pos

Return Type: BlockPos

Getter
script.zs
// EnchantmentLevelSetEvent.power as int
event.power

Return Type: int