How can you make an item do different sounds on hit

Started by ShiroFliro on

Topic category: Help with modding (Java Edition)

Last seen on 14:15, 15. Oct 2023
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can you make an item do different sounds on hit
Sun, 05/15/2022 - 06:41 (edited)


This is what ive got atm and it just straight up crashes the game.

Edited by ShiroFliro on Sun, 05/15/2022 - 06:41
Last seen on 05:51, 18. Apr 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Create the desired weapon,…
Sun, 05/15/2022 - 08:27

Create the desired weapon, go to triggers, and add the following under when living entity is hit with tool ...

And finally, select the sound or create/add a custom sound and select it. Save, then test.

Last seen on 14:15, 15. Oct 2023
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i mean like. having a 50/50…
Sun, 05/15/2022 - 12:04

i mean like. having a 50/50 chance of doing one sound or another

Last seen on 05:05, 30. Oct 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Set local variable vNum to…
Sun, 05/15/2022 - 13:44

Set local variable vNum to Random [0,1)

If: vNum ≤ 0.15

     Do: play sound 1

Else If: vNum ≤ 0.30

     Do: play sound 2

Else If: vNum ≤ 0.45

     Do: play sound 3

Else:

    Do: play sound 4

 

 

This will play one of 4 sounds with a 15% chance for each of the first 3 and 55% for the 4th.

Last seen on 00:43, 14. Jan 2023
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When your creating a sound,…
Tue, 05/24/2022 - 22:29

When your creating a sound, you can add multiple sound files to it and not just one. Doing this will play a random sound from those sounds when the sound is triggered