HELP

2 posts / 0 new
Last post
Offline
Last seen: 1 year 6 months ago
Joined: 07/30/2015 - 20:19
Gems: 0
HELP

PLEASE ! i need help . i want make a mod  and i want create a want shooting with ender pearle. i try but evrytime i got error ! please help me . how can i do a ender wand ? (for teleport)



Offline
Last seen: 1 year 3 months ago
Joined: 05/05/2013 - 11:45
Gems: 0
Add this custom code to your

Add this custom code to your item and it should work. 

public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
        if (!par3EntityPlayer.capabilities.isCreativeMode)
        {
            --par1ItemStack.stackSize;
        }
        par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
        if (!par2World.isRemote)
        {
            par2World.spawnEntityInWorld(new EntityEnderPearl(par2World, par3EntityPlayer));
        }
        return par1ItemStack;
    }

 

Thanks to Mentalmeteor for the custom code.