Düzenle

Potions Class

Used for accessing all potion effect types, delivery types, and creating potions.

Methods

getAllDeliveryTypes

static getAllDeliveryTypes(): PotionDeliveryType[]

Retrieves handles for all registered potion delivery types.

Returns PotionDeliveryType[] - Array of all registered delivery type handles.

getAllEffectTypes

static getAllEffectTypes(): PotionEffectType[]

Retrieves all type handle for all registered potion effects.

Returns PotionEffectType[] - Array of all registered effect type handles.

getDeliveryType

static getDeliveryType(potionDeliveryId: string): PotionDeliveryType | undefined

Retrieves a type handle for a specified potion delivery id.

Parameters

  • potionDeliveryId: string

Returns PotionDeliveryType | undefined - A type handle wrapping the valid delivery id, or undefined for an invalid delivery id.

getEffectType

static getEffectType(potionEffectId: string): PotionEffectType | undefined

Retrieves a type handle for a specified potion effect id.

Parameters

  • potionEffectId: string

    A valid potion effect id. See @minecraft/vanilla-data.MinecraftPotionEffectTypes

Returns PotionEffectType | undefined - A type handle wrapping the valid effect id, or undefined for an invalid effect id.

resolve

static resolve(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack

Creates a potion given an effect and delivery type.

Parameters

  • potionEffectType: PotionEffectType | T
  • potionDeliveryType: PotionDeliveryType | U

Returns ItemStack

Notes: