Class HoverEvent.ShowItem
java.lang.Object
net.kyori.adventure.text.event.HoverEvent.ShowItem
- Enclosing class:
HoverEvent<V>
-
Method Summary
Modifier and TypeMethodDescription@Range(from=0L,to=2147483647L) intcount()Gets the count.count(@Range(from=0L,to=2147483647L) int count) Sets the count.Get the data components used for this item.dataComponents(Map<Key, DataComponentValue> holder) Set the data components used on this item.<V extends DataComponentValue>
Map<Key, V> dataComponentsAs(Class<V> targetType) Return an unmodifiable map of data components coerced to the target type.booleaninthashCode()item()Gets the item.Sets the item.@Nullable BinaryTagHoldernbt()Gets the nbt.nbt(@Nullable BinaryTagHolder nbt) Sets the nbt.static HoverEvent.ShowItemCreates.static HoverEvent.ShowItemshowItem(Keyed item, @Range(from=0L,to=2147483647L) int count, Map<Key, ? extends DataComponentValue> dataComponents) Creates.static HoverEvent.ShowItemshowItem(Keyed item, @Range(from=0L,to=2147483647L) int count, @Nullable BinaryTagHolder nbt) Creates.static HoverEvent.ShowItemCreates.static HoverEvent.ShowItemshowItem(Key item, @Range(from=0L,to=2147483647L) int count, @Nullable BinaryTagHolder nbt) Creates.toString()
-
Method Details
-
showItem
Creates.- Parameters:
item- the itemcount- the count- Returns:
- a
ShowItem - Since:
- 4.14.0
-
showItem
Creates.- Parameters:
item- the itemcount- the count- Returns:
- a
ShowItem - Since:
- 4.14.0
-
showItem
@Obsolete public static HoverEvent.ShowItem showItem(Key item, @Range(from=0L,to=2147483647L) int count, @Nullable BinaryTagHolder nbt) Creates.- Parameters:
item- the itemcount- the countnbt- the nbt- Returns:
- a
ShowItem - Since:
- 4.14.0
- Obsolete since Minecraft
- since 1.20.5 and replaced with data components
-
showItem
@Obsolete public static HoverEvent.ShowItem showItem(Keyed item, @Range(from=0L,to=2147483647L) int count, @Nullable BinaryTagHolder nbt) Creates.- Parameters:
item- the itemcount- the countnbt- the nbt- Returns:
- a
ShowItem - Since:
- 4.14.0
- Obsolete
- since 1.20.5 and replaced with data components
-
showItem
public static HoverEvent.ShowItem showItem(Keyed item, @Range(from=0L,to=2147483647L) int count, Map<Key, ? extends DataComponentValue> dataComponents) Creates.- Parameters:
item- the itemcount- the countdataComponents- the data components- Returns:
- a
ShowItem - Since:
- 4.17.0
- Since Minecraft:
- 1.20.5
-
item
-
item
Sets the item.- Parameters:
item- the item- Returns:
- a
ShowItem - Since:
- 4.0.0
-
count
public @Range(from=0L,to=2147483647L) int count()Gets the count.- Returns:
- the count
- Since:
- 4.0.0
-
count
Sets the count.- Parameters:
count- the count- Returns:
- a
ShowItem - Since:
- 4.0.0
-
nbt
Gets the nbt.If there are data components on this item, it will never have NBT data.
- Returns:
- the nbt
- Since:
- 4.0.0
- Obsolete since Minecraft
- since 1.20.5 and replaced with data components
-
nbt
Sets the nbt.This will clear any modern data components set on the item.
- Parameters:
nbt- the nbt- Returns:
- a
ShowItem - Since:
- 4.0.0
- Obsolete since Minecraft
- 1.20.5 and replaced with data components
-
dataComponents
Get the data components used for this item.If there is NBT data on this item, it will never have any data components set.
- Returns:
- an unmodifiable map of data components
- Since:
- 4.17.0
- Since Minecraft:
- 1.20.5
-
dataComponents
Set the data components used on this item.This will clear any legacy NBT-format data on the item.
- Parameters:
holder- the new data components to set- Returns:
- a show item data object that has the provided components
- Since:
- 4.17.0
- Since Minecraft:
- 1.20.5
-
dataComponentsAs
Return an unmodifiable map of data components coerced to the target type.If there is no converter registered with the
DataComponentValueConverterRegistryfor the conversion of a value, aIllegalArgumentExceptionwill be thrown.- Type Parameters:
V- the new data component value type- Parameters:
targetType- the expected target type- Returns:
- the unmodifiable map
- Since:
- 4.17.0
- Since Minecraft:
- 1.20.5
-
equals
-
hashCode
-
toString
-