HELP

Started by FicusPower on Wed, 08/05/2015 - 09:37
Last seen on 15:58, 17. Oct 2015
Joined Jul 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
HELP
Wed, 08/05/2015 - 09:37

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)

Last seen on 09:21, 23. Jan 2016
Joined May 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Add this custom code to your
Wed, 08/05/2015 - 22:17

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.