tutorial:networking
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tutorial:networking [2022/02/09 16:54] – external edit 127.0.0.1 | tutorial:networking [2023/04/16 01:04] – proper packet id - I hate this editor already fx | ||
---|---|---|---|
Line 13: | Line 13: | ||
Say you had a wand which highlights the block you are looking at to all nearby players. | Say you had a wand which highlights the block you are looking at to all nearby players. | ||
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
- | class HighlightingWandItem extends Item { | + | public |
public HighlightingWand(Item.Settings settings) { | public HighlightingWand(Item.Settings settings) { | ||
super(settings) | super(settings) | ||
Line 79: | Line 79: | ||
Next, we need to send the packet to the game client. First, you need to define an '' | Next, we need to send the packet to the game client. First, you need to define an '' | ||
+ | <code java> | ||
+ | public class TutorialNetworkingConstants { | ||
+ | // Save the id of the packet so we can reference it later | ||
+ | public static final Identifier HIGHLIGHT_PACKET_ID = new Identifier(" | ||
+ | } | ||
+ | </ | ||
To send the packet to the player, we will use some of the methods inside of '' | To send the packet to the player, we will use some of the methods inside of '' |
tutorial/networking.txt · Last modified: 2024/05/04 19:51 by bluemeanial · Currently locked by: l1ttle