#Custom arrow type entity class won't compile

2 messages · Page 1 of 1 (latest)

tacit trout
#

This class:

public class TorchArrowEntity extends PersistentProjectileEntity {

    public TorchArrowEntity(EntityType<? extends PersistentProjectileEntity> entityType, World world) {
        super(entityType, world);
    }

    public TorchArrowEntity(LivingEntity owner, World world, ItemStack stack, @Nullable ItemStack shotFrom) {
        super(ModEntityTypes.TORCH_ARROW, owner, world, stack, shotFrom);
        this.setOnFireFor(60);
    }

    @Override
    public void tick() {
        super.tick();
        World world = this.getWorld();
        if (world.isClient) {
            world.addParticle(ParticleTypes.FLAME, this.getX(), this.getY(), this.getZ(), 0, 0, 0);
            world.addParticle(ParticleTypes.SMOKE, this.getX(), this.getY(), this.getZ(), 0, 0, 0);
        }
    }

    @Override
    public boolean doesRenderOnFire() {
        return false;
    }

    @Override
    protected ItemStack getDefaultItemStack() {
        return new ItemStack(ModItems.TORCH_ARROW);
    }

}

Gives the following compile error:

error: cannot access CompoundTag
public class TorchArrowEntity extends PersistentProjectileEntity {
       ^
  class file for net.minecraft.nbt.CompoundTag not found

Anyone able to provide some insight? I haven't found any references to that from the game's source files. The only references are in the refmap json files from porting lib and architectury, since they are used by other mods I'm making implementations of.

cerulean cosmos
#

Are you using mojang mappings?