use

open override fun use(staffStack: ItemStack, world: World, user: LivingEntity, hand: Hand): TypedActionResult<ItemStack>(source)

Called on both the client and the server by Minecraft when the player uses the staff.

If the staff can be used for multiple ticks, override getMaxUseTime to return a positive number, and call LivingEntity.setCurrentHand on user with hand as the argument.

Return

On the logical client:

On the logical server (if used by player):

Parameters

staffStack

The item stack used to perform the action

world

The world the user is in

user

The player, which uses the staff

hand

The hand of the user, in which the staff is

See also