SpectralArrowItem .java

net.minecraft.world.item.SpectralArrowItem (class): members: createArrow, asProjectile. imports: SpectralArrow, Position, AbstractArrow, Projectile.

net.minecraft.world.itemclass29 linescommonextends ArrowItem1.1 KB

API Surface (2)

AbstractArrow createArrow(final Level level, final ItemStack itemStack, final LivingEntity owner, final @Nullable ItemStack firedFromWeapon)
Projectile asProjectile(final Level level, final Position position, final ItemStack itemStack, final Direction direction)

Full Source

SpectralArrowItem.java29 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.item;
2
3
import net.minecraft.core.Direction;
4
import net.minecraft.core.Position;
5
import net.minecraft.world.entity.LivingEntity;
6
import net.minecraft.world.entity.projectile.Projectile;
7
import net.minecraft.world.entity.projectile.arrow.AbstractArrow;
8
import net.minecraft.world.entity.projectile.arrow.SpectralArrow;
9
import net.minecraft.world.level.Level;
10
import org.jspecify.annotations.Nullable;
11
12
public class SpectralArrowItem extends ArrowItem {
13
	public SpectralArrowItem(final Item.Properties properties) {
14
		super(properties);
15
	}
16
17
	@Override
18
	public AbstractArrow createArrow(final Level level, final ItemStack itemStack, final LivingEntity owner, final @Nullable ItemStack firedFromWeapon) {
19
		return new SpectralArrow(level, owner, itemStack.copyWithCount(1), firedFromWeapon);
20
	}
21
22
	@Override
23
	public Projectile asProjectile(final Level level, final Position position, final ItemStack itemStack, final Direction direction) {
24
		SpectralArrow arrow = new SpectralArrow(level, position.x(), position.y(), position.z(), itemStack.copyWithCount(1), null);
25
		arrow.pickup = AbstractArrow.Pickup.ALLOWED;
26
		return arrow;
27
	}
28
}
29

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