Jump to content

PlayStarMC

Members
  • Posts

    6
  • Joined

  • Last visited

PlayStarMC's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I looked at some other mods and this is what I have now (extra health instead of block reach) AttributeModifier HEART_CRYSTAL_MODIFIER = new AttributeModifier(UUID.fromString("68a6dc55-32e4-46a2-8707-57fd16f6afdd"), "AuroraAttributeModifier_HeartCrystal", 4, AttributeModifier.Operation.ADDITION); if (pEvent.phase == TickEvent.Phase.START) { ItemStack item = new ItemStack(ModItems.HEART_CRYSTAL.get(), 1); if (player.getInventory().contains(item)) { if (!Objects.requireNonNull(player.getAttribute(Attributes.MAX_HEALTH)).hasModifier(HEART_CRYSTAL_MODIFIER)) { Objects.requireNonNull(player.getAttribute(Attributes.MAX_HEALTH)).addTransientModifier(HEART_CRYSTAL_MODIFIER); } } else { Objects.requireNonNull(player.getAttribute(Attributes.MAX_HEALTH)).removeModifier(HEART_CRYSTAL_MODIFIER.getId()); } } There are no errors but it doesn't work
  2. what would the whole code look like with this modifier? is it possible within the same class?
  3. Yea, I already looked through older posts but most of them were linked to methods i did not get to work. Its my first name making a mod, how do I temporarily change an attribute?
  4. I know that problem, mostly because some mods interact with optifine and it makes the game crash when world joined
×
×
  • Create New...

Important Information

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