Class PlayerInvUtil

java.lang.Object
alexiil.mc.lib.attributes.misc.PlayerInvUtil

public final class PlayerInvUtil
extends java.lang.Object
Various methods for getting Reference's and Consumer's from a PlayerEntity's various inventories.
  • Method Summary

    Modifier and Type Method Description
    static java.util.function.Consumer<net.minecraft.item.ItemStack> createPlayerInsertable​(net.minecraft.entity.player.PlayerEntity player)
    Returns a Consumer that will call insertItemIntoPlayerInventory(net.minecraft.entity.player.PlayerEntity, net.minecraft.item.ItemStack) for every ItemStack passed to it.
    static void insertItemIntoPlayerInventory​(net.minecraft.entity.player.PlayerEntity player, net.minecraft.item.ItemStack stack)
    Either inserts the given item into the player's inventory or drops it in front of them.
    static Reference<net.minecraft.item.ItemStack> referenceGuiCursor​(net.minecraft.server.network.ServerPlayerEntity player)
    Creates a Reference to the given player's cursor stack, that updates the client whenever it is changed.
    static Reference<net.minecraft.item.ItemStack> referenceHand​(net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.Hand hand)
    Creates a Reference to the what the player is currently holding in the given Hand.
    static Reference<net.minecraft.item.ItemStack> referenceSlot​(net.minecraft.screen.slot.Slot slot)
    Creates a Reference to the given Slot.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details