I setup an environment using the 1.15.2 MDK, and everything seems to be working. Working, that is, until I tried to reference EnumActionResult. Apparently, in my environment, there is no EnumActionResult in net.minecraft.util. Am I being an idiot? I am fairly new to modding so that's entirely possible!
Here's my class, if anyone could look at it, I'd appreciate it!
My specific error message (both in the import statement and where it's called is "Cannot resolve symbol 'EnumActionResult' ")
package com.Dakewlmonguy.moddyMod.Items;
import net.minecraft.entity.projectile.FireballEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.EnumActionResult;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
public class ItemFireStone extends ItemBase {
public ItemFireStone()
{
}
@Override
public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn)
{
ItemStack item = playerIn.getHeldItem(handIn);
Vec3d aim = playerIn.getLookVec();
double posX = playerIn.getPosX();
double posY = playerIn.getPosY();
double posZ = playerIn.getPosZ();
FireballEntity fireball = new FireballEntity(worldIn, playerIn, 1,1,1);
fireball.setPosition(posX + aim.x * 1.5D, posY + aim.x * 1.5D, posZ + aim.x * 1.5D);
fireball.accelerationX = aim.x * 0.1; fireball.accelerationY = aim.y * 0.1; fireball.accelerationZ = aim.z * 0.1;
worldIn.addEntity(fireball);
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, item);
}
}