Buckets:
| { | |
| "path": "Minecraft/mc-Data/ExampleSounds.java", | |
| "original_extension": "java", | |
| "content": "package com.example.examplemod;\n\nimport net.minecraft.registry.Registries;\nimport net.minecraft.registry.Registry;\nimport net.minecraft.sound.SoundCategory;\nimport net.minecraft.sound.SoundEvent;\nimport net.minecraft.util.Identifier;\nimport net.minecraft.world.World;\nimport net.minecraft.util.math.BlockPos;\n\n/**\n * Custom sound event registration + playback helpers.\n * Requires a matching entry in:\n * assets/examplemod/sounds.json\n * and an .ogg file at:\n * assets/examplemod/sounds/gem_chime.ogg\n *\n * SoundEvent API unchanged across 1.21.7 - 1.21.11.\n */\npublic final class ExampleSounds {\n\n private ExampleSounds() {}\n\n public static final SoundEvent GEM_CHIME = registerSound(\"gem_chime\");\n\n private static SoundEvent registerSound(String path) {\n Identifier id = Identifier.of(ExampleMod.MOD_ID, path);\n return Registry.register(Registries.SOUND_EVENT, id, SoundEvent.of(id));\n }\n\n /** Play the sound at a block position, audible to all nearby players. */\n public static void playGemChime(World world, BlockPos pos) {\n world.playSound(\n null, // no specific source player (server broadcasts to all)\n pos,\n GEM_CHIME,\n SoundCategory.BLOCKS,\n 1.0f, // volume\n 1.0f // pitch\n );\n }\n}\n\n/*\n * assets/examplemod/sounds.json\n * {\n * \"gem_chime\": {\n * \"subtitle\": \"subtitle.examplemod.gem_chime\",\n * \"sounds\": [\"examplemod:gem_chime\"]\n * }\n * }\n */\n" | |
| } |
Xet Storage Details
- Size:
- 1.72 kB
- Xet hash:
- c7dccfea9fd0504ebf0a016a8baa489fcd7a628e0e9eade6b275280872a936d7
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.