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.

Featured Replies

31 minutes ago, SunnyLo said:

How do I check if the "EntityPlayerMP" to the player that is playing?

On the server:

The player in the message context IS the player that sent the packet

 

On the client:

The player that received the message IS the player that is playing...

 

What more do you need?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author
11 hours ago, Draco18s said:

On the server:

The player in the message context IS the player that sent the packet

 

On the client:

The player that received the message IS the player that is playing...

 

What more do you need?

EntityPlayer entityPlayer = Minecraft.getMinecraft().thePlayer;
if (entityPlayer == serverPlayer) {
    System.out.println(msg);
}

 

Like this?

  • Author
47 minutes ago, diesieben07 said:

This is not a spigot forum. The real answer is: Switch to Sponge, Bukkit is dead.

But if I use sponge, every player MUST install this mod, I just want this mod to be extra. Such as betterpvp mod or 5zig.

 

Please correct me if I'm wrong

Edited by SunnyLo

7 hours ago, SunnyLo said:

EntityPlayer entityPlayer = Minecraft.getMinecraft().thePlayer;
if (entityPlayer == serverPlayer) {
    System.out.println(msg);
}

 

Like this?

 

This check makes no fucking sense.

On the server, the player that sent the packet is the only player that matters.

On the client, when the client receives the packet, that player is the only player that matters.

Do not perform this check. You do not need it. Just act on the context's player.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

Okay, so sponge is actually a bukkit replacement. So can spigot plugins work on sponge server?

And what should I do to perform the check?

  • Author
13 hours ago, diesieben07 said:

You are sending the packet to the client, why are you registering it for both directions in Forge?

Because I want to send packets both from spigot to forge and forge to spigot.

 

13 hours ago, diesieben07 said:

No. No no no. Read and understand: https://mcforge.readthedocs.io/en/latest/concepts/sides/

I'll remove the thing.

 

13 hours ago, diesieben07 said:

On the Forge side you are using readUTF8String, which expects the text to be prefixed with it's byte-length as a VarInt (look at the code if you are unsure). The format for your message must match between sending and receiving end.

I've found this thread which someone ask the same thing as me. But he/you didn't show the code. Can you post an example code of using ByteArrayDataOutput?

http://www.minecraftforge.net/forum/topic/59154-communication-between-forge-mod-and-bukkit-plugin/

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.