Class PlayerCapabilityUtils

java.lang.Object
net.kamkeyke.raccooncore.util.PlayerCapabilityUtils

public class PlayerCapabilityUtils extends Object
Utility methods for player capability handling.

Yes, there's only one method, I know...

  • Constructor Details

    • PlayerCapabilityUtils

      public PlayerCapabilityUtils()
  • Method Details

    • cloneOnDeath

      public static <T extends IPlayerCapability<T>> void cloneOnDeath(net.minecraftforge.event.entity.player.PlayerEvent.Clone event, net.minecraftforge.common.capabilities.Capability<T> capability)
      Clones a capability from the original player to the new player instance.

      Should be called inside PlayerEvent.Clone. Only performs cloning if wasDeath is true.

      Type Parameters:
      T - capability type extending IPlayerCapability
      Parameters:
      event - the PlayerEvent.Clone event
      capability - the capability instance