createItem

abstract fun createItem(@KeyPattern.Value itemId: String, amount: Int, player: Player?, payload: String?): ItemStack?(source)

Creates a new stack of the item with itemId. The caller owns the returned stack, so never return a shared one.

Return

the stack, or null if the ID is unknown or the payload is invalid.

Parameters

amount

Amount of items, at least 1. If it is greater than the maximum stack size, Mimic lowers the amount of the returned stack.

player

The player the item is created for, or null if there is no such player. Use it if the item depends on the player, like items scaled to the player's level.

payload

Additional configuration of the item in the format of this provider, or null. It is never blank. If the provider takes no payload, ignore it. If the payload can't be parsed, return null: Mimic logs a warning with the item ID and the payload.