Jump to content

Recommended Posts

Posted

good days

im leaving this mini guide here for miself later retake wen ned.

 

well first i wanna set a simple sound for an item nothing complicated soo  i gonna take the sound file Rhapsody of Fire - Dark Wings of Steel [2013] 320/11 - Sad Mystic Moon.mp3 and i gona converit to ogg using the sound converter tool from linux and chop the name to  sadmistickmoon.ogg

 

this sadmistickmoon.ogg i gonna put in mi mod sounds folder 

forge-1.8-11.14.0.1261-1.8-src/src/main/resources/assets/modmercenario/sounds/sadmistickmoon.ogg

 

now the json file , this one is a little tricky there is this colon ', ' must be wached because it can fuck all the file

forge-1.8-11.14.0.1261-1.8-src/src/main/resources/assets/modmercenario/sounds.json

 

//__________________________________________________________

 

{

    "taladro": { "category": "player", "sounds": [ "taladro" ] },

    "neutro":  { "category": "player", "sounds": [ "n" ] },

    "smm":  { "category": "player", "sounds": [ "sadmistickmoon" ] } 

}

 

//__________________________________________________________

 

there is only tree sounds files declarated in this json and now the colon thing is

at the end of every sound line there must be a colon at the end but never in the last one if you let the colon in the last one or omit the colon in any other line minecraft wont gonna load the file and surprise  no custom sounds just one one error and nothing works

 

 

now to play the sound you must writte this  in the item you wanna use whit, mi MODID name is "modmercenario"

and this is in the  onItemRightClick of mi testingItem 

 

public ItemStack onItemRightClick(ItemStack sierra, World worldIn, EntityPlayer playerIn){

 

//plays taladro

worldIn.playSoundAtEntity(playerIn, "modmercenario:taladro", 1.0F, 1.0F);

 

//plays neutro

        worldIn.playSoundAtEntity(playerIn, "modmercenario:neutro", 1.0F, 1.0F);

 

        //plays  sad mistic moon

worldIn.playSoundAtEntity(playerIn, "modmercenario:smm", 1.0F, 1.0F);

 

}

 

when i fireup minecraft take the testitem on mi hand and press rigth click it sounds first taladro then neutro and sadmistic moon is like all at the same time, but the sound dont gonna move whith steve is like a music box whit a disk

if you move ten meters far there is no sound if you get close again there is again the sound . 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.