Jump to content

____tbvns____

Members
  • Posts

    2
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

____tbvns____'s Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Nice! thx you so much !
  2. For some reason, this code doesn't work: public void GameStart() { System.out.println("Checking for server"); //(1) if (Value.server != null && Value.server.isRunning()) { System.out.println("Playing Sound"); //(2) Value.server.getPlayerList().getPlayers().forEach(p ->{ double x = p.getX(); double y = p.getY(); double z = p.getZ(); p.getLevel().playSound(p.getInventory().player, x, y, z, LoadSounds.GAME_START.get(), SoundSource.PLAYERS, 100f, 100f); }); } } Both System.out.print are executed, but no sound is played. I can play the sound using /playsound, so I don't think it is caused by a typo in the all the JSON file or in the name of those files. Here are aditional file that may be needed: LoadSound.class: public class LoadSounds { public static final DeferredRegister<SoundEvent> SOUND_EVENT = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, FlagsHunters.MODID); //Load Sound public static final RegistryObject<SoundEvent> GAME_START = soundEventRegistryObject("game_start"); //Random Stuff private static RegistryObject<SoundEvent> soundEventRegistryObject(String name) { ResourceLocation id = new ResourceLocation(FlagsHunters.MODID, name); return SOUND_EVENT.register(name, () -> new SoundEvent(id)); } //Load function public static void Load(IEventBus eventBus) { SOUND_EVENT.register(eventBus); } } sounds.json: { "game_start": { "subtitle": "flagshunters.subtitle.game_start", "sounds": [ "flagshunters:game_start" ] } } all the file and folder: The minecraft version: 1.19.2 The forge version: 43.2.21
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.