2020-05-07 15:46:21 +02:00
|
|
|
package net.minestom.server.event.player;
|
2019-08-21 16:50:52 +02:00
|
|
|
|
2020-04-24 03:25:58 +02:00
|
|
|
import net.minestom.server.entity.Player;
|
2020-05-07 15:46:21 +02:00
|
|
|
import net.minestom.server.event.CancellableEvent;
|
2020-04-24 03:25:58 +02:00
|
|
|
import net.minestom.server.item.ItemStack;
|
2019-08-21 16:50:52 +02:00
|
|
|
|
2020-05-03 22:44:38 +02:00
|
|
|
/**
|
|
|
|
* Event when an item is used without clicking a block
|
|
|
|
*/
|
2020-04-18 15:35:37 +02:00
|
|
|
public class PlayerUseItemEvent extends CancellableEvent {
|
2019-08-21 16:50:52 +02:00
|
|
|
|
|
|
|
private Player.Hand hand;
|
|
|
|
private ItemStack itemStack;
|
|
|
|
|
2019-08-25 20:03:43 +02:00
|
|
|
public PlayerUseItemEvent(Player.Hand hand, ItemStack itemStack) {
|
2019-08-21 16:50:52 +02:00
|
|
|
this.hand = hand;
|
|
|
|
this.itemStack = itemStack;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Player.Hand getHand() {
|
|
|
|
return hand;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ItemStack getItemStack() {
|
|
|
|
return itemStack;
|
|
|
|
}
|
|
|
|
}
|