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

NullPointerException when using conditional command within a function

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Duplicate
    • Affects Version/s: Minecraft 17w45a
    • Fix Version/s: None
    • Labels:
      None
    • Confirmation Status:
      Unconfirmed

      Description

      When I put this in the function "test:t2" in a datapack

      say hi
      execute if entity @e[type=player] run say helloplayer
      execute unless entity @e[type=blaze] run say hellonoblaze
      execute if entity @e[type=blaze] run say helloblaze
      say bye
      

      and run

      function test:t2
      

      it outputs "hi" in the chat and then java.lang.NullPointerException.

      Executing the individual commands has mostly expected behavior.... except the 'unless' one says 'no entity found' when it should chat 'hellonoblaze'.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                brianmcn Brian McNamara
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: