Everything posted by LorenzoPapi
-
[SOLVED] [1.12.2] Music Disc inserted in Jukebox doesn't play music
I don't quite understand what you are telling me to do. Can you show me a working example please?
-
[SOLVED] [1.12.2] Music Disc inserted in Jukebox doesn't play music
Ok I've changed it to static... and now it doesn't load the sounds at all. Strange. Then, the sounds are already called in pre-init and as I see when I start Minecraft, Forge automatically starts by loading the sounds up. Now, could you tell me why did I have to change it to static, since the sounds doesn't load if I do so? Btw, I've added a laser sound to a sword, that played when you right-click with the item, just to test if it worked, and it did. So, is it a record problem/bug?
-
[SOLVED] [1.12.2] Music Disc inserted in Jukebox doesn't play music
It is called: @SubscribeEvent public void onRegisterSoundEvent(RegistryEvent.Register<SoundEvent> event) { SoundIndex.init(event); }
-
[SOLVED] [1.12.2] Music Disc inserted in Jukebox doesn't play music
These are the items. I already tried by changing Item to ItemRecord, no success. public static Item itemRecordStillAlive; public static Item itemRecordWantYouGone; This is the items initialization: @SubscribeEvent public void onRegisterItem(RegistryEvent.Register<Item> event) { PortalGun.itemRecordStillAlive = new ItemRecords("Still Alive", SoundIndex.r_records_still_alive, "portalgun:item_record_still_alive","record"); PortalGun.itemRecordWantYouGone = new ItemRecords("Want You Gone", SoundIndex.r_records_want_you_gone, "portalgun:item_record_want_you_gone", "record"); event.getRegistry().register(PortalGun.itemRecordStillAlive); event.getRegistry().register(PortalGun.itemRecordWantYouGone); } This is the model initialization: @SubscribeEvent public void onModelRegistry(final ModelRegistryEvent event) { ModelLoader.setCustomModelResourceLocation(PortalGun.itemRecordStillAlive, 0, new ModelResourceLocation("portalgun:item_record_still_alive", "inventory")); ModelLoader.setCustomModelResourceLocation(PortalGun.itemRecordWantYouGone, 0, new ModelResourceLocation("portalgun:item_record_want_you_gone", "inventory")); }
-
[SOLVED] [1.12.2] Music Disc inserted in Jukebox doesn't play music
{ "records.want_you_gone": { "category": "record", "sounds": [ { "name": "portalgun:records/want_you_gone", "stream": true } ] }, "records.still_alive": { "category": "record", "sounds": [ { "name": "portalgun:records/still_alive", "stream": true } ] } }
-
[SOLVED] [1.12.2] Music Disc inserted in Jukebox doesn't play music
It still doesn't work. Btw thank you for helping me.
-
BlockPos class not found
After searching a bit, I've found out that CC:Tweaker is a successor of computercraft, so remove computercraft and try again
-
[SOLVED] [1.12.2] Music Disc inserted in Jukebox doesn't play music
Yes I have the sound, in fact I can play it with the /playsound command. The problem is that when I put the disc in the jukebox, it doesn't play the music and it doesn't show the "Now Playing: disc name" line.
-
[SOLVED] [1.12.2] Music Disc inserted in Jukebox doesn't play music
Hi, I have a problem with my music discs. Even though the sound EXISTS, cause I can play it with playsound, when I put the disc into the jukebox, it doesn't play the music or show the "Now playing:" thing. package com.lorenzopapi.portalgun.common.item; import java.util.List; import com.lorenzopapi.portalgun.common.PortalGun; import com.lorenzopapi.portalgun.common.core.SoundIndex; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemRecord; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; import net.minecraft.world.World; public class ItemRecords extends ItemRecord { private final SoundEvent soundIn; public ItemRecords(String name, SoundEvent sound, String registryName, String unlocalizedName) { super(name, sound); this.soundIn = sound; this.setUnlocalizedName(unlocalizedName); this.setRegistryName(registryName); this.setCreativeTab(PortalGun.creativeTab); } @Override public EnumRarity getRarity(ItemStack stack) { return EnumRarity.RARE; } } This is my SoundIndex: package com.lorenzopapi.portalgun.common.core; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundCategory; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.event.RegistryEvent.Register; import net.minecraftforge.registries.IForgeRegistry; import net.minecraft.util.SoundEvent; public class SoundIndex { public static SoundEvent r_records_still_alive; public static SoundEvent r_records_want_you_gone; public static void init(final Register<SoundEvent> registry) { SoundIndex.r_records_still_alive = register(registry, "records.still_alive"); SoundIndex.r_records_want_you_gone = register(registry, "records.want_you_gone"); } private static SoundEvent register(final RegistryEvent.Register<SoundEvent> event, final String name) { final ResourceLocation rs = new ResourceLocation("portalgun", name); final SoundEvent soundEvent = (SoundEvent)new SoundEvent(rs).setRegistryName(rs); event.getRegistry().registerAll(soundEvent); return soundEvent; } }
IPS spam blocked by CleanTalk.