Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main class:
- public static SoundEvent phoneNoise;
- @EventHandler
- public void preInit(FMLPreInitializationEvent event)
- {
- ResourceLocation location = new ResourceLocation(Reference.MOD_ID.toLowerCase(), "phoneNoise");
- GameRegistry.register(new SoundEvent(location), location);
- item class:
- @Override
- public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) {
- playerIn.playSound(testmod.phoneNoise, 10f, 10f);
- return super.onItemRightClick(itemStackIn, worldIn, playerIn, hand);
- }
- assets:
- > sounds.json:
- {
- "phoneNoise": {
- "category": "record",
- "sounds": [
- {
- "name": "jerrysmod:phoneNoise",
- "stream": true
- }
- ]
- }
- }
- > sounds > phoneNoise.ogg: *a weird noise*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement