Started by
Riuuflix
on
Topic category: Troubleshooting, bugs, and solutions
Hello,
I'm trying to make an item that shoots blaze fireballs, here's the code :
@Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer entity, EnumHand hand) {
ActionResult<ItemStack> retval = super.onItemRightClick(world, entity, hand);
if(world.isRemote)
return retval;
ItemStack itemstack = retval.getResult();
Vec3d looking = entity.getLookVec();
EntitySmallFireball fireball = new EntitySmallFireball(world, (EntityLivingBase) entity,
looking.x * 0.4, looking.y * 0.4, looking.z * 0.4);
world.spawnEntityInWorld((Entity) fireball);
return retval;
}
And here's the error :
error: cannot find symbol
world.spawnEntityInWorld((Entity) fireball);
^
symbol: method spawnEntityInWorld(Entity)
location: variable world of type World
I searched a lot but found nothing, any idea ?
Hey Riuuflix, Can you please use pastebin or something so it more readable?
Also its because it cannot find the import that in the current version of MCreator does not do automatically most of the times.
and if still not try use
The new method "world.spawnEntity(fireball)" works ! Thanks !
No problem. Please make this side "[Fixed]" so others can see how to fix their problem if they ever incounter this.