Jump to content

[1.6.4] How do you make a sound follow the player?


joeeeeee_the_1st

Recommended Posts

Hi all, I have a sound that plays when you use an item, but it plays it into the world and stays in one place. How do you make it so it follows the player who used the item?

 

The code i have is:

public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)

    {

par2World.playSoundAtEntity(par3EntityPlayer, "revso:turpstervision", 1.0F, 1.0F);

return par1ItemStack;

    }

 

Could you please type out what i need to put.

 

Also, how do you make it so only one of the sound can be used at once as it is quite long

 

Thanks,

Joe

Link to comment
Share on other sites

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.