Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

LiquidBounce Forum

  1. Home
  2. Kotlin/Java
  3. How to correctly check other players' inventory?

How to correctly check other players' inventory?

Scheduled Pinned Locked Moved Kotlin/Java
8 Posts 5 Posters 784 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I used this code in my Client(mcp937, Java) to check how many Totems your competitor have:

    String totems = String.format("Totem: %d", target.inventoryContainer.inventorySlots.stream().filter(slot -> slot.getStack().getItem() == Items.field_190929_cY/*Totem*/).mapToInt(slot -> slot.getStack().stackSize).sum());
    

    but when I play in server, it seems that can only count my target's off hand. how can I fix it?

    Painis BotP 1 Reply Last reply
    0
    • LolMCL Offline
      LolMCL Offline
      LolMC
      wrote on last edited by
      #2

      idk
      i only do script for lb 1.8.9
      because lb 1.12 not update,a lot bug,..etc

      1 Reply Last reply
      0
      • TemmT Offline
        TemmT Offline
        Temm
        Moderator
        wrote on last edited by
        #3

        On servers, the client only gets Items that it can actually see, meaning armor slots, hand (and offhand).
        You can't do anything about this, as the server just doesn't send you that information.

        ? 1 Reply Last reply
        0
        • TemmT Temm

          On servers, the client only gets Items that it can actually see, meaning armor slots, hand (and offhand).
          You can't do anything about this, as the server just doesn't send you that information.

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          @Temm Thanks for explaining that!

          1 Reply Last reply
          0
          • ? A Former User

            I used this code in my Client(mcp937, Java) to check how many Totems your competitor have:

            String totems = String.format("Totem: %d", target.inventoryContainer.inventorySlots.stream().filter(slot -> slot.getStack().getItem() == Items.field_190929_cY/*Totem*/).mapToInt(slot -> slot.getStack().stackSize).sum());
            

            but when I play in server, it seems that can only count my target's off hand. how can I fix it?

            Painis BotP Offline
            Painis BotP Offline
            Painis Bot
            wrote on last edited by Painis Bot
            #5
            This post is deleted!
            CzechHekC 1 Reply Last reply
            0
            • Painis BotP Painis Bot

              This post is deleted!

              CzechHekC Offline
              CzechHekC Offline
              CzechHek
              wrote on last edited by
              #6

              @ender1355 who asked?

              Painis BotP 1 Reply Last reply
              0
              • CzechHekC CzechHek

                @ender1355 who asked?

                Painis BotP Offline
                Painis BotP Offline
                Painis Bot
                wrote on last edited by
                #7

                @czechhek check the tags of this: https://namemc.com/skin/b6df60aa1357b37d

                CzechHekC 1 Reply Last reply
                0
                • Painis BotP Painis Bot

                  @czechhek check the tags of this: https://namemc.com/skin/b6df60aa1357b37d

                  CzechHekC Offline
                  CzechHekC Offline
                  CzechHek
                  wrote on last edited by
                  #8

                  @ender1355 who asked 2?

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  About
                  • Terms of Service
                  • Privacy Policy
                  • Status
                  • Contact Us
                  Downloads
                  • Releases
                  • Source code
                  • License
                  Docs
                  • Tutorials
                  • CustomHUD
                  • AutoSettings
                  • ScriptAPI
                  Community
                  • Forum
                  • Guilded
                  • YouTube
                  • Twitter
                  • D.Tube
                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups