Skip to main content

槽位

int  inventory.getSlot()                   // 当前 hotbar 选中(0-8)
void inventory.setSlot(int slot)
int  inventory.getSize()                   // 玩家背包总槽数
ItemStack inventory.getStackInSlot(int slot)
void inventory.open()                      // 打开自己背包 GUI

容器 / 箱子

String    inventory.getChest()             // 当前箱子标题(非箱子空串)
int       inventory.getChestSize()
String    inventory.getContainer()         // 任意打开容器的标题
ItemStack inventory.getStackInChestSlot(int slot)

交互点击

inventory.click(int slot, int button, int mode)
mode
mode动作
0PICKUP(普通左右键)
1QUICK_MOVE(shift+click)
2SWAP(数字键换 hotbar,button = 目标 hotbar 槽)
3CLONE(创造中键)
4THROW(Q 扔)
5QUICK_CRAFT(拖拽分堆)
6PICKUP_ALL(双击整理)

List<String> inventory.getBookContents()    // 主手 written/writable book 的 pages

Slot spoof

void    inventory.startSpoof(int slot)     // 静默切槽(用户不感知)
void    inventory.stopSpoof()
boolean inventory.isSpoofing()
void    inventory.switchTo(int slot)       // 正常切(用户第一视角会渲染)
boolean inventory.switchBack()             // 切回 switchTo 之前