Skip to content

Commit efd3fb1

Browse files
committed
tweak player_add error messages for clarity
1 parent 2f48f8b commit efd3fb1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/release-notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* For players:
66
* Update compatibility rewrites for Stardew Valley 1.6.3.
77
* Updated mod compatibility list.
8+
* Tweaked `player_add` console command's error messages for clarity.
89

910
## 4.0.2
1011
Released 24 March 2024 for Stardew Valley 1.6.0 or later.

src/SMAPI.Mods.ConsoleCommands/Framework/Commands/Player/AddCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private bool TryReadArguments(ArgumentParser args, out string? id, out string? n
144144
SearchableItem[] matches = this.Items.GetAll().Where(p => p.NameContains(name)).ToArray();
145145
if (!matches.Any())
146146
{
147-
monitor.Log($"There's no item with name '{name}'. You can use the 'list_items [name]' command to search for items.", LogLevel.Error);
147+
monitor.Log($"There's no item whose name contains '{name}'. You can use 'list_items' command to list all items, or search like 'list_items {name}'.", LogLevel.Error);
148148
return null;
149149
}
150150

@@ -159,7 +159,7 @@ private bool TryReadArguments(ArgumentParser args, out string? id, out string? n
159159
header: new[] { "type", "name", "command" },
160160
getRow: item => new[] { item.Type.ToString(), item.DisplayName, $"player_add {item.QualifiedItemId}" }
161161
);
162-
monitor.Log($"There's no item with name '{name}'. Do you mean one of these?\n\n{options}", LogLevel.Info);
162+
monitor.Log($"Multiple items have a name containing '{name}'. Do you mean one of these?\n\n{options}", LogLevel.Info);
163163
return null;
164164
}
165165

0 commit comments

Comments
 (0)