diff --git a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/InventoryManagerPeripheral.java b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/InventoryManagerPeripheral.java index 4fc4f40e7..9bc0f5539 100644 --- a/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/InventoryManagerPeripheral.java +++ b/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/InventoryManagerPeripheral.java @@ -189,7 +189,15 @@ public final int getFreeSlot() throws LuaException { @LuaFunction(mainThread = true) public final Map getItemInHand() throws LuaException { - return LuaConverter.itemStackToObject(getOwnerPlayer().getMainHandItem().copy()); + return LuaConverter.stackToObjectWithSlot( + getOwnerPlayer().getMainHandItem().copy(), + getOwnerPlayer().getInventory().selected + ); + } + + @LuaFunction(mainThread = true) + public final int getSelectedSlot() throws LuaException { + return getOwnerPlayer().getInventory().selected; } @LuaFunction(mainThread = true)