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.

RedLapisModding

Members
  • Joined

  • Last visited

  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.

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.