Package net.md_5.bungee.api.chat

# Class ObjectComponent

java.lang.Object
net.md_5.bungee.api.chat.BaseComponent
net.md_5.bungee.api.chat.ObjectComponent

public final class ObjectComponent extends BaseComponent
An object component that can be used to display objects.

It can either display a player's head or an object by a specific sprite and an atlas.

Note: this was added in Minecraft 1.21.9.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class net.md_5.bungee.api.chat.BaseComponent

  `BaseComponent.LimitedStringVisitor, BaseComponent.StringVisitor`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ObjectComponent(@NonNull ChatObject object)`
  Creates a ObjectComponent from a given ChatObject.
  `ObjectComponent(ObjectComponent original)`
  Creates an object component from the original to clone it.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected boolean`
  `canEqual(Object other)`
  `ObjectComponent`
  `duplicate()`
  Clones the BaseComponent and returns the clone.
  `boolean`
  `equals(Object o)`
  `ChatObject`
  `getObject()`
  `int`
  `hashCode()`
  `void`
  `setObject(ChatObject object)`
  `protected void`
  `toLegacyText(BaseComponent.StringVisitor builder)`
  `protected void`
  `toPlainText(BaseComponent.StringVisitor builder)`
  `String`
  `toString()`

  ### Methods inherited from class net.md_5.bungee.api.chat.BaseComponent

  `addExtra, addExtra, applyStyle, copyFormatting, copyFormatting, copyFormatting, duplicateWithoutFormatting, getClickEvent, getColor, getColorRaw, getExtra, getFont, getFontRaw, getHoverEvent, getInsertion, getShadowColor, getShadowColorRaw, getStyle, hasFormatting, hasStyle, isBold, isBoldRaw, isItalic, isItalicRaw, isObfuscated, isObfuscatedRaw, isReset, isStrikethrough, isStrikethroughRaw, isUnderlined, isUnderlinedRaw, retain, setBold, setClickEvent, setColor, setExtra, setFont, setHoverEvent, setInsertion, setItalic, setObfuscated, setReset, setShadowColor, setStrikethrough, setStyle, setUnderlined, toLegacyText, toLegacyText, toPlainText, toPlainText`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### ObjectComponent

    public ObjectComponent(@NonNull @NonNull ChatObject object)
    Creates a ObjectComponent from a given ChatObject. See `PlayerObject` and `SpriteObject`.
    Parameters:
      `object` - the ChatObject

  - ### ObjectComponent

    public ObjectComponent(ObjectComponent original)
    Creates an object component from the original to clone it.
    Parameters:
      `original` - the original for the new score component

- ## Method Details

  - ### duplicate

    public ObjectComponent duplicate()
    Description copied from class: `BaseComponent`
    Clones the BaseComponent and returns the clone.
    Specified by:
      `duplicate` in class `BaseComponent`
    Returns:
      The duplicate of this BaseComponent

  - ### toPlainText

    protected void toPlainText(BaseComponent.StringVisitor builder)

  - ### toLegacyText

    protected void toLegacyText(BaseComponent.StringVisitor builder)

  - ### getObject

    public ChatObject getObject()

  - ### setObject

    public void setObject(ChatObject object)

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `BaseComponent`

  - ### equals

    public boolean equals(Object o)
    Overrides:
      `equals` in class `BaseComponent`

  - ### canEqual

    protected boolean canEqual(Object other)
    Overrides:
      `canEqual` in class `BaseComponent`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `BaseComponent`