Interface EnchantSetupInterface

Object returned by CustomEnchant.newEnchant method. Used to configure different custom enchantment behaviors.

interface EnchantSetupInterface {
    id: number;
    setAttackDamageBonusProvider(func: AttackDamageBonusProvider): EnchantSetupInterface;
    setFrequency(freq: number): EnchantSetupInterface;
    setIsDiscoverable(discoverable: boolean): EnchantSetupInterface;
    setIsLootable(lootable: boolean): EnchantSetupInterface;
    setIsTreasure(treasure: boolean): EnchantSetupInterface;
    setMask(mask: number): EnchantSetupInterface;
    setMinMaxCost(bMin: number, cMin: number, bMax: number, cMax: number): EnchantSetupInterface;
    setMinMaxLevel(min: number, max: number): EnchantSetupInterface;
    setPostAttackCallback(func: DamageCallback): EnchantSetupInterface;
    setPostHurtCallback(func: DamageCallback): EnchantSetupInterface;
    setProtectionBonusProvider(func: ProtectionBonusProvider): EnchantSetupInterface;
}

Methods

  • Sets the mask of items, that the following enchantment can be applied to, paired parameter for item is enchant slot.

    Parameters

    • mask: number

    Returns EnchantSetupInterface

    Reference to itself to be used in sequential calls.

    -1 = 0xFFFFFFFF // all
    
  • Sets minimum and maximum level, that the following enchantment will be able to have in legal conditions.

    Parameters

    • min: number
    • max: number

    Returns EnchantSetupInterface

    Reference to itself to be used in sequential calls.

    min: 1, max: 5
    

Properties

id: number

The numeric ID of the following enchantment to be used in different operations. This ID will not change after the first generation, same as it works with blocks' and items' IDs.

Copyright © 2024 Nernar. Copyright © 2020 #mineprogramming. Built with ❤ and TypeDoc.