#Canceling block placing desyncs on the client, gives ghost item

12 messages · Page 1 of 1 (latest)

fathom whale
#

Video is from a friend's perspective of the situation. Whenever a block placement is cancelled, it causes a desync on the client side, causing a ghost item to appear when clicking the empty slot. I'm not sure how to fix this.
Current script: ```js
BlockEvents.placed(event => {
if (event.player.persistentData.withinClaim > 0) {
event.cancel()
let item = event.block.item.copy()
event.player.give(item)
}
})

fickle pantherBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

covert prairie
#

there was a thing to force an update on the player inventory, no? ;o

fathom whale
#

i forget

covert prairie
#

e.player.sendInventoryUpdate()

fathom whale
#

sendInventoryUpdate doesn't work

covert prairie
#

i also had this saved

#

e.entity.inventoryMenu.broadcastFullState()

#

not sure if its applicable

fathom whale
#

that worked

#

thanks