We've split up the commands, scripting and mods, and add ons category! Please be sure you get your thread in the right place.

0

Function tags for Java 1.17 events

3 Comments

Please sign in to leave a comment.

Sorted by oldest
  • 0
    Registered User commented
    Comment actions Permalink

    That's possible through advancements. You can set up an advancement with the trigger minecraft:placed_block and set it to run a function, which runs the following command:

    execute as @a[advancements={blockPlaced=true}] run tellraw @a {"text":"I am placing a block and everybody should know that cuz it's so important"}
    advancement revoke @a[advancements={blockPlaced=true}] only myAdvancement

    The first command shows the message. The second revokes the advancement so that it can be used again.

  • 0
    Registered User commented
    Comment actions Permalink

    I disagree; it should be an advancement trigger instead. Although definitely not in the selector, that would be weird.

  • 0
    Registered User commented
    Comment actions Permalink

    Right, I forgot about that, but it was just an example. If they are going to add more events as I suspect they are, this will be a great thing to add to the game.