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

Posted

so i'm trying to make an custom arrow i'm in the registering part now but can't seem to figure out how it works.

my item:

package com.CloudyProductions.DreamMod.heaven.items;

import com.CloudyProductions.DreamMod.Main;
import com.CloudyProductions.DreamMod.init.ItemInit;
import com.CloudyProductions.DreamMod.util.IHasModel;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemArrow;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

public class CloudArrow extends ItemArrow implements IHasModel {

    public CloudArrow(String name, CreativeTabs tab) {
        setUnlocalizedName(name);
        setRegistryName(name);
        setCreativeTab(tab);
        setMaxStackSize(64);

        ItemInit.ITEMS.add(this);
    }
    public EntityArrow makeTippedArrow(World world, ItemStack itemstack, EntityLivingBase shooter) {
        return new com.CloudyProductions.DreamMod.heaven.entitys.CloudArrow(world, shooter);
    }
    @Override
    public void registerModels() {
        Main.proxy.registerItemRendere(this, 0, "inventory");
    }

}

the arrow entity:

package com.CloudyProductions.DreamMod.heaven.entitys;

import com.CloudyProductions.DreamMod.init.ItemInit;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.world.World;

public class CloudArrow extends EntityArrow {

    public CloudArrow(World worldIn) {
        super(worldIn);
    }
    public CloudArrow(World worldIn, EntityLivingBase shooter) {
        super(worldIn, shooter);
    }
    @Override
    public void onUpdate() {
        super.onUpdate();
        if (this.world.isRemote && !this.inGround) {
            this.world.spawnParticle(EnumParticleTypes.CLOUD, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
        }
    }
    @Override
    public ItemStack getArrowStack() {
        return new ItemStack(ItemInit.CLOUD_ARROW);
    }
    @Override
    public void arrowHit(EntityLivingBase living) {
        super.arrowHit(living);
        if (living != shootingEntity) {
            world.createExplosion(shootingEntity, living.posX, living.posY, living.posZ, 4.0F, true);
        }
    }
}

the render entity:

package com.CloudyProductions.DreamMod.heaven.entitys;

import com.CloudyProductions.DreamMod.Reference;
import com.CloudyProductions.DreamMod.heaven.items.Cloud;
import net.minecraft.client.renderer.entity.RenderArrow;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class RenderCloudArrow extends RenderArrow<CloudArrow> {

    public static final ResourceLocation res = new ResourceLocation(Reference.MODID, "textures/entitys/cloud_arrow.png");

    public RenderCloudArrow(RenderManager rm) {
        super(rm);
    }
    @Override
    public ResourceLocation getEntityTexture(CloudArrow entity) {
        return res;
    }
}

but how can i register this

trying to do this 

EntityRegistry.registerModEntity(CloudArrow.class, new RenderCloudArrow());

but i need and RenderManager

  • Author

i did it and it came sort of cool out when you shoot the arrow it disappears from you're inventory when you pic it up it changes to an normal arrow

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.