Posted May 10, 20169 yr Hey does anyone know how I would make it so that when I right click with my sword instead of blocking it would shoot out a fireball like a blaze and when "fully charged" would send out a wither skull attack? Thanks for any help given.
May 10, 20169 yr Author I have that already I'm just not sure what part of the wither skull attack to put into the code, I tried this: @Override public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) if(itemStackIn.getItem() == MAItems.NetherBlade) return super.onItemRightClick(itemStackIn, worldIn, playerIn); } private void launchWitherSkullToEntity(int p_82216_1_, EntityLivingBase p_82216_2_) { this.launchWitherSkullToCoords(p_82216_1_, p_82216_2_.posX, p_82216_2_.posY + (double)p_82216_2_.getEyeHeight() * 0.5D, p_82216_2_.posZ, p_82216_1_ == 0 && this.rand.nextFloat() < 0.001F); } /** * Launches a Wither skull toward (par2, par4, par6) */ private void launchWitherSkullToCoords(int p_82209_1_, double x, double y, double z, boolean invulnerable) { this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1014, new BlockPos(this), 0); double d0 = this.func_82214_u(p_82209_1_); double d1 = this.func_82208_v(p_82209_1_); double d2 = this.func_82213_w(p_82209_1_); double d3 = x - d0; double d4 = y - d1; double d5 = z - d2; EntityWitherSkull entitywitherskull = new EntityWitherSkull(this.worldObj, this, d3, d4, d5); if (invulnerable) { entitywitherskull.setInvulnerable(true); } entitywitherskull.posY = d1; entitywitherskull.posX = d0; entitywitherskull.posZ = d2; this.worldObj.spawnEntityInWorld(entitywitherskull); } }
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.