Class LensUsedEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.LensUsedEvent
public class LensUsedEvent
extends net.minecraftforge.eventbus.api.Event
Event fired when someone uses one of Ras' lens on a Pokémon.
Cancelling this event will prevent the Pokémon from having its information revealed. By default, it will also
prevent the item from being damaged by the use. This can be changed by setting shouldItemBeDamaged
to false.
Created by Waterdude
- Since:
- January 17, 2022
-
Nested Class Summary
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
Modifier and TypeFieldDescriptionfinal RasLensItem
The specificRasLensItem
that the player is using.final PixelmonEntity
ThePixelmonEntity
the lens is being used on.final net.minecraft.server.level.ServerPlayer
The player using the lens.boolean
Whether or not the lens item should be damaged by this interaction, defaulting to true.final net.minecraft.world.item.ItemStack
TheItemStack
representing the lens. -
Constructor Summary
ConstructorDescriptionLensUsedEvent
(net.minecraft.server.level.ServerPlayer player, PixelmonEntity pixelmon, net.minecraft.world.item.ItemStack stack) -
Method Summary
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setPhase, setResult
-
Field Details
-
shouldItemBeDamaged
public boolean shouldItemBeDamagedWhether or not the lens item should be damaged by this interaction, defaulting to true. If this event is cancelled, it will set this value to false. -
player
public final net.minecraft.server.level.ServerPlayer playerThe player using the lens. -
pixelmon
ThePixelmonEntity
the lens is being used on. -
stack
public final net.minecraft.world.item.ItemStack stackTheItemStack
representing the lens. -
lens
The specificRasLensItem
that the player is using. This is easily derived fromstack
and is just for convenience.
-
-
Constructor Details
-
LensUsedEvent
public LensUsedEvent(net.minecraft.server.level.ServerPlayer player, PixelmonEntity pixelmon, net.minecraft.world.item.ItemStack stack)
-
-
Method Details
-
setCanceled
public void setCanceled(boolean cancelled) - Overrides:
setCanceled
in classnet.minecraftforge.eventbus.api.Event
-