• 0

    posted a message on How to get player's Capability on LivingDamageEvent

    where should I put the damage judgment code, client or server?

        @SubscribeEvent<br />    public void onEvent(LivingDamageEvent event) {
            if (what should I do?) {
                mana = event.getEntity().getCapability(ManaProvider.MANA_CAP, null);
                event.setAmount(event.getAmount() + (mana.getAttack()));
                System.out.println("AttackEntityEvent");
            }
        }

     i tried to get entityPlayer by Minecraft.getMinecraft().player or event.getEntity,

    they didn't work. There are some attack in the Capability, I want to plus them when calculate the damage.

    Posted in: Mod Development
  • To post a comment, please or register a new account.