How to correctly check other players' inventory?
-
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?
-
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.@Temm Thanks for explaining that!
-
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?
This post is deleted! -
This post is deleted!
@ender1355 who asked?
-
@ender1355 who asked?
@czechhek check the tags of this: https://namemc.com/skin/b6df60aa1357b37d
-
@czechhek check the tags of this: https://namemc.com/skin/b6df60aa1357b37d
@ender1355 who asked 2?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login