0

Do I need to set up a system to track the fireballs a player deflects or does the statistics system already have a pre-made scoreboard objective for it? I couldn't find any page of all of the stats on the wiki so I only had what was on the /scoreboard command page. Is that all of them or are there others listed somewhere else?

4
  • 2
    Since you're not even damaging the fireball, I think there is indeed no scoreboard for that. I'm pretty sure you have to actually track it. I guess it would be enough to track when a fireball comes into range and then changes direction. But since the direction is stored as a vector, not an angle, that would be veeery difficult. I guess you can detect a sign flip for at least one of the three coordinates, but then a tiny redirection wouldn't be tracked. Commented May 2, 2019 at 5:37
  • 1
    @FabianRöling Can you store the individual vector components to the scoreboard, then compare those values against the vector the next tick? IIRC, fireball motion isn't affected by gravity.
    – MBraedley
    Commented May 2, 2019 at 19:29
  • @MBraedley I'll try comparing the vectors. Is there a separate page for all of the statistics or is the scoreboard command wiki the only place to find them?
    – Nik3141
    Commented May 2, 2019 at 20:18
  • 2
    No, they should all be on the scoreboard page.
    – MBraedley
    Commented May 2, 2019 at 20:29

1 Answer 1

1

So it turns out you can't necessarily detect fireballs deflected, but you can detect fireballs deflected into ghasts. The vanilla datapack has the 'Return to Sender' JSON advancement file as:

{
  "parent": "minecraft:nether/root",
  "display": {
    "icon": {
      "item": "minecraft:fire_charge"
    },
    "title": {
      "translate": "advancements.nether.return_to_sender.title"
    },
    "description": {
      "translate": "advancements.nether.return_to_sender.description"
    },
    "frame": "challenge",
    "show_toast": true,
    "announce_to_chat": true,
    "hidden": false
  },
  "rewards": {
    "experience": 50
  },
  "criteria": {
    "killed_ghast": {
      "trigger": "minecraft:player_killed_entity",
      "conditions": {
        "entity": {
          "type": "minecraft:ghast"
        },
        "killing_blow": {
          "is_projectile": true,
          "direct_entity": {
            "type": "minecraft:fireball"
          }
        }
      }
    }
  },
  "requirements": [
    [
      "killed_ghast"
    ]
  ]
}

So you could use a hidden advancement which detects that, and so every time a player gets it, add one to a dummy scoreboard and revoke the advancement.

Another possible thing (which I haven't tested) is the possibility of using the player hurt entity trigger for the advancement on the ghast fireball, so then if the player "hurts" (punches) the fireball the advancement is granted, and you use the same scoreboard process as above.

I will edit whether that is possible and if it is, what JSON advancement file I used when I get around to it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.