Last active
April 14, 2018 00:45
-
-
Save robere2/1d03efc71c78235b75fb73c124e1f732 to your computer and use it in GitHub Desktop.
1.8.9 Sounds System Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void playFireSound() { | |
playSound("gun.shotgun.fire"); | |
} | |
public void playReloadSound() { | |
playSound("gun.shotgun.reload"); | |
} | |
/** | |
* Play sound | |
* @param name The name of the sound (not the path to the sound) | |
*/ | |
public void playSound(final String name) { | |
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation(Reference.MOD_ID, name), 1.0F)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"gun.shotgun.fire": { | |
"sounds":["gun/shotgun/fire"], | |
"category": "player" | |
}, | |
"gun.shotgun.reload": { | |
"sounds":["gun/shotgun/reload"], | |
"category": "player" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment