net.minestom.server.event.item.ItemUsageCompleteEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minestom-snapshots Show documentation
Show all versions of minestom-snapshots Show documentation
1.20.4 Lightweight Minecraft server
package net.minestom.server.event.item;
import net.minestom.server.entity.Player;
import net.minestom.server.event.trait.ItemEvent;
import net.minestom.server.event.trait.PlayerInstanceEvent;
import net.minestom.server.item.ItemStack;
import org.jetbrains.annotations.NotNull;
/**
* Event when the item usage duration has passed for a player, meaning when the item has completed its usage.
*/
public class ItemUsageCompleteEvent implements PlayerInstanceEvent, ItemEvent {
private final Player player;
private final Player.Hand hand;
private final ItemStack itemStack;
public ItemUsageCompleteEvent(@NotNull Player player, @NotNull Player.Hand hand,
@NotNull ItemStack itemStack) {
this.player = player;
this.hand = hand;
this.itemStack = itemStack;
}
@NotNull
public Player.Hand getHand() {
return hand;
}
@Override
public @NotNull ItemStack getItemStack() {
return itemStack;
}
@Override
public @NotNull Player getPlayer() {
return player;
}
}