Posted July 6, 20205 yr 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); } }
July 6, 20205 yr 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.