Jump to content

apple54678

Members
  • Posts

    0
  • Joined

  • Last visited

apple54678's Achievements

Newbie

Newbie (1/8)

0

Reputation

  1. im trying to make a fireball staff shoot fireballs im not sure exacly how though heres my code please tell me whats wrong the code package mymod._09_EpicWeapons; import java.util.Vector; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityFireball; import net.minecraft.entity.projectile.EntityLargeFireball; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ActionResult; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumHand; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; public class CustomFireStaff extends Item { public CustomFireStaff() { this.setCreativeTab(CreativeTabs.COMBAT); } @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer player, EnumHand handIn) { EntityFireball EntityFireball = new EntityLargeFireball(worldIn, player, 6F, 7F, 9F); Vec3d looking = EntityFireball.getLookVec(); if (looking != null) { EntityFireball.motionX = looking.x; EntityFireball.motionY = looking.y; EntityFireball.motionZ = looking.z; EntityFireball.accelerationX = EntityFireball.motionX * 0.1D; EntityFireball.accelerationY = EntityFireball.motionY * 0.1D; EntityFireball.accelerationZ = EntityFireball.motionZ * 0.1D; } return new ActionResult<ItemStack>(EnumActionResult.PASS, player.getHeldItem(handIn)); } }
×
×
  • Create New...

Important Information

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