aikar / aikar/AdvancementCommand

Replacement Alias doesn't work

Open
#4 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
13
Forks
4
PR merge metrics
No merged PRs in 30d

Description

So, I was attempting to use this plugin to give a player some special permissions when they got an advancement.... I set up a command, but when the advancement was achieved, the console spat out that it couldn't find a player named %player

(this is on Spigot 1.14.4, by the way, Java 1.8.0_251)

I looked at your code, and this line: private static final Pattern PLAYER = Pattern.compile("%player\b", Pattern.CASE_INSENSITIVE);

You've got this "\b" in there, I tested it out in a fiddle, and it doesn't seem to match the pattern unless the string has the backspace control character at the end. Of course, if I try to put the backspace control character at the end in the yaml, it won't run.

If you change the pattern to: private static final Pattern PLAYER = Pattern.compile("%player\\b", Pattern.CASE_INSENSITIVE);
then the code will work as I believe you wanted it to. You actually have a pull request already from someone who found and fixed this problem, if you could just merge it I think we'd be good.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.