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

Give command enchantment does not check for nonsensical statements

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • None
    • 1.14.4, 19w38b
    • Windows 7, Java 12
    • Unconfirmed
    • Survival
    • (Unassigned)

      The command of give allows the player to obtain objects with enchantments, as intended. The following command functions perfectly:

      _/give Player diamond_sword{Enchantments:[

      {id:"sharpness",lvl:3}

      ,{id:"unbreaking",lvl:3}]}_

      However, the command does not check whether the enchantment is defined or not. Therefore, it is possible to type something as follows, which will execute:

      _/give Player diamond_sword{Enchantments:[

      {id:"asdf",lvl:3}

      , {id:"asfd",lvl:3}]}_

      This will give the targeted player an enchanted diamond sword that is identical to a normal one, but the two undefined enchantments are still stored within the level.dat file, in the player inventory (shown in Capture, Capture2 and Capture3). This takes up computer space that is entirely unnecessary.

      Furthermore, if you misspell the word Enchantments, the sword will not be enchanted, but the data will also be stored in level.dat. For example,

       _/give Player diamond_sword{Something:[

      {id:"asdf",lvl:3}

      ]}_

      gives the Player a diamond sword without any difference from a normal one, but the attribute "Something" is stored in level.dat

      (shown in Capture4 and Capture5).

        1. Capture.PNG
          Capture.PNG
          779 kB
        2. Capture2.PNG
          Capture2.PNG
          691 kB
        3. Capture3.PNG
          Capture3.PNG
          247 kB
        4. Capture4.PNG
          Capture4.PNG
          1.33 MB
        5. Capture5.PNG
          Capture5.PNG
          254 kB

            Unassigned Unassigned
            Republic_Aviation Hermann Fegelein
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: