跳到正文

Ouch!

作者:Parax342

A menu to select your hurt sound effects

收藏

截图

介绍

中文介绍正在准备中,下面暂时显示原文。

Info

This datapack allows players to choose a preset of sounds to play when they’re hit, or die. It also provides an easy way to add your own sound presets, in addition to the default ones.

This pack does _not_ disable the vanilla hit sound, it simply plays another sound in addition to it. You can use a resource pack to remove, or decrease the sound of, the vanilla hit sound.

Default sound presets:

  • None
  • Wolf
  • Cat
  • Villager
  • Allay
  • Bee
  • Dog
  • Zombie
  • Pillager
  • Piglin
  • Enderman
  • Creaking
  • Metal
  • Glass
  • Air

Note: unfortunately, you cannot change what subtitles are shown without using a resource pack to add custom sound effects. This means you may see inaccurate subtitles when using the pack.

Adding your own sound presets

Sound presets are defined by functions in the hitsoundpicker:preset_registries tag. By default, the only such function is hitsoundpicker:register_default. To add your own presets, you can create your own functions and add them to hitsoundpicker:preset_registries, or you can directly add the presets to hitsoundpicker:register_default.

Inside a function, sound presets are defined by either calling hitsoundpicker:api/register_preset or hitsoundpicker:api/register_preset_pitched. Below are examples of calls to both.

register_preset:

function hitsoundpicker:api/register_preset { \
	"display": "Silverfish", \
	"sound": "minecraft:entity.silverfish.hurt", \
	"death_sound": "minecraft:entity.silverfish.death" \
}

register_preset_pitched:

function hitsoundpicker:api/register_preset_pitched { \
	"display": "Wool", \
	"sound": "minecraft:block.wool.break", \
	"sound_pitch": 1.0, \
	"death_sound": "minecraft:block.wool.break", \
	"death_sound_pitch": 0.5 \
}

The arguments display, sound, and death_sound are the same across both functions:

  • display is what the preset will display as in the selection menu
  • sound is the sound that will play when the player takes regular damage
  • death_sound is the sound that will play when the player dies

The arguments sound_pitch and death_sound_pitch are present only in register_preset_pitched:

  • sound_pitch is the speed at which sound will play
  • death_sound_pitch is the speed at which death_sound will play

register_preset is a shorthand for calling register_preset_pitched with sound_pitch and death_sound_pitch both set to 1.0

Sound presets will show up in the menu in the order that the function calls to register them were made.

Non-vanilla sounds will also work with the datapack, assuming that everyone has the necessary resource pack or mod to provide the sounds.

Other

Contact me on discord @parax342 with bugs or suggestions

Thanks to the Minecraft Commands discord for helping with this project

常见问题

Ouch! 支持哪些 Minecraft 版本?

Ouch! 支持 Minecraft Java 版 1.21.6–26.1.2,共 9 个版本。下载时注意选择和你游戏版本一致的文件。

Ouch! 怎么安装?

新建世界时在「数据包」里把下载的 .zip 拖进去;已有的存档,把文件放进存档目录下的 datapacks 文件夹,进游戏输入 /reload 即可生效。服务器同样放在世界目录的 datapacks 里。

评论

登录后评论和评分

Parax342 的其他作品

查看全部 →