Jump to content

[1.12.2] #onBlockPlacedBy not working clientside


Recommended Posts

My block is supposed to save the block placer as the owner when it is placed which it does correctly on both client and server side but when checking it afterwords anywhere else it only shows up server-side. Anyone know why?





Edited by BeardlessBrady
Link to comment
Share on other sites

I was playing around with things since it wasn't saving correctly, saving it as a string was one of those things.

I have tried adding tile.markDirty() after setting owner but it doesn't seem to have changed anything, what exactly do I need to do to re-send the packet?



Link to comment
Share on other sites

Background: I have a base tile entity I extend the tile entity off of which is where the owner is created and saved via NBT stuff.


Peculiarly if I move the NBT stuff for the owner to the main tile not the one its extended everything works fine despite the nbt methods running super first? 


EDIT: I figured it out. So when @Overriding #getUpdatePacket() I was just doing:

NBTTagCompound compound = new NBTTageCompound;

but I didn't realize that wasn't using the super's method correctly so I changed it to:

NBTTagCompound compound = super.getUpdatePacket().getNbtCompound();


Thanks for trying to help!

Edited by BeardlessBrady
Link to comment
Share on other sites

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.