Jump to content

GThoro

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by GThoro

  1. 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?
  2. 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.
  3. 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?
  4. 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?
  5. 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?
×
×
  • Create New...

Important Information

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