Posted August 16, 20205 yr So, as the title already suggests, I need some help figuring out, how I would approach to save who placed my specific block in the world. I already tried coming up with a Block with such properties, which is in the native game but couldn’t think of one. I already tested around with some tile-entities but scrapped the code afterwards, because I couldn’t make it work. The Mod is being implemented in Minecraft-Version 1.15.2. I am glad for every piece of advice you guys can give me!
August 16, 20205 yr Quote I couldn’t make it work What did you do and why do you think it is not working? Also you might find SkullTileEntity helpful since it stores player's data in it as well.
August 17, 20205 yr You'd want a tile entity with a UUID field that saves to NBT. Then, override onBlockPlacedBy in your Block class, get the tile entity, cast it to your TE type after an instanceof check, and set the uuid field to the provided player's UUID. All Projects found here: Website Main Programmer for: Better Animals Plus, Better Animal Models Created independently: QuickHomes, ClaimIt, ClaimIt API, CloneLand, DerpCats, QuickTeleports, QuickSpawns, MCMusicPlayer, MCDevDate, [SBM] Fluid Gun, OpenScreens Work on/Contribute to: Bewitchment Commissioned for: [SBM] Breadstone, [SBM] Infinite Falling, [SBM] Dead Man's Satchel, [SBM] Handheld Piston
August 17, 20205 yr Author 7 hours ago, hiotewdew said: You'd want a tile entity with a UUID field that saves to NBT. Then, override onBlockPlacedBy in your Block class, get the tile entity, cast it to your TE type after an instanceof check, and set the uuid field to the provided player's UUID. I now got it working this way, thank you very much for the help!
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.