Jump to content

Justin_Perry

Members
  • Posts

    27
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Justin_Perry's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Alright, I give up on modding, thanks guys.
  2. I was looking at how to use onItemUse, nothing more.
  3. I was googling what other people used to execute a function when an item was right clicked. I found some old information and tried to incorporate it in 1.12. Apparently, it did not work. I found a youtube video that used the ActionResult<ItemStack> other than that, I was at a loss. I found no information that would have lead me to EnumActionResult. I have since implemented what DavidM suggested and it works.
  4. Telling me I don't know how to override is a complete insult. I have at least an item that heals others. I obviously had to override to do that. The issue is mostly the lack of forge documentation for low-level modders to look into. I have learned Python, taken C++ courses, and learned a moderate amount of Java.
  5. I would rather have a lesser understanding of java on my own than continue to be ridiculed. I searched high and low on information on onItemUse, while your eventual solution may have worked, you have made me really discouraged from asking for more help. I haven't learned everything in Java, no. But I do know how to make classes, variables, functions, and a bit more. Again, I appreciate your help, but you are not a nice person. Please refrain from talking to me anymore.
  6. Alright, thank you for nothing. I will figure everything else I'll need to make this mod by myself or by reading. Thanks
  7. Something that may be easy for you to understand and interpret can be hard for others. I have checked my parameters. public class stimSelf extends Item implements IHasModel { public stimSelf(String name) { setUnlocalizedName(name); setRegistryName(name); setCreativeTab(CreativeTabs.MISC); modItems.ITEMS.add(this); } @Override public void registerModels() { Main.proxy.registerItemRenderer(this, 0, "inventory"); } @Override public ActionResult<ItemStack> onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float xFloat, float yFloat, float zFloat) { if (player.getHealth() < player.getMaxHealth()) { System.out.println("We healed."); player.setHealth(player.getHealth() + 5.0F); player.getCooldownTracker().setCooldown(modItems.STIM_SELF, 300); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack); }else { System.out.println("We have not healed."); return new ActionResult<ItemStack>(EnumActionResult.FAIL, stack); } } } You tell me.
  8. public class stimSelf extends Item implements IHasModel { public stimSelf(String name) { setUnlocalizedName(name); setRegistryName(name); setCreativeTab(CreativeTabs.MISC); modItems.ITEMS.add(this); } @Override public void registerModels() { Main.proxy.registerItemRenderer(this, 0, "inventory"); } @Override public ActionResult<ItemStack> onItemUse(ItemStack itemStack, World world, EntityPlayer player) { if (player.getHealth() < player.getMaxHealth()) { System.out.println("We healed."); player.setHealth(player.getHealth() + 5.0F); player.getCooldownTracker().setCooldown(modItems.STIM_SELF, 300); }else { System.out.println("We have not healed."); } return null; } } I have no output. Can you help? Warning: The method onItemUse(ItemStack, World, EntityPlayer) of type stimSelf must override or implement a supertype method. Thank you.
  9. I am trying to have my item heal when the player right clicks with it out. How should I go about this? Thank you. I realize I know how to increase the health, add a cooldown, I'm familiar with getting health, setting health. I would use itemInteractionForEntity however, I do not know how to heal without interacting with an entity which may be compromising in an intense fight.
  10. Sorry for being so vague, I am just trying to accomplish one thing with the easiest route. I think avoiding ray tracing is the way to go. I particularly like constant health bar or hearts above the entities while in range. I am looking into RenderLivingEvent. Thank you
  11. Thank you for your useless comment. I am not asking for code as you can clearly see, so I will reply to whoever is attempting to assist me when I get past a certain stage asking for more clarification and guidance. I am taking guidance and putting my spin on it. I understand there are mods that do this, I am attempting to make one big mod for my friends and I, instead of downloading many mods that others have created. I have a friend who particularly does not like mods simply because they do not blend well and that is what I am here to accomplish. I appreciate your assistance, however, it is anything but. Have a great day.
  12. I have created a basic gui that displays text on the screen. How should I go about getting an entities health when the player hovers over them? If not hover, how can I make health permanently show?
  13. I want to create health bars and I need guidance to how I should go about this. Thank you.
  14. I corrected my issue yesterday by including the new ore blocks into the effective-on set within Minecraft and including them within the exceptions list for harvest levels. Thank you all for being helpful and not getting frustrated by my stupidity.
×
×
  • Create New...

Important Information

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