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 AttributeTooltipContext
private boolean
private @Nullable Set
<net.minecraft.world.entity.EquipmentSlotGroup> private @Nullable Set
<net.minecraft.resources.ResourceLocation> protected final net.minecraft.world.item.ItemStack
-
Constructor Summary
ConstructorsConstructorDescriptionGatherSkippedAttributeTooltipsEvent
(net.minecraft.world.item.ItemStack stack, AttributeTooltipContext ctx) -
Method Summary
Modifier and TypeMethodDescriptionThe current tooltip context.protected Set
<net.minecraft.world.entity.EquipmentSlotGroup> InitializesskippedGroups
if necessary, and returns it.protected Set
<net.minecraft.resources.ResourceLocation> InitializesskippedIds
if necessary, and returns it.net.minecraft.world.item.ItemStack
getStack()
TheItemStack
with the tooltip.boolean
isSkipped
(net.minecraft.resources.ResourceLocation id) Checks if a given id is skipped or not.boolean
isSkipped
(net.minecraft.world.entity.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
(net.minecraft.world.entity.EquipmentSlotGroup group) Marks an entireEquipmentSlotGroup
as skipped, preventing all modifiers for that group from showing.void
skipId
(net.minecraft.resources.ResourceLocation id) Marks the id of a specific attribute modifier as skipped, causing it to not be displayed in the tooltip.
-
Field Details
-
stack
protected final net.minecraft.world.item.ItemStack stack -
ctx
-
skippedIds
-
skippedGroups
-
skipAll
private boolean skipAll
-
-
Constructor Details
-
GatherSkippedAttributeTooltipsEvent
public GatherSkippedAttributeTooltipsEvent(net.minecraft.world.item.ItemStack stack, AttributeTooltipContext ctx)
-
-
Method Details
-
getContext
The current tooltip context. -
getStack
public net.minecraft.world.item.ItemStack getStack()TheItemStack
with the tooltip. -
skipId
public void skipId(net.minecraft.resources.ResourceLocation id) Marks the id of a specific attribute modifier as skipped, causing it to not be displayed in the tooltip. -
skipGroup
public void skipGroup(net.minecraft.world.entity.EquipmentSlotGroup group) Marks an entireEquipmentSlotGroup
as skipped, preventing all modifiers for that group from showing. -
isSkipped
public boolean isSkipped(net.minecraft.resources.ResourceLocation id) Checks if a given id is skipped or not. If all modifiers are skipped, this method always returns true. -
isSkipped
public boolean isSkipped(net.minecraft.world.entity.EquipmentSlotGroup group) 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.
-