• Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Affects Version/s: None
    • Environment:

      Java 8

    • Spigot 1.13-pre7 - API 1.13-pre7-R0.1-SNAPSHOT (git-Spigot-83d9209-3e5fe3e)

      When loading a world with a datapack, the datapack fails to load any .mcfunction file with commands in it with the following error:

      [05:01:50 ERROR]: Couldn't load function at dmz:functions/_give/pickaxe/torchwood.mcfunction
      java.util.concurrent.CompletionException: java.lang.NullPointerException
       at java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source) ~[?:1.8.0_172]
       at java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source) [?:1.8.0_172]
       at java.util.concurrent.CompletableFuture.uniApply(Unknown Source) [?:1.8.0_172]
       at java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source) [?:1.8.0_172]
       at java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source) [?:1.8.0_172]
       at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:1.8.0_172]
       at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) [?:1.8.0_172]
       at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:1.8.0_172]
       at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:1.8.0_172]
      Caused by: java.lang.NullPointerException
       at net.minecraft.server.v1_13_R1.CommandListenerWrapper.hasPermission(CommandListenerWrapper.java:126) ~[server.jar:git-Spigot-83d9d09-3e5fe3e]
       at net.minecraft.server.v1_13_R1.CommandGive.a(SourceFile:30) ~[server.jar:git-Spigot-83d9d09-3e5fe3e]
       at com.mojang.brigadier.tree.CommandNode.canUse(CommandNode.java:71) ~[server.jar:git-Spigot-83d9d09-3e5fe3e]
       at com.mojang.brigadier.CommandDispatcher.parseNodes(CommandDispatcher.java:176) ~[server.jar:git-Spigot-83d9d09-3e5fe3e]
       at com.mojang.brigadier.CommandDispatcher.parse(CommandDispatcher.java:156) ~[server.jar:git-Spigot-83d9d09-3e5fe3e]
       at net.minecraft.server.v1_13_R1.CustomFunction.a(CustomFunction.java:48) ~[server.jar:git-Spigot-83d9d09-3e5fe3e]
       at net.minecraft.server.v1_13_R1.CustomFunctionData.lambda$3(CustomFunctionData.java:169) ~[server.jar:git-Spigot-83d9d09-3e5fe3e]
       ... 7 more

       

      Once in the game I can run

      datapack disable "file/pack"

      then enable it again and it will load fine.  However, some commands do not run within the datapack when using Spigot but run fine when not running with Spigot.  Example command:

      execute as @s[type=trident,nbt={inGround:1b},tag=!UserTPd] at @s as @a[sort=random,limit=1] if score @s PlayerUID = @e[sort=random,type=trident,limit=1] PlayerUID run tag @s add TridentUser

      If I take the command apart and just run the first part up it's okay, like so:

      execute as @s[type=trident,nbt={inGround:1b},tag=!UserTPd] at @s as @a[sort=random,limit=1] run say test

      And running the second part is fine, like so:

      execute if score @s PlayerUID = @e[sort=random,type=trident,limit=1] PlayerUID run say test again

      But if the command is run as intended, as one long command, it does not run.  No error is given.

       

      These issues do not appear in non Spigot versions of server.jar.

       

      Update 1:

      Steps to reproduce the issue with the command itself (the command error happens to also occur when run from within the game, so it is not datapack specific) as well as an attached datapack which causes the loading error.

      /scoreboard objectives add Test dummy
      /scoreboard objectives setdisplay sidebar Test
      /summon cow
      /scoreboard players set @e[type=cow,sort=nearest,limit=1] Test 5
      /scoreboard players set @s Test 5
      /execute as @e[type=cow,limit=1] at @s as @a[sort=nearest,limit=1] if score @a[limit=1] Test = @e[sort=nearest,limit=1] Test run say hi
      

      The player should at this point say "hi", but they do not.  If you remove

      as @e[type=cow,limit=1] at @s

      the command will run as expected.

      Update 2:

      If you also change it so that it is not looking for an entity, but another player, the command will run as expected.  It seems to be tied to entities running tests within execute.

          [SPIGOT-4044] Datapack load errors and erroneous behavior

          The command issue that I listed seems related to SPIGOT-4046. Perhaps it's tied directly to how execute is interacting with entities. Too many nests for the command and it doesn't run?

          Blake Zimmerman added a comment - The command issue that I listed seems related to  SPIGOT-4046 . Perhaps it's tied directly to how execute is interacting with entities. Too many nests for the command and it doesn't run?

          Blake Zimmerman added a comment - - edited

          Further testing shows it's a distance issue in regards to an active player.  If you force it to check the cow nearest you, it will run, but if the command is executed in a place where a player is not nearby, it will not run.

          Not a distance issue. Still cannot narrow it down.

          Blake Zimmerman added a comment - - edited Further testing shows it's a distance issue in regards to an active player.  If you force it to check the cow nearest you, it will run, but if the command is executed in a place where a player is not nearby, it will not run. Not a distance issue. Still cannot narrow it down.

          Blake Zimmerman added a comment - - edited

          I apologize, I assumed that given that there was no error when the file was called after successfully re enabling the datapack that I wouldn't be able to provide any extra feedback on what causes the server to seemingly skip the line with the command. The specific command that seems to be failing to run based on the initial execute selector.

          In regards to the datapack loading issue, I believed that by stating if you have a datapack that has any function files with commands the error comes up would have offered the chance to reproduce the initial loading issue.

          I tested it with a permissions plugin, and denied myself all permissions as well as had others sign on for testing. The functions ran without a permission issue regardless if the player did or did not not have a permission to run the command.

          Unless there is no plan for datapack support within Spigot developments future for now, would you like me to upload a test datapack that would provide the same error during loading time?

          Blake Zimmerman added a comment - - edited I apologize, I assumed that given that there was no error when the file was called after successfully re enabling the datapack that I wouldn't be able to provide any extra feedback on what causes the server to seemingly skip the line with the command. The specific command that seems to be failing to run based on the initial execute selector. In regards to the datapack loading issue, I believed that by stating if you have a datapack that has any function files with commands the error comes up would have offered the chance to reproduce the initial loading issue. I tested it with a permissions plugin, and denied myself all permissions as well as had others sign on for testing. The functions ran without a permission issue regardless if the player did or did not not have a permission to run the command. Unless there is no plan for datapack support within Spigot developments future for now, would you like me to upload a test datapack that would provide the same error during loading time?

          md_5 added a comment -

          Also when reporting bugs you need to provide a MINIMAL reproduction case. I.e. only the essential features that cause the bug

          This means it is YOUR responsibility to narrow it down.

          md_5 added a comment - Also when reporting bugs you need to provide a MINIMAL reproduction case. I.e. only the essential features that cause the bug This means it is YOUR responsibility to narrow it down.

          md_5 added a comment -

          No data pack provided.
          Also note that data pack support is not guaranteed on Craftbukkit and vanilla should be used if this is a priority
          Craftbukkit provides many enhanced features such as permissions which may not be compatible.

          md_5 added a comment - No data pack provided. Also note that data pack support is not guaranteed on Craftbukkit and vanilla should be used if this is a priority Craftbukkit provides many enhanced features such as permissions which may not be compatible.

            Assignee:
            Unassigned
            Reporter:
            Blake Zimmerman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: