Posted April 16, 201510 yr I'm trying to make a sound play for the entire world at nightfall. But nothing happens. Could someone help with this? Event: public class TimeEvents { Minecraft mc; ISound sound; EntityPlayer player; @SubscribeEvent public void onWorldTick(TickEvent.WorldTickEvent event) { if(event.world.getWorldTime() == 10000) { if(event.world.provider.dimensionId == 10) { ResourceLocation file = new ResourceLocation("apocalypse:sounds.Siren"); sound = PositionedSoundRecord.func_147673_a(file); mc.getSoundHandler().playSound(sound); } } } } The sound file is valid since it can be played with a record, and the class is registered as an event so I'm not sure what's going on.
April 16, 201510 yr Resource location is defined wrong. It thinks that when it only one arg, it's mc's resource, so it becomes something like minecraft:apocalypse:sounds.Siren. To avoid this, use second resource location constructor(with 2 strings: 1st-domain, 2nd-resource). Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.