Advertisement
Guest User

Untitled

a guest
Mar 28th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. static void openChestAndDropSlot(BlockPos pos, int slot,boolean dropstack){
  2. Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C08PacketPlayerBlockPlacement(pos,(double)pos.getY()+0.5D < Minecraft.getMinecraft().thePlayer.posY + 1.7D ? 1:0,Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem(),0.0F,0.0F,0.0F));
  3. Minecraft.getMinecraft().thePlayer.swingItem();
  4. new Thread( new Runnable() {
  5. public void run() {
  6. try { Thread.sleep( 1000 ); }
  7. catch (InterruptedException ie) {}
  8. ContainerChest containerchest = (ContainerChest) (ContainerChest) Minecraft.getMinecraft().thePlayer.openContainer;
  9. System.out.println(containerchest.getInventory());
  10. Minecraft.getMinecraft().playerController.windowClick(containerchest.windowId, slot, dropstack?1:0, 4, Minecraft.getMinecraft().thePlayer);
  11. Minecraft.getMinecraft().thePlayer.closeScreen();
  12.  
  13. }
  14. } ).start();
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement