mojira.dev
MC-118841

Changing inventory with an inventory_changed advancement function reward doesn't update client

Summary

Attached is a ZIP file containing an advancement and a function. The advancement simply triggers for any inventory_changed, and rewards the player with the function.
The function updates the player's inventory. This behavior can be observed when the function clears the player's inventory or puts items there with /replaceitem. The function lastly revokes the advancement so it can be earned again.

Upon updating the inventory, the changes are not applied client-side. That is, if the player's inventory was cleared, it would still appear to contain ghost items. If the player was given items, they would not appear until the slot were updated somehow.

Linked issues

Attachments

Comments 13

tryashtar

Can you attach your advancements and functions? Your conclusion can't be true if I'm understanding properly, because consider the following function:

clear @a
replaceitem entity @a slot.hotbar.0 stone
clear @a
replaceitem entity @a slot.weapon fish

Expected behavior is for a fish to end up in your hand with no other visual side effects, and actual behavior is just that.

Panossa

Added them @tryashtar

tryashtar

Copied incorrectly, thanks, haha

Panossa

Changed the zip. (still the same but different names). What did I copy incorectly?

Panossa

Also added "Edit 3" with a video of your function file tryashtar.

3 more comments
Matic

It doesn't only happen if function is triggered by advancement, I made it loop by gamerule and the items would still appear to be ghosted.

user-f2760

This appears to be the same issue as MC-29318.

Rxgamer

Confirmed for 1.12.1

Skylar Rose

Confirmed for Snapshot 17w43b

Arisa Bot

Thank you for your report!
We're tracking this issue in MC-187281, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automagically! Please report any issues in Discord or Reddit

Panossa

(Unassigned)

Confirmed

advancement, inventory, inventory_changed

Minecraft 1.12

Retrieved