use

open fun use(staffStack: ItemStack, world: World, user: PlayerEntity, 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 maxUseTime to return a positive number, and call PlayerEntity.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