PoliceHat
Adds a wearable police hat with a glowing spinning beacon and customizable music that follows you while you wear it. Works on players, armour stands, and most humanoid mobs.
介绍
About
PoliceHat adds a wearable police cap with a glowing beacon that never stops spinning — and a soundtrack that follows you while you wear it.
The hat works as a lightweight helmet, can be placed on players and humanoid mobs, and plays its music only for the person currently wearing it. Take it off, drop it, die, switch worlds, or disconnect, and the music stops immediately.
Install on both the client and the server. On Fabric, Fabric API is also required.
Free to use in any modpack — public or private, no permission needed.
What it does
- Wear the police hat — equip
policehat:police_hatin the helmet slot. - Spinning beacon — the light on top rotates continuously and glows in the dark.
- Built-in music — a soundtrack loops while the hat is on your head and stops as soon as it is removed.
- Local playback only — you hear your own hat, not every other player wearing one.
- Works on humanoid mobs — right-click a compatible mob while holding the hat to place it on its head.
- Supports armour stands — use the hat as part of displays, builds, scenes, or decorations.
- Light protection — the hat provides 1 armour point, the same as a leather helmet.
- Unbreakable — it never loses durability and stacks to one.
- Ten languages included — English, German, Spanish, French, Italian, Japanese, Korean, Brazilian Portuguese, Russian, and Simplified Chinese.
The hat is intended primarily as a cosmetic item rather than a serious piece of armour.
Crafting
Place a redstone torch above three blocks of black wool:
T
WWW
T= Redstone TorchW= Black Wool
For modpack makers
PoliceHat can be customised without modifying or repackaging the mod. Its music settings live in:
config/policehat-client.properties
The file is generated automatically on first launch.
The configuration is client-side. It controls what an individual player hears, so it should be included in the client side of a modpack rather than only on the server.
| Option | Default | What it does |
|---|---|---|
music.enabled |
true |
Enables or disables the hat music. |
music.volume |
1.0 |
Controls playback volume from 0.0 to 1.0. |
music.pitch |
1.0 |
Controls playback speed from 0.5 to 2.0. |
music.category |
records |
Selects which Minecraft volume slider controls the music. |
music.loop |
true |
Controls whether the track loops or plays once per wearing. |
music.sound |
policehat:police_hat_music |
Selects the sound event played by the hat. |
Volume is applied on top of the player’s own Minecraft sound settings.
The sound category can use values such as:
records
music
master
ambient
players
blocks
hostile
neutral
weather
voice
The ui category is also available on supported newer Minecraft versions.
Minecraft-style singular names such as record, player, and block are accepted as well.
Using another sound
The hat can play any registered sound event available in the current installation.
For example, to use a vanilla music disc:
music.sound=minecraft:music_disc.pigstep
A missing namespace defaults to minecraft.
You can also add your own sound through a resource pack:
assets/mypack/sounds.json
assets/mypack/sounds/siren.ogg
Example sounds.json:
{
"siren": {
"sounds": [
{
"name": "mypack:siren",
"stream": true
}
]
}
}
Then point the config to it:
music.sound=mypack:siren
Minecraft does not support MP3 files. Custom tracks must use the Ogg Vorbis format.
You can also replace the default track directly through a resource pack by overriding:
assets/policehat/sounds/police_hat_music.ogg
To keep the spinning hat but disable the music completely:
music.enabled=false
Safe configuration
Invalid settings cannot crash the mod.
Unknown values, malformed sound ids, unsupported sound categories, and invalid numbers fall back to safe defaults. Out-of-range numeric values are clamped to their supported ranges.
If the configuration file cannot be read at all, PoliceHat keeps the settings that were already active rather than unexpectedly resetting them.
The file also accepts decimal commas, so both of these work:
music.volume=0.5
music.volume=0,5
Blank values simply use their defaults.
Reloading the config
Use the following command after editing the file:
/policehat reload
The command reloads the client configuration without restarting Minecraft and reports any invalid settings in chat.
It is a client-side command, requires no operator permissions, and works in both singleplayer and multiplayer.
When music settings change while the hat is already being worn, the track restarts with the new settings.
Resource packs and data packs
A resource pack can replace the hat’s textures, inventory icon, item model, translations, and music.
Common resource locations include:
assets/policehat/textures/entity/police_hat.png
assets/policehat/textures/item/police_hat.png
assets/policehat/models/item/police_hat.json
assets/policehat/lang/en_us.json
The hat’s 3D shape is defined in code, so resource packs can change its texture but not its geometry.
The crafting recipe is a normal data-pack recipe and can be replaced or removed using a data pack, KubeJS, CraftTweaker, or standard loader recipe events.
The stable ids are:
Mod: policehat
Item: policehat:police_hat
Sound: policehat:police_hat_music
Feedback
Please report any bugs, errors, or feature suggestions on Discord: https://discord.gg/HTkn94BXmA
常见问题
PoliceHat 支持哪些 Minecraft 版本?
PoliceHat 支持 Minecraft Java 版 1.19.2–26.3,共 8 个版本,可用的加载器:Fabric / Forge / NeoForge。下载时注意选择和你游戏版本一致的文件。
PoliceHat 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / Forge / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
Nikrecs 的其他作品
查看全部 →DeathCompass
重生时自动获得一个指南针,精准指向你上次死亡的位置。
Terralith: River In Jungle
Terralith 附属模组,新增宽阔蜿蜒、拥有自然缓坡河岸的丛林河流,告别原版那些细小的溪流。
Swing Through Grass
挥剑扫过草丛也能命中生物:攻击不再被高草、蕨类和植物挡掉,让你的剑能穿过枝叶击中目标。轻量级服务端模组,无需客户端安装。
PerformanceHUD
轻量级客户端 HUD,可在自定义角落叠加显示 FPS、内存、实体数量、区块数量、延迟和 CPU 占用。
评论
登录后评论和评分