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 Details

  • Constructor Details

  • Method Details

    • getContext

      public AttributeTooltipContext getContext()
      The current tooltip context.
    • getStack

      public ItemStack getStack()
      The ItemStack with the tooltip.
    • skipId

      public void skipId(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(EquipmentSlotGroup group)
      Marks an entire EquipmentSlotGroup as skipped, preventing all modifiers for that group from showing.
    • isSkipped

      public boolean isSkipped(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(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

      protected Set<ResourceLocation> getSkippedIds()
      Initializes skippedIds if necessary, and returns it.
    • getSkippedGroups

      protected Set<EquipmentSlotGroup> getSkippedGroups()
      Initializes skippedGroups if necessary, and returns it.