Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[1.19.2] Send package to server whit 2 int values if posible adding an specific itemstack

Featured Replies

Posted

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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.