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.PreNested 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, selectedItemFields 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 TypeMethodDescriptionvoidsetFoundItem(net.minecraft.world.item.ItemStack foundItem) Sets theItemStackfound by the item scan to something else.Methods inherited from class com.pixelmonmod.pixelmon.api.events.battles.BagItemEvent.SelectItem
getFoundItem, getSelectedItemMethods inherited from class com.pixelmonmod.pixelmon.api.events.battles.BagItemEvent
getIdentifier, getPlayer, isIdentifier, isNormalBattleMethods inherited from class com.pixelmonmod.pixelmon.api.events.battles.BattleEvent
getBattleControllerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 theItemStackfound 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- TheItemStackto be considered as found instead.
-