TippedArrowItem .java

net.minecraft.world.item.TippedArrowItem (class): members: getDefaultInstance, getName. strings: ".effect.". imports: Potions, PotionContents, Component.

net.minecraft.world.itemclass26 linescommonextends ArrowItem831 B

API Surface (2)

ItemStack getDefaultInstance()
Component getName(final ItemStack itemStack)

String literals (1)

".effect."

Code Graph: Dependencies (6)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

TippedArrowItem.java26 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.item;
2
3
import net.minecraft.core.component.DataComponents;
4
import net.minecraft.network.chat.Component;
5
import net.minecraft.world.item.alchemy.PotionContents;
6
import net.minecraft.world.item.alchemy.Potions;
7
8
public class TippedArrowItem extends ArrowItem {
9
	public TippedArrowItem(final Item.Properties properties) {
10
		super(properties);
11
	}
12
13
	@Override
14
	public ItemStack getDefaultInstance() {
15
		ItemStack itemStack = super.getDefaultInstance();
16
		itemStack.set(DataComponents.POTION_CONTENTS, new PotionContents(Potions.POISON));
17
		return itemStack;
18
	}
19
20
	@Override
21
	public Component getName(final ItemStack itemStack) {
22
		PotionContents potion = itemStack.get(DataComponents.POTION_CONTENTS);
23
		return potion != null ? potion.getName(this.descriptionId + ".effect.") : super.getName(itemStack);
24
	}
25
}
26

Decompiled Minecraft 26.3 source of TippedArrowItem (net/minecraft/world/item/TippedArrowItem.java) with Mojang official mappings, stored verbatim on the site.