Jump to content

Babelincoln1809

Members
  • Posts

    122
  • Joined

  • Last visited

Everything posted by Babelincoln1809

  1. Pretty basic question. Basically what I got is.. if(handIn.OFF_HAND) It just gives me an error, I know it sounds dumb for asking this, but I don't know what is needed to be put
  2. So I have an item that rolls a random number when it hits an entity and will increase it's attack damage, but only for that hit. The issue is that it won't reset the attack damage to it's base value, no matter what I do. Well, it usually glitches it out when I try anything. Here's my code without any attempt of resetting the value to it's default state. public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { stack.damageItem(2, attacker, (p_220045_0_) -> { p_220045_0_.sendBreakAnimation(EquipmentSlotType.MAINHAND); }); Random rand = new Random(); int num = rand.nextInt(3)+1; if(num ==1) { this.attackDamage += 1000; } return true; } Any help?
  3. Ooooooohhhh, it's much more clearer now lol. It's the attacker
  4. I need to initialize a variable and need to be able to work, it's very dumb and just has been a small issue for me that I can never get to work. Here's my code fro my class. public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { PlayerEntity playerIn = null; <--- Right here is my issue Random rand = new Random(); int num = rand.nextInt(3)+1; if(num ==1) playerIn.heal(1); return true; }
  5. Pretty self explanatory, but how should I go about making a sword's damage based off the player's experience while still extending SwordItem if that's possible? If there's a better way, then just tell me lol, cause I'm at a lost.
  6. Yeah, I understand the basics/essentials. I've been learning it for a year and half right now and when coding Minecraft I get really ambitious and sometimes try to do stuff I don't understand/learn fully learned yet. I do a lot of trail and error with Minecraft, and use the reference libraries a lot. I do tend to overthink, which isn't good lol.
  7. Writing that down inside the method just gave me errors
  8. I do not think I've stored the value. I'm really only totally lost on this respawn part. So far I have.. @SubscribeEvent public void keepHealth(PlayerEvent.Clone event) { PlayerEntity clone = event.getOriginal(); }
  9. @poopoodice So far, I can't get it to clone the original player on respawn.
  10. PlayerCloneEvent doesn't appear to be a thing Wait found it
  11. So I created a Zelda heart container like item, it works and stuff, The issue is when dying. When I die, the health resets. I sorta have a lead on how to fix it. I know about the PlayerRespawnEvent and have gotten it to work, can't find out how to just keep it at the value I have it at. Would If statements work? If so, then I don't know how to get the if statement to work with the attribute modifier value if that's even possible. Sorry if my explaining is bad. Any help? UPDATE: Got it to work with if statements, just a bit wonky UPDATE 2: Yeah, I'm starting to figure it out. it's confusion on how to set up the if statement. Right now it is.. @SubscribeEvent public void defaultHealth(PlayerLoggedInEvent event) { PlayerEntity player = event.getPlayer(); if(player.getMaxHealth() == 20) player.getAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(new AttributeModifier("MaxHealth", -14f, AttributeModifier.Operation.ADDITION)); } @SubscribeEvent public void keepHealth(PlayerRespawnEvent event) { PlayerEntity player = event.getPlayer(); if(player.getMaxHealth() == 20) player.getAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(new AttributeModifier("MaxHealth", -14f, AttributeModifier.Operation.ADDITION)); } I know I need to have the if statement have two variables for both cause right now it'll reset back to normal if it's at 20 when you log back in, and when you die and respawn it'll reset it no matter what. The PlayerRespawnEvent is my biggest issue rn.
  12. Eclipse I have a GitHub account set up, I just need to upload my workspace
  13. Anywhere on GitHub I can reference code for this?
  14. I have a class for a weapon where I want to still be able to swing it as a normal sword on the off hand. Any help? I know using the action rightclick is the place to start, but I dunno where to go from there.
  15. what do I do about the parameter onBroken? Anything I put into it, just gives me errors.
  16. Any clue on how to damage an itemStack? I can't find any clear cut answer or solution. Been looking around the code and trying things, but to use what so ever.
  17. Here is the log. I do have incomplete code though cause I'm still stumped with the custom armor class. https://paste.dimdev.org/gobubuhuka.sql Here is my armor class, still stumped on the errors https://paste.dimdev.org/kuyuyutama.java Here is the model https://paste.dimdev.org/ejavifujug.java I'll look into setting up an account for github, but I think my only issue is the armor class, and possibly where to put the model.java
  18. Yeah, my custom armor class is still giving me issues. The actual model for my armor extends BipedModel<LivingEntity>, but still no clue on what's wrong with the armor class
  19. I'm running into this issue in the armor Item class. I'm following a 1.12 video, cause I would be completely lost without reference, but anyways here it is. https://paste.dimdev.org/ededipubok.java I have no clue what baked Model does, and I'm just a lil lost And I dunno where to put my armor model as well, do I make a new package in models and name it armor?
  20. Alright, I'll just leave it blank then
  21. So I made my model in blockbench, do I name the model identifier anything?
  22. Thank you! I'll tell you if I run into issues
  23. I'm looking for custom armor model tutorials for 1.14.4, but none are showing up besides for ones that are for 1.12.2. I saw comment on one of them that the process as to implementing custom armor hasn't change, but as following the video things aren't super the same. i'm just looking for a guide on how to do this.
×
×
  • Create New...

Important Information

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