Class DeathChestInteractions


  • public final class DeathChestInteractions
    extends Object
    Handles death chest interactions.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean attemptBreak​(net.minecraft.util.math.BlockPos pos, DeathChest deathChest, net.minecraft.server.network.ServerPlayerEntity player)
      Called when a player attempts to break a death chest.
      static boolean attemptInteract​(DeathChest deathChest, net.minecraft.server.network.ServerPlayerEntity player)
      If the specified death chest is locked, an unlock attempt is performed.
      static net.minecraft.util.ActionResult interact​(net.minecraft.entity.player.PlayerEntity player, net.minecraft.world.World world, net.minecraft.util.Hand hand, net.minecraft.util.hit.BlockHitResult blockHitResult)
      Called when a block is right-clicked.
    • Method Detail

      • interact

        public static net.minecraft.util.ActionResult interact​(net.minecraft.entity.player.PlayerEntity player,
                                                               net.minecraft.world.World world,
                                                               net.minecraft.util.Hand hand,
                                                               net.minecraft.util.hit.BlockHitResult blockHitResult)
        Called when a block is right-clicked.
        Parameters:
        player - the player.
        world - the world.
        hand - the hand.
        blockHitResult - the BlockHitResult.
        Returns:
        ActionResult.PASS if the interaction can occur, or ActionResult.SUCCESS if it cannot.
      • attemptInteract

        public static boolean attemptInteract​(DeathChest deathChest,
                                              net.minecraft.server.network.ServerPlayerEntity player)
        If the specified death chest is locked, an unlock attempt is performed. The method then returns whether the specified player can unlock the death chest.
        Parameters:
        deathChest - a death chest.
        player - a player.
        Returns:
        true if the player can interact with the death chest, or otherwise false.
      • attemptBreak

        public static boolean attemptBreak​(net.minecraft.util.math.BlockPos pos,
                                           DeathChest deathChest,
                                           net.minecraft.server.network.ServerPlayerEntity player)
        Called when a player attempts to break a death chest. Returns whether the death chest should be broken. If this is true and the death chest is a double chest, the other death chest block is automatically destroyed.
        Parameters:
        pos - a position.
        deathChest - a death chest.
        player - a player.
        Returns:
        true if the death chest should be broken, or otherwise false.