No Oxygen Damege in my mod

Started by JanCraft on Sun, 04/02/2017 - 14:34

Topic category: Help with MCreator's application

Last seen on 17:22, 10. May 2018
Joined Oct 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
No Oxygen Damege in my mod
Sun, 04/02/2017 - 14:34

public class mcreator_GlobalEventsTestEnvironmentMod {

    @SubscribeEvent
    public void onEntityAttacked(LivingAttackEvent event) {
        EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
        int i = (int) entity.posX;
        int j = (int) entity.posY;
        int k = (int) entity.posZ;
        MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
        World world = server.worldServers[0];

        if (!hasPlayerInInventory[mcreator_oxygenedTwoBottles.body]) {
            entity.attackEntityFrom(DamageSource.generic, 1);
        }
    }

}

 

This code is OK?