Solved PluginMessageListener

Discussion in 'Plugin Development' started by dvargas135, Dec 5, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    dvargas135

    Hi,
    How do I send a byte to a channel? I'm trying to block a mod

    I've tried this:
    Code:
    public void onPluginMessageReceived(String channel, Player player, byte[] value) {
           
      if (getConfig().getBoolean("block")) {
          if (channel.equalsIgnoreCase("channel")) {
                  player.sendPluginMessage(this, "channel", new byte[] { 0x3F });
          }
      }
    With registering both outgoing and incoming plugin channels, as said by the mod author
     
    Last edited: Dec 5, 2015
  2. Offline

    adam753

    What is this? Bungee?
     
  3. Offline

    dvargas135

    No it isn't

    I have also tried ByteArrayDataOutput out = ByteStreams.newDataOutput();
    then out.writeByte(0x3F);
    then send the bytes as an array using out.toByteArray, but didn't work
     
    Last edited: Dec 5, 2015
  4. Offline

    mcdorli

    What API/mod/thing do you use? Should this be an event?
     
  5. Offline

    dvargas135

    .

    Nevermind, got it working using byte arrays.
     
    Last edited by a moderator: Dec 5, 2015
  6. Offline

    Scimiguy

    @dvargas135
    Then edit the title of the thread and mark it as solved
     
Thread Status:
Not open for further replies.

Share This Page