Posted March 4, 20232 yr Good days Im working to make a way soo i can hold left click and behave like hold right click but doing an different action i find and old video form mi mod in 1.8 this is one of the things i would like to accomplish in this case the gun shoots by holding right click and the chainsaw works by holding left click minecraft ticks are a little unconstant sometimes there's lag and damage calculations soo to more or less precisely calculate how mutch time the player has hold and release the left click button i need two values int ontime = 0; int offtime = 0; this values only happens in the client side soo i need to send those values back to serverside i been following kapenhoe tutorials but he don't show how to actually serialize and send values im pretty sure thats done in this to methods public ExampleC2SPacket(FriendlyByteBuf buf) { } public void toBytes(FriendlyByteBuf buf) { } ################################### in this case i need to send values to an item capability soo if is possible to specifies the itemstack in the package it would be just perfect something like public ExampleC2SPacket(ItemStack mark) { FriendlyByteBuf buf = mark.getcapability.serializeallthevaluesinsidethecapability(); send_to_server(buf) } public void toBytes(FriendlyByteBuf buf) { Itemstack mark = itemsendedfromtheclientside; mark.getcapability.deserializethisvalues(buff); } this is the spefic tutorial i benn follow ########################################## well i need a guidance on how to send values using packages and also the itemstack if its possible thanks for your time
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.