Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

  • Author

Still having issues with it rendering the vanilla arrow instead of my custom entity. Posting the new code for any help. 
AgrentBolt

public class ArgentBolt extends ArrowItem {

	public ArgentBolt(Properties properties) {
		super(properties);
	}

	@Override
	@OnlyIn(Dist.CLIENT)
	public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
		tooltip.add(new StringTextComponent("\u00A7o" + "Powered by Argent. Used for Ballista."));
		super.addInformation(stack, worldIn, tooltip, flagIn);
	}

	@Override
	public boolean isInfinite(ItemStack stack, ItemStack bow, net.minecraft.entity.player.PlayerEntity player) {
		int enchant = net.minecraft.enchantment.EnchantmentHelper
				.getEnchantmentLevel(net.minecraft.enchantment.Enchantments.INFINITY, bow);
		return enchant <= 0 ? false : this instanceof ArgentBolt;
	}

	@Override
	public AbstractArrowEntity createArrow(World worldIn, ItemStack stack, LivingEntity shooter) {
		ArgentBoltEntity arrowentity = new ArgentBoltEntity(worldIn, shooter);
		return arrowentity;
	}
}

ArgentBoltEntity

public class ArgentBoltEntity extends ArrowEntity  {

	public ArgentBoltEntity(EntityType<? extends ArgentBoltEntity> shooter, World worldIn) {
		super(shooter, worldIn);
	}
	
	public ArgentBoltEntity(World worldIn, LivingEntity shooter) {
		super(worldIn, shooter);
	}
	
	public ArgentBoltEntity(World world) {
        super(ModEntityTypes.ARGENT_BOLT.get(), world);
    }

	@SuppressWarnings("unchecked")
	public ArgentBoltEntity(World worldIn, EntityType<?> type) {
		super((EntityType<? extends ArrowEntity>) type, worldIn);
	}

	@Override
	protected ItemStack getArrowStack() {
		return new ItemStack(DoomItems.ARGENT_BOLT.get());
	}

	@Override
	public IPacket<?> createSpawnPacket() {
		return NetworkHooks.getEntitySpawningPacket(this);
	}
}

ArgentBoltRender

public class ArgentBoltRender extends ArrowRenderer<ArgentBoltEntity> {

	private static final ResourceLocation ARGENT_BOLT_TEXTURE = new ResourceLocation(DoomMod.MODID,
			"textures/entity/projectiles/argent_bolt.png");

	public ArgentBoltRender(EntityRendererManager renderManagerIn) {
		super(renderManagerIn);
	}

	@Override
	public ResourceLocation getEntityTexture(ArgentBoltEntity entity) {
		return ARGENT_BOLT_TEXTURE;
	}
}

It works when I do /summon dooweapon:argent_bolt but when I use the ammo with say a bow, it is still rendering the vanilla arrow. Any thoughts?

  • Author
5 hours ago, diesieben07 said:
  • Do not use @DistOnly

What is the correct thing to use thing? I don't see any issues with it and it's what Vanilla is using.

 

 

5 hours ago, diesieben07 said:
  • All your constructors must call a super constructor and pass your EntityType. You have one of them that does not do that.

Yup, that fixed it. Changed my ArgentBoltEntity to extend AbstractArrowEntity and did  
 

public ArgentBoltEntity(EntityType<?> type, World world) {
		super((EntityType<? extends AbstractArrowEntity>) type, world);
		this.referenceItem = null;
	}

Did a few other changes I found from another post here and now it's using the correct Entity when firing!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.