BBMP tags

May 21, 2017
BBMP tags
  • BBMP TAGS
    RunCommand:
    Variables: (String command)
    Description: Run a command on the server's console.
    Example Usage:
    Code (Java):
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(stream);
        try {
            out.writeUTF("runcommand");
            out.writeUTF("reload");
        } catch (Exception e) {
            e.printStackTrace();
        }
        BungeeCord.getInstance().getServerInfo("myServerName").sendData("BungeeCord", stream.toByteArray());
    RunCommandThroughPlayer:
    Variables: (String playerName, String command)
    Description: Run a command on the player.
    Example Usage:
    Code (Java):
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(stream);
        try {
            out.writeUTF("runcommandthroughplayer");
            out.writeUTF("reload");
            out.writeUTF("Z3tr0nix");
        } catch (Exception e) {
            e.printStackTrace();
        }
        BungeeCord.getInstance().getServerInfo("myServerName").sendData("BungeeCord", stream.toByteArray());
    PlaceBlock:
    Variables: (String worldName, Double x, Double y, Double z, String blockType)
    Description: Place the defined block at the defined location.
    Example Usage:
    Code (Java):
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(stream);
        try {
            out.writeUTF("placeblock");
            out.writeUTF("world");
            out.writeDouble(0);
            out.writeDouble(1);
            out.writeDouble(0);
            out.writeUTF("grass_block");
        } catch (Exception e) {
            e.printStackTrace();
        }
        BungeeCord.getInstance().getServerInfo("myServerName").sendData("BungeeCord", stream.toByteArray());
    PlayGlobalSound:
    Variables: (String soundName, String worldName, Double x, Double y, Double z, Integer volume, Integer pitch)
    Description: Play a sound at the defined location with the defined volume and pitch.
    Example Usage:
    Code (Java):
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(stream);
        try {
            out.writeUTF("playglobalsound");
            out.writeUTF("BLOCK_NOTE_PLING");
            out.writeUTF("world");
            out.writeDouble(0);
            out.writeDouble(1);
            out.writeDouble(0);
            out.writeInt(10);
            out.writeInt(1);
        } catch (Exception e) {
            e.printStackTrace();
        }
        BungeeCord.getInstance().getServerInfo("myServerName").sendData("BungeeCord", stream.toByteArray());
    PlayPlayerSound:
    Variables: (String soundName, String worldName, Double x, Double y, Double z, Integer volume, Integer pitch, String playerName)
    Description: Play a sound at the defined location with the defined volume and pitch for only the desired player.
    Example Usage:
    Code (Java):
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(stream);
        try {
            out.writeUTF("playplayersound");
            out.writeUTF("BLOCK_NOTE_PLING");
            out.writeUTF("world");
            out.writeDouble(0);
            out.writeDouble(1);
            out.writeDouble(0);
            out.writeInt(10);
            out.writeInt(1);
            out.writeUTF("Z3tr0nix");
        } catch (Exception e) {
            e.printStackTrace();
        }
        BungeeCord.getInstance().getServerInfo("myServerName").sendData("BungeeCord", stream.toByteArray());
    SetSpeed:
    Variables: (String playerName, String type {only put fly and walk}, Integer speed)
    Description: Set the defined speed of the defined player in the defined mode
    Example Usage:
    Code (Java):
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(stream);
        try {
            out.writeUTF("setspeed");
            out.writeUTF("Z3tr0nix");
            out.writeUTF("fly");
            out.writeInt(1);
        } catch (Exception e) {
            e.printStackTrace();
        }
        BungeeCord.getInstance().getServerInfo("myServerName").sendData("BungeeCord", stream.toByteArray());
    PlayerHasPermission:
    Variables: (String playerName, String permission)
    Description: Responds if the player has the defined permission.
    Returns: Boolean (true/false)
    Example Usage:

    Sending class:
    Code (Java):
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(stream);
        try {
            out.writeUTF("playerhaspermission");
            out.writeUTF("Z3tr0nix");
            out.writeUTF("some.bukkit.permission");
        } catch (Exception e) {
            e.printStackTrace();
        }
        BungeeCord.getInstance().getServerInfo("myServerName").sendData("BungeeCord", stream.toByteArray());
    Recieving class:

    Code (Java):
        @EventHandler
        public void onPluginMessage(PluginMessageEvent e) {
            if (e.getTag().equalsIgnoreCase("BungeeCord")) { //this is not tested, should work but if doesnt please report with logs
                DataInputStream in = new DataInputStream(new ByteArrayInputStream(e.getData()));
                String subchannel = in.readUTF();
                if(subchannel.equalsIgnoreCase("playerpermission"))
                try {
                     String playerName = in.readUTF();
                     String permission = in.readUTF();
                     Boolean ifPlayerHasPermission = in.readBoolean();
                } catch (IOException e1) {
                    e1.printStackTrace();
                }

            }
        }
    TeleportPlayer:
    Variables: (String playerName, String world, Double X, Double Y, Double Z)
    Description: Teleports the defined player to the defined location.
    Example Usage:
    Code (Java):
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(stream);
        try {
            out.writeUTF("teleportplayer");
            out.writeUTF("Z3tr0nix");
            out.writeUTF("world");
            out.writeDouble(0);
            out.writeDouble(64);
            out.writeDouble(0);
        } catch (Exception e) {
            e.printStackTrace();
        }
        BungeeCord.getInstance().getServerInfo("myServerName").sendData("BungeeCord", stream.toByteArray());
    GetPlayerCords:
    Variables: (String playerName)
    Description: Responds with the player location.
    Sending class:
    Code (Java):
                        ByteArrayOutputStream stream = new ByteArrayOutputStream();
                        DataOutputStream out = new DataOutputStream(stream);
                        try {
                            out.writeUTF("getplayercords");
                            out.writeUTF(p.getName());
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        BungeeCord.getInstance().getServerInfo("myServerName").sendData("BungeeCord", stream.toByteArray());

    Receiving class:
    Code (Java):
        @EventHandler
        public void onPluginMessage(PluginMessageEvent e) {
            if (e.getTag().equalsIgnoreCase("BungeeCord")) {
                DataInputStream in = new DataInputStream(new ByteArrayInputStream(e.getData()));
                String subchannel = in.readUTF();
                if(subchannel.equalsIgnoreCase("playerpermission"))
                try {
                     String playerName = in.readUTF();
                     String worldName = in.readUTF();
                     Double x = in.readDouble();
                     Double y = in.readDouble();
                     Double z = in.readDouble();
                } catch (IOException e1) {
                    e1.printStackTrace();
                }

            }
        }
    Inventory
    Get
    Variables: (String inventoryName)
    Note: If inventory is created by an external plugin or bound to a block then you can not edit it.
    Note: If inventory is a villager/player inventory just get the villager/player's unique id.
    SetItem

    Variables: (String itemType, Integer amount, Short dataValue, Integer positionInInventory)
    Description: Set an item in the defined inventory.
    Example Usage:
    Code (Java):
                        ByteArrayOutputStream stream = new ByteArrayOutputStream();
                        DataOutputStream out = new DataOutputStream(stream);
                        try {
                            out.writeUTF("inventory");
                            out.writeUTF("get");
                            out.writeUTF(p.getUniqueId());
                            out.writeUTF("setitem");
                            out.writeUTF("WOOL");
                            out.writeInt(64);
                            out.writeShort(1);
                            out.writeInt(8);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        BungeeCord.getInstance().getServerInfo("myServerName").sendData("BungeeCord", stream.toByteArray());
    Create
    Variables: (Integer size, String title)
    Example Usage:
    Code (Java):
                        ByteArrayOutputStream stream = new ByteArrayOutputStream();
                        DataOutputStream out = new DataOutputStream(stream);
                        try {
                            out.writeUTF("inventory");
                            out.writeInt(8);
                            out.writeUTF("Bukkit Bungee Messaging Plus");
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        BungeeCord.getInstance().getServerInfo("myServerName").sendData("BungeeCord", stream.toByteArray());
  • Loading...
  • Loading...