package com.SargeantPotato_Mod.Items;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityFireball;
import net.minecraft.entity.projectile.EntitySmallFireball;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class staffoffire extends Item {
public staffoffire(int i) {
this.setUnlocalizedName("staffoffire");
this.setTextureName("SargeantPotato_Mod:staffoffire");
this.setCreativeTab(CreativeTabs.tabCombat);
}
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
Vec3 v3 = player.getLook(0);
EntitySmallFireball smallfireball = new EntitySmallFireball(world, player, v3.xCoord, v3.yCoord, v3.zCoord);
world.spawnEntityInWorld(smallfireball);
return itemStack;
}
}
This is my code, the getLookVec didn't work, and im confused where to put the pitch and yaw piece of code.
also where exactly should I put the if (!world.isRemote) {
}? ive tried to move it around but I cant figure out where to put it........ sorry about the trouble but since your good at this I would like to learn some from you.Thanks!