diff --git a/docs/scarpet/api/Auxiliary.md b/docs/scarpet/api/Auxiliary.md index 0d264bd8..8427523e 100644 --- a/docs/scarpet/api/Auxiliary.md +++ b/docs/scarpet/api/Auxiliary.md @@ -12,9 +12,8 @@ Valid mixer options are `master`, `music`, `record`, `weather`, `block`, `hostil and `voice`. `pos` can be either a block, triple of coords, or a list of three numbers. Uses the same options as a corresponding `playsound` command. -Used with no arguments, return the list of available sound names. - -Throws `unknown_sound` if sound doesn't exist. +Used with no arguments, returns a list of available sound names. Note that this list may not include all sounds that +clients will actually be able to receive (they may have more available via resourcepacks for example). ## Particles diff --git a/src/main/java/carpet/script/api/Auxiliary.java b/src/main/java/carpet/script/api/Auxiliary.java index 6fc6a1a4..bcc4e94b 100644 --- a/src/main/java/carpet/script/api/Auxiliary.java +++ b/src/main/java/carpet/script/api/Auxiliary.java @@ -138,10 +138,7 @@ public class Auxiliary String rawString = lv.get(0).getString(); ResourceLocation soundName = InputValidator.identifierOf(rawString); Vector3Argument locator = Vector3Argument.findIn(lv, 1); - if (cc.registry(Registries.SOUND_EVENT).get(soundName) == null) - { - throw new ThrowStatement(rawString, Throwables.UNKNOWN_SOUND); - } + Holder soundHolder = Holder.direct(SoundEvent.createVariableRangeEvent(soundName)); float volume = 1.0F; float pitch = 1.0F; diff --git a/src/main/java/carpet/script/exception/Throwables.java b/src/main/java/carpet/script/exception/Throwables.java index 7d399dfa..ab345946 100644 --- a/src/main/java/carpet/script/exception/Throwables.java +++ b/src/main/java/carpet/script/exception/Throwables.java @@ -21,7 +21,6 @@ public class Throwables public static final Throwables UNKNOWN_ITEM = register("unknown_item", VALUE_EXCEPTION); public static final Throwables UNKNOWN_BLOCK = register("unknown_block", VALUE_EXCEPTION); public static final Throwables UNKNOWN_BIOME = register("unknown_biome", VALUE_EXCEPTION); - public static final Throwables UNKNOWN_SOUND = register("unknown_sound", VALUE_EXCEPTION); public static final Throwables UNKNOWN_PARTICLE = register("unknown_particle", VALUE_EXCEPTION); public static final Throwables UNKNOWN_POI = register("unknown_poi", VALUE_EXCEPTION); public static final Throwables UNKNOWN_DIMENSION = register("unknown_dimension", VALUE_EXCEPTION);