Skip to content

Commit

Permalink
reinstate PlayerTag.has_played_before with new impl
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 14, 2022
1 parent 940d1c8 commit bf5eb70
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -842,9 +842,15 @@ public static void registerTags() {
return new DurationTag(object.getOfflinePlayer().getFirstPlayed() / 50);
});

// <--[tag]
// @attribute <PlayerTag.has_played_before>
// @returns ElementTag(Boolean)
// @description
// Returns true if the player has played before, or is currently online. Returns false if this PlayerTag refers to a UUID that has never been on the server.
// Works with offline players.
// -->
tagProcessor.registerTag(ElementTag.class, "has_played_before", (attribute, object) -> {
Deprecations.playerHasPlayedBefore.warn(attribute.context);
return new ElementTag(true);
return new ElementTag(object.isValid());
});

// <--[tag]
Expand Down

0 comments on commit bf5eb70

Please sign in to comment.