Package net.neoforged.neoforge.event
Class GatherSkippedAttributeTooltipsEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.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 AttributeTooltipContextprivate booleanprivate @Nullable Set<EquipmentSlotGroup> private @Nullable Set<ResourceLocation> protected final ItemStack -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionThe current tooltip context.protected Set<EquipmentSlotGroup> InitializesskippedGroupsif necessary, and returns it.protected Set<ResourceLocation> InitializesskippedIdsif necessary, and returns it.getStack()TheItemStackwith the tooltip.booleanChecks if a given id is skipped or not.booleanisSkipped(EquipmentSlotGroup group) Checks if a given group is skipped or not.booleanChecks if the event will cause all attribute modifiers to be skipped.voidsetSkipAll(boolean skip) Sets if the event should skip displaying all attribute modifiers.voidskipGroup(EquipmentSlotGroup group) Marks an entireEquipmentSlotGroupas skipped, preventing all modifiers for that group from showing.voidMarks 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
TheItemStackwith 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 entireEquipmentSlotGroupas 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
InitializesskippedIdsif necessary, and returns it. -
getSkippedGroups
InitializesskippedGroupsif necessary, and returns it.
-