Entity#getScoreboardTags directly exposes the Set<String> #11296
Labels
good first issue
Simple bug fix or feature which would be a good first PR for someone new to the project
status: accepted
Disputed bug is accepted as valid or Feature accepted as desired to be added.
type: bug
Something doesn't work as it was intended to.
An entity will only load 1024 scoreboard tags from it's NBT, and the addTag methods on nms.Entity automatically check this and return false if it's over 1024. These methods are directly called by the API addScoreboardTag method. The problem is, the API also has
getScoreboardTags
which directly exposes the underlying set, no copy, no unmodifiable wrapper, nothing. So a plugin can just add strings to that set to add over 1024 tags which are then saved, and lost on a reload of the entity.Either we copy the set to make it a mutable copy or wrap it in an unmodifiable wrapper or we do an immutable copy.
The text was updated successfully, but these errors were encountered: