Jump to content

KarmaOwner

Members
  • Posts

    3
  • Joined

  • Last visited

KarmaOwner's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. @SubscribeEvent public void onServerTick(TickEvent.ServerTickEvent event) { World world = MinecraftServer.getServer().getEntityWorld(); for(Object obj : world.playerEntities) { EntityPlayer p = (EntityPlayer) obj; ExtendedPlayer exP = ExtendedPlayer.get(p); p.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(ExtendedPlayer.startHP + Math.abs(p.getMaxHealth() - (p.getHealth() + exP.getHP())) + exP.getHP()); p.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(p.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue() + exP.getDamage()); if(ExtendedPlayer.maxLevel == -1) { if(p.experienceLevel >= exP.getLevel() + 1) { exP.onLevelUP(Math.abs(p.experienceLevel - exP.getLevel())); p.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Felecitations vous venez d'up un level ! Votre lvl : " + EnumChatFormatting.GOLD + exP.getLevel())); } } else { if(p.experienceLevel < ExtendedPlayer.maxLevel && p.experienceLevel >= exP.getLevel() + 1) { exP.onLevelUP(Math.abs(p.experienceLevel - exP.getLevel())); p.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + "Felecitations vous venez d'up un level ! Votre lvl : " + EnumChatFormatting.GOLD + exP.getLevel())); } } } }
  2. Hello firstly sorry for my bad english I use translator , I have created a level and attribute mod, the level system works with the vanilla mc system when the player increases by one level he gains +1 life and an attribute point when the player increases the level attribute of life it gains 2 life in addition until the all works however I try to make it compatible with a plugin named "My items" the system of life of this plugin replaces the system of life of my mod example: The bar of life of the player when he does not have the helmet equipped with the system of life of my mod: The life bar of the player when he equips the helmet with stats of life and more (stats of the plugin): as you can see the plugin life system replaces my system the player only have 15 more life , he is supposed to have 24 more life ... I have contacted the creator of the plugin to ask him the sources of his plugin for modifying the sources to add the lives of the two systems , however he explained to me that his plugin works with a library "AgarthaLib" and he told me says that there is an event named "PlayerHealthMaxChangeEvent" and that I can directly add the maximum life of my mod when the event is called however I have no idea how to do it ... Is it possible to use a Spigot library on Forge? Thank you in advance for those who can give me reasoning.
×
×
  • Create New...

Important Information

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