Jump to content

Missing net.minecraft.util.EnumActionResult;


Dakewlmonguy

Recommended Posts

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);
    }
}

 

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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