Class BagItemEvent.SelectItem.Pre
java.lang.Object
net.minecraftforge.eventbus.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
- Enclosing class:
- BagItemEvent.SelectItem
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.
-
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
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
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
ConstructorDescriptionPre
(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 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
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.
-