Navigation

    CCBlueX Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    How to correctly check other players' inventory?

    Kotlin/Java
    3
    4
    118
    Loading More Posts
    • 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.
    • ?
      A Former User last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • LolMC
        LolMC last edited by

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

        1 Reply Last reply Reply Quote 0
        • Temm
          Temm Moderator last edited by

          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 Reply Quote 0
          • ?
            A Former User @Temm last edited by

            @Temm Thanks for explaining that!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB | Contributors