Jump to content

RedLapisModding

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by RedLapisModding

  1. Hello, It's Red Lapis. I'm currently trying to make a tool that changes its material after being used, but if I keep it as the same item, that'll make it more difficult later if I decide I want the texture and name to change as well. I'm not quite sure how to do it. If the change is made upon breaking instead of using the tool, that would be better.
  2. Thank you, SackCastellon. I didn't think it would be so easy! Edit: Although it's useful in some cases, it's not what i'm looking for. The .isEntityAlive() checks when the entity is hit, not after whether it is still alive is calculated. striking the dead body before it despawns is the only way for the check to return false.I need something that checks whether the entity would still be alive or not after it is hit. Is there a way for the item to find the entity's initial health before the damage is calculated? Edit: Never mind. I added an else statement and now it does what I want.
  3. The code example you showed me would be helpful for repairing the sword upon hitting and dealing damage to an entity, but I was wondering if there is a way for it to check whether the entity died from the hit or not. Do I have to reference to that specific mob?
  4. Hello, it's Red Lapis. I'm currently working on my first mod. I won't say much about it except that it adds a lot of swords. I want one of these swords to repair itself slightly after killing a mob or player. I've been through the ItemSword.class to find what makes it affect durability when hitting an entity, but can't figure out how to make it affect durability when killing an entity. I assume that it is the entity that decides to die when it reaches 0 or less health and not the decision of what damages the entity to find its health, calculate if the health would be 0 or less after it hits, and then tell the entity to die if so.
×
×
  • Create New...

Important Information

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