Class PercentGiftItem

A Percent-Driven random reward gift.

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

  • Parameters

    • typeId: string

      Identifier of the type of items for the stack. If a namespace is not specified, 'minecraft:' is assumed.

    • chance: number

      The probability of give reward when use the gift, should be a percentage (0~1).

    • reward: RewardType

      Rewards of the gift.

    Returns PercentGiftItem

Properties

chance: number

The probability of give reward when use the gift, should be a percentage (0~1).

reward: RewardType

Rewards of the gift.

typeId: string

Identifier of the type of items for the stack. If a namespace is not specified, 'minecraft:' is assumed.

Methods

  • Give reward to a player.

    Parameters

    • player: Player

    Returns void

  • Registry the gift.

    Returns void

    Use Register.giftRegistry() to registry the gift.