public static class BagItemEvent.SelectItem extends BagItemEvent
This event is fired before the UseBattleItemEvent and should be used to modify item removal if you've
added custom items to the list in the BagItemEvent.CollectItems.Pre event
| Modifier and Type | Class and Description |
|---|---|
static class |
BagItemEvent.SelectItem.Post
This event is fired after the updated item has been taken from their inventory and passed to the battle controller
|
static class |
BagItemEvent.SelectItem.Pre
This is the event fired before the item is given to the battle controller & removed from the inventory
Cancelling this event will create a waiting glitch for the client(s) in the battle so if you are cancelling it
make sure to update the battle controller.
|
BagItemEvent.CollectItems, BagItemEvent.Identifiers, BagItemEvent.SelectItem| Modifier and Type | Field and Description |
|---|---|
protected net.minecraft.item.ItemStack |
foundItem |
protected net.minecraft.item.ItemStack |
selectedItem |
battleController| Constructor and Description |
|---|
SelectItem(BattleController battleController,
java.lang.String identifier,
net.minecraft.entity.player.ServerPlayerEntity player,
net.minecraft.item.ItemStack selectedItem,
net.minecraft.item.ItemStack foundItem) |
| Modifier and Type | Method and Description |
|---|---|
net.minecraft.item.ItemStack |
getFoundItem()
The
ItemStack found by the inventory scan performed. |
net.minecraft.item.ItemStack |
getSelectedItem()
The
ItemStack selected by the player. |
getIdentifier, getPlayer, isIdentifier, isNormalBattlegetBattleControllerprotected final net.minecraft.item.ItemStack selectedItem
protected net.minecraft.item.ItemStack foundItem
public SelectItem(BattleController battleController, java.lang.String identifier, net.minecraft.entity.player.ServerPlayerEntity player, net.minecraft.item.ItemStack selectedItem, net.minecraft.item.ItemStack foundItem)
public net.minecraft.item.ItemStack getSelectedItem()
ItemStack selected by the player. This may not match the found item if a fake item was
selected.ItemStack selected by the player.public net.minecraft.item.ItemStack getFoundItem()
ItemStack found by the inventory scan performed. This may be null if a fake item was selected.
In order for the item use to be successful, this must be set to a non-null value.ItemStack found by the inventory scan.