diff --git a/src/main/java/world/bentobox/challenges/tasks/TryToComplete.java b/src/main/java/world/bentobox/challenges/tasks/TryToComplete.java index 22d2ef7..41b2ed3 100644 --- a/src/main/java/world/bentobox/challenges/tasks/TryToComplete.java +++ b/src/main/java/world/bentobox/challenges/tasks/TryToComplete.java @@ -1461,10 +1461,29 @@ public class TryToComplete if (currentValue < requirements.getAmount()) { - Utils.sendMessage(this.user, this.user.getTranslation("challenges.errors.requirement-not-met", - TextVariables.NUMBER, String.valueOf(requirements.getAmount()), - "[statistic]", Utils.prettifyObject(requirements.getStatistic(), this.user), - "[value]", String.valueOf(currentValue))); + switch (Objects.requireNonNull(requirements.getStatistic()).getType()) + { + case ITEM, BLOCK -> { + Utils.sendMessage(this.user, this.user.getTranslation("challenges.errors.requirement-not-met-material", + TextVariables.NUMBER, String.valueOf(requirements.getAmount()), + "[statistic]", Utils.prettifyObject(requirements.getStatistic(), this.user), + "[material]", Utils.prettifyObject(requirements.getMaterial(), this.user), + "[value]", String.valueOf(currentValue))); + } + case ENTITY -> { + Utils.sendMessage(this.user, this.user.getTranslation("challenges.errors.requirement-not-met-entity", + TextVariables.NUMBER, String.valueOf(requirements.getAmount()), + "[statistic]", Utils.prettifyObject(requirements.getStatistic(), this.user), + "[entity]", Utils.prettifyObject(requirements.getEntity(), this.user), + "[value]", String.valueOf(currentValue))); + } + default -> { + Utils.sendMessage(this.user, this.user.getTranslation("challenges.errors.requirement-not-met", + TextVariables.NUMBER, String.valueOf(requirements.getAmount()), + "[statistic]", Utils.prettifyObject(requirements.getStatistic(), this.user), + "[value]", String.valueOf(currentValue))); + } + } } else { diff --git a/src/main/resources/locales/en-US.yml b/src/main/resources/locales/en-US.yml index f80e638..1b8b67b 100755 --- a/src/main/resources/locales/en-US.yml +++ b/src/main/resources/locales/en-US.yml @@ -1204,6 +1204,8 @@ challenges: not-hooked: "&c Challenges Addon could not find any GameMode." timeout: "&c This challenge requires to wait [timeout] between completions. You must wait [wait-time] till complete it again." requirement-not-met: "&c This challenge requires [statistic] to have [number]. You have only [value]. " + requirement-not-met-entity: "&c This challenge requires [statistic] [entity] to have [number]. You have only [value]. " + requirement-not-met-material: "&c This challenge requires [statistic] [material] to have [number]. You have only [value]. " # # Showcase for manual material translation # materials: # # Names should be lowercase.