User Tools

Site Tools


tutorial:sounds

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
tutorial:sounds [2020/02/11 19:46]
earthcomputer Remove category from sounds.json. It was removed in Minecraft 1.10
tutorial:sounds [2020/02/11 20:23] (current)
earthcomputer The purpose of the player argument is not unknown
Line 7: Line 7:
 if (!world.isClient) { if (!world.isClient) {
       world.playSound(       world.playSound(
-              null, // Player ​(purpose unknown, edit if you know)+              null, // Player ​if non-null, will play sound for every nearby player *except* the specified player
               blockPos, // The position of where the sound will come from               blockPos, // The position of where the sound will come from
               SoundEvents.BLOCK_ANVIL_LAND,​ // The sound that will play, in this case, the sound the anvil plays when it lands.               SoundEvents.BLOCK_ANVIL_LAND,​ // The sound that will play, in this case, the sound the anvil plays when it lands.
Line 90: Line 90:
         if (!world.isClient) {         if (!world.isClient) {
             world.playSound(             world.playSound(
-                    null, // Player ​(purpose unknown, edit if you know)+                    null, // Player ​if non-null, will play sound for every nearby player *except* the specified player
                     blockPos, // The position of where the sound will come from                     blockPos, // The position of where the sound will come from
                     ExampleMod.MY_SOUND_EVENT,​ // The sound that will play                     ExampleMod.MY_SOUND_EVENT,​ // The sound that will play
tutorial/sounds.txt ยท Last modified: 2020/02/11 20:23 by earthcomputer