EntityPlayer player = ...; // get a reference to the player entity float distance = player.fallDistance; if (distance > 3.0f) { int damage = (int)(distance - 3.0f); // take 1 heart of damage per block fallen past 3 blocks player.attackEntityFrom(DamageSource.FALL, damage); }The EntityPlayer class is part of the net.minecraft.entity.player package within the Minecraft game's codebase.