Advertisement
Guest User

still

a guest
Aug 1st, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. main class:
  2.  
  3. public static SoundEvent phoneNoise;
  4. @EventHandler
  5. public void preInit(FMLPreInitializationEvent event)
  6. {
  7. ResourceLocation location = new ResourceLocation(Reference.MOD_ID.toLowerCase(), "phoneNoise");
  8. GameRegistry.register(new SoundEvent(location), location);
  9.  
  10. item class:
  11. @Override
  12. public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) {
  13.  
  14. playerIn.playSound(testmod.phoneNoise, 10f, 10f);
  15. return super.onItemRightClick(itemStackIn, worldIn, playerIn, hand);
  16. }
  17.  
  18. assets:
  19.  
  20. > sounds.json:
  21. {
  22. "phoneNoise": {
  23. "category": "record",
  24. "sounds": [
  25. {
  26. "name": "jerrysmod:phoneNoise",
  27. "stream": true
  28. }
  29. ]
  30. }
  31. }
  32.  
  33. > sounds > phoneNoise.ogg: *a weird noise*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement