Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

 

  • Author

Well I checked the source code of several other mods (such as enderIo) and they call it. So what gives? Is it that I'm looking at an older version and 1.15.2 doesn't have this? if so, what does 1.15.2 have that I should be using?

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.