Class GatherSkippedAttributeTooltipsEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.GatherSkippedAttributeTooltipsEvent
public class GatherSkippedAttributeTooltipsEvent
extends net.neoforged.bus.api.Event
This event is used to collect the IDs of attribute modifiers that will not be displayed in item tooltips.
It allows hiding some (or all) of the modifiers, potentially for displaying them in an alternative way (or for hiding information from the player).
This event may be fired on both the logical client and logical server.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AttributeTooltipContext
private boolean
private @Nullable Set
<EquipmentSlotGroup> private @Nullable Set
<ResourceLocation> protected final ItemStack
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionThe current tooltip context.protected Set
<EquipmentSlotGroup> InitializesskippedGroups
if necessary, and returns it.protected Set
<ResourceLocation> InitializesskippedIds
if necessary, and returns it.getStack()
TheItemStack
with the tooltip.boolean
Checks if a given id is skipped or not.boolean
isSkipped
(EquipmentSlotGroup group) Checks if a given group is skipped or not.boolean
Checks if the event will cause all attribute modifiers to be skipped.void
setSkipAll
(boolean skip) Sets if the event should skip displaying all attribute modifiers.void
skipGroup
(EquipmentSlotGroup group) Marks an entireEquipmentSlotGroup
as skipped, preventing all modifiers for that group from showing.void
Marks the id of a specific attribute modifier as skipped, causing it to not be displayed in the tooltip.
-
Field Details
-
stack
-
ctx
-
skippedIds
-
skippedGroups
-
skipAll
private boolean skipAll
-
-
Constructor Details
-
GatherSkippedAttributeTooltipsEvent
-
-
Method Details
-
getContext
The current tooltip context. -
getStack
TheItemStack
with the tooltip. -
skipId
Marks the id of a specific attribute modifier as skipped, causing it to not be displayed in the tooltip. -
skipGroup
Marks an entireEquipmentSlotGroup
as skipped, preventing all modifiers for that group from showing. -
isSkipped
Checks if a given id is skipped or not. If all modifiers are skipped, this method always returns true. -
isSkipped
Checks if a given group is skipped or not. If all modifiers are skipped, this method always returns true. -
setSkipAll
public void setSkipAll(boolean skip) Sets if the event should skip displaying all attribute modifiers. -
isSkippingAll
public boolean isSkippingAll()Checks if the event will cause all attribute modifiers to be skipped. -
getSkippedIds
InitializesskippedIds
if necessary, and returns it. -
getSkippedGroups
InitializesskippedGroups
if necessary, and returns it.
-