Class DeathChestInteractions
- java.lang.Object
-
- com.therandomlabs.vanilladeathchest.deathchest.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 booleanattemptBreak(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 booleanattemptInteract(DeathChest deathChest, net.minecraft.server.network.ServerPlayerEntity player)If the specified death chest is locked, an unlock attempt is performed.static net.minecraft.util.ActionResultinteract(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- theBlockHitResult.- Returns:
ActionResult.PASSif the interaction can occur, orActionResult.SUCCESSif 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:
trueif the player can interact with the death chest, or otherwisefalse.
-
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 istrueand 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:
trueif the death chest should be broken, or otherwisefalse.
-
-