Class BagItemEvent.SelectItem.Pre
java.lang.Object
net.neoforged.bus.api.Event
com.pixelmonmod.pixelmon.api.events.battles.BattleEvent
com.pixelmonmod.pixelmon.api.events.battles.BagItemEvent
com.pixelmonmod.pixelmon.api.events.battles.BagItemEvent.SelectItem
com.pixelmonmod.pixelmon.api.events.battles.BagItemEvent.SelectItem.Pre
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
- Enclosing class:
BagItemEvent.SelectItem
public static class BagItemEvent.SelectItem.Pre
extends BagItemEvent.SelectItem
implements net.neoforged.bus.api.ICancellableEvent
This is the event fired before the item is given to the battle controller invalid input: '&' 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.events.battles.BagItemEvent.SelectItem
BagItemEvent.SelectItem.Post, BagItemEvent.SelectItem.Pre
Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.events.battles.BagItemEvent
BagItemEvent.CollectItems, BagItemEvent.Identifiers, BagItemEvent.SelectItem
-
Field Summary
Fields inherited from class com.pixelmonmod.pixelmon.api.events.battles.BagItemEvent.SelectItem
foundItem, selectedItem
Fields inherited from class com.pixelmonmod.pixelmon.api.events.battles.BattleEvent
battleController
-
Constructor Summary
ConstructorsConstructorDescriptionPre
(BattleController battleController, String identifier, net.minecraft.server.level.ServerPlayer player, net.minecraft.world.item.ItemStack selectedItem, net.minecraft.world.item.ItemStack foundItem) -
Method Summary
Modifier and TypeMethodDescriptionvoid
setFoundItem
(net.minecraft.world.item.ItemStack foundItem) Sets theItemStack
found by the item scan to something else.Methods inherited from class com.pixelmonmod.pixelmon.api.events.battles.BagItemEvent.SelectItem
getFoundItem, getSelectedItem
Methods inherited from class com.pixelmonmod.pixelmon.api.events.battles.BagItemEvent
getIdentifier, getPlayer, isIdentifier, isNormalBattle
Methods inherited from class com.pixelmonmod.pixelmon.api.events.battles.BattleEvent
getBattleController
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Constructor Details
-
Pre
public Pre(BattleController battleController, String identifier, net.minecraft.server.level.ServerPlayer player, net.minecraft.world.item.ItemStack selectedItem, net.minecraft.world.item.ItemStack foundItem)
-
-
Method Details
-
setFoundItem
public void setFoundItem(net.minecraft.world.item.ItemStack foundItem) Sets theItemStack
found by the item scan to something else. If a fake item was selected, then this must be set to a non-null value in order for the fake item to function.- Parameters:
foundItem
- TheItemStack
to be considered as found instead.
-