-
How to get server side capabilities and config from client?
One more thing if I may ask. If I need to perfrom some action on that server side capabilities depending on user interaction in GUI, I need to send packet with message from client to server?
-
How to get server side capabilities and config from client?
¯\_(ツ)_/¯
-
How to get server side capabilities and config from client?
I see, I thought there is some magic way to call player.getCapability() on client side and get the same results as on server side. Thanks, I know what to do now.
-
How to get server side capabilities and config from client?
Hello, I've attached some capabilities to players on server side, but I need that data to display in GUI. I know I'm supposed to sync it to client but it's a bit vague. Can someone give me few pointers or examples? I'm able to put all needed data in extraDataWriter while using NetworkHooks.openGui but I need to write another serializer/deserializer for capability data. Does syncing capability data allows me to skip that? Also in the same GUI I need some config values that are set server-side, how can I access that? Is there a way to sync configs, or I need to use extraDataWriter for this?
-
Few, mostly trival questions, to help me avoid mistakes and understand how to build a mod
Even if it's like simple string or int value? For example I have an item that user can right click and his player UUID should be "stored in" the item, this should use capabilities too? What's NBT for then?
-
Few, mostly trival questions, to help me avoid mistakes and understand how to build a mod
I've started working on a mod and it's been a bit of a bumpy ride. Mostly due to lack of recent and decent information, examples or simple know-how about internal workings. Finding outdated tutorials doesn't help either, and from what I've already read and seen in code (looking at 1.16 mods at github was mostly helpful) I got a bit confused. So please help me understand few things. Here's my questions: I want to attach some simple data to some ItemStack and TileEntity, is using getOrCreateTag() for ItemStack and getTileData() for TileEntity the way to go? or should I use capabilities for it? If I'm setting tag for ItemStack or TileEntity, should I do this on server side only or both? I wanted to play a sound during onItemUse and I've used context.getPlayer().playSound() which is ran on render and server thread, but only player using item is hearing the sound, according to Forge documentation this method on render thread should play for current player (and it does) and on server side it should send play message to all other players (this doesn't work) If I want to store some custom "world" data that isn't specific to any block/item/chunk I should use capabilities and attach it to the world?
IPS spam blocked by CleanTalk.