Very recently I've been exploring everything about Bukkit to the best of my abilities. I've been trying to learn everything I will need to develop a great plugin. And so far, things have been going pretty well. Then, I knew I had to get into some of the hard stuff such as NMS. But, for now, I really want to learn about packets. I read through some of the classes about packets, but they are really complicated. I want to test to see what everything does, but I have no idea where to start. And when I try to research about it, almost everything I find is completely outdated. Can someone please explain to me a little bit about how packets work and how I could begin playing around with them, it would be really helpful. Thanks.
@1928i Outgoing packets tell the client what to display/do (EX: Spawn a mob). Incoming packets tell the server what the client is doing (EX: breaking a block).
@1928i Well if you want to know how to send a packet to a Player, you just do the following: Code: ((CraftPlayer) player).getHandle().playerConnection.sendPacket(<Packet here>);
@Skionz @nverdier Thanks for the help so far. How do I edit a packet to make it do what I want to do. Also, how do I send a packet to the server?
@nverdier One, I kind of want to make my own plugins and understand it fully. Two, how do I format a packet so that I can manipulate it?
@nverdier Ok, I will try this out, I will make another post if I need anymore help. @nverdier Can I see an example of packets in action. For instance, how would you make it so some players see your name as blue, while others see it as red? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Please stop posting micro-tutorials for people when there are actual tutorials for what is being discussed. @1928i Google search does wonderful things: http://dev.bukkit.org/bukkit-plugins/protocollib/pages/tutorial/
Something like this is actually quite complex without the use of protocol lib, so if you want to do it all yourself with no library I would start with something like sending a basic particle or an entity animation.