Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-79081

Server sends unnecessary data to the client (Command Block commands)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • None
    • Minecraft 1.8.3
    • None
    • Linux 14.04, 128gb ram, Xeon E5-1650v2, 2x240gb SSDs, 1gbit up/down
    • Unconfirmed

      As much as I love the idea of open sourced code, there is some code that is my bread and butter. As the #1 Vanilla server owner in the world, I fully rely on my commands and command blocks to run the various parts of my server. Lately I have had other servers come on and use a wold downloader to steal my commands. The problem lyes in the fact that the tile data of command blocks are sent to everyone no matter what gamemode they are.

      Below is some code directly out of MCP:

      private void sendTileEntityUpdate(TileEntity p_147097_1_)
      
      {
        if (p_147097_1_ != null) {
          Packet var2 = p_147097_1_.getDescriptionPacket();
      
          if(p_147097_1_.getBlockType().getLocalizedName().contains("Command Block") && !this.capabilities.isCreativeMode) {
                var2 = null;
          }
              
          if (var2 != null) {	
            this.playerNetServerHandler.sendPacket(var2);
          }
        }
      }
      

      This code is located in “net.minecraft.entity.player.EntityPlayerMP” at about line 650. var2 is set to the descriptor packet of the block. It will then check if the block is a command block and the player is not in creative (the only gamemode that allows interaction with command blocks). If they have no reason to see the commands in the command blocks it will just set the packet to null and it will never send the commands. I think this could also be a performance boost as it wont need to send large packets every time a player requests the spawn chunks.

      Thanks for looking at my report and I hope we can do something about this ASAP.

      CraftyMyner of CraftyMynes Vanilla server

            grum [Mojang] Grum (Erik Broes)
            craftymyner Alex
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: