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

Macro commands ignore function-permisson-level server setting, including when lower than default

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 23w51a
    • 1.20.2, 23w43a, 23w43b
    • None
    • Plausible
    • Commands
    • Important
    • Platform

      This bug relates to MC-266135. Running macro functions from chat is known to trigger MC-266135, which interferes with the behavior described in this bug.

      The function-permisson-level setting in server.properties allows controlling the standard operator permission level for functions. However, this setting is ignored for commands that include macros. Instead the permission level always seems to default to 2. Non-macro commands still respect the setting.

      Scenario 1 (permissions downgraded): function-permisson-level=4 allows putting level 3 or 4 commands inside functions, but will not allow macros that run level 3 or 4 commands.

      How to reproduce Scenario 1:
      1. Create a new creative mode server, ensuring to set function-permisson-level=4 in server.properties before starting it.
      2. Op yourself and activate the attached data pack.
      3. Run the following command to check the whitelist:

      /whitelist list

      Result: Alex is added to the whitelist, but not Steve. (This is because Steve's command uses a macro, while Alex's does not. The pack makes continuous attempts to run both of them.)

       

       

      Scenario 2 (permissions upgraded): function-permisson-level=0 does not allow putting level 2 commands inside functions, but will allow macros that run level 2 commands. This could allow someone to run a command on a server despite the owner downgrading the function permission level.

      How to reproduce Scenario 2:
      1. Create a new creative mode server, ensuring to set function-permisson-level=0 in server.properties before starting it.
      2. Op yourself and activate the attached data pack.
      3. Copy the following into a command block and activate it:

      /function test:time_normal

      Result: Function fails to run. (Correct behavior, the permission level of the time command is higher than 0)
      4. Copy the following into a command block and activate it:

      /function test:weather_macro {state:"thunder"}

      Result: Function successfully runs from command block. (Incorrect behavior triggered by the use of a macro, the permission level of the weather command is higher than 0)

       

            gegy1000 [Mojang] Gegy
            AmberW Amber
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: