#[1.21.10] Sending message from a player to the other players

6 messages · Page 1 of 1 (latest)

brisk void
#

So, before 1.21.9/10, to send a message from a player to the other players was something trivial.
You would get the server from the server player entity and from there you would be able to get the players list.

Unfortunately, the method to get the server from the player was removed in 1.21.9/10.
Is there another easy way to get the list of players from the player server, without having to inject a mixin in the ServerPlayerEntity to expose the server?

Thanks in advance!

#

P.S. I am using Mojomap instead of Yarn, if that's relevant.

viscid lark
#

probably just need an accessor

#

!!accessor

dire ospreyBOT
#

io/github/mymod/mixin/MyClassAccess

@Mixin(MyClass.class)
public interface MyClassAccess {
  @Invoker void callAccess();
  @Accessor int getMyField();
}

to use it

public class Container {
  public void slapHaykam(MyClass instance) {
     ((MyClassAccess)instance).callAccess();
  }
}
brisk void
#

Yeah, I was trying to see if there was a way without mixins 🙂 But it's fine 🙂
Thanks!