随机鬼怪速度
让每一只快乐的鬼怪都拥有自己独特且永久固定的飞行速度——就像马匹一样!
不再有千篇一律的鬼怪;你驯服的每一只鬼怪,其速度要么是慢速、稳定、快速,或是极其罕见的闪电般极速。
🎯 功能特性
- 随机化速度 – 每只新的快乐鬼怪在首次被骑乘时,都会获得一个随机分配的飞行速度。
- 类似马匹的稀有度层级 – 速度分布具有不同的概率:
50% – 普通 (0.05,原版默认值)
30% – 慢速 (0.04)
15% – 快速 (0.8)
5% – 极快 (0.1)
- 每只鬼怪固定不变 – 一旦设定,该速度将永久绑定到这只鬼怪身上(即使重载世界也不会改变)。
- 轻量级 – 每秒运行一次,对性能影响微乎其微。
- 支持多人游戏 – 每位玩家都能独立体验自己所骑鬼怪的速度。
⚙️ 工作原理
数据包使用了一个简单但有效的机制:
每秒检查是否有玩家正在骑乘快乐鬼怪。
当新鬼怪被骑上时(即尚未拥有 ghast_speed_set 标签的鬼怪),它会生成一个 1–100 之间的随机数。
根据该数字,分配四种速度层级之一,并永久设置飞行速度属性。
为该鬼怪打上标签以防止重新掷骰子。
这些速度经过精心挑选,以匹配马匹的手感——从迟缓到令人兴奋的快速。
📦 安装方法
下载 .zip 文件。
将其放入你的世界的数据包文件夹中:
单人游戏:.minecraft/saves/world_name/datapacks/
服务器:world/datapacks/
启动世界(如果已在游戏中,则运行 /reload)。
可选 – 如果未显示加载消息,请运行一次 /function hello:load。
搞定!从现在开始,所有新生成的快乐鬼怪都将拥有随机速度。
✅ 兼容性
Minecraft Java Edition 1.21.7 – 26.3
适用于单人游戏和多人游戏服务器。
不需要任何模组或资源包。
与其他数据包完全兼容(只要它们不修改快乐鬼怪的相同属性)。
🛠️ 自定义(针对高级用户)
你可以轻松调整数据包内的 set_random_speed.mcfunction 文件中的速度值和稀有度百分比。
更改速度值
查找如下行:
execute if score @s ghast.rarity matches 1..50 run attribute @s minecraft:flying_speed base set 0.05
将 0.05 替换为你喜欢的任意数值(例如,0.3 可以让鬼怪飞得更快)。
更改稀有度百分比
matches 后面的数字定义了百分比范围:
1..50 = 50%
51..80 = 30%
81..95 = 15%
96..100 = 5%
根据你的喜好进行调整(必须覆盖 1–100 且无间隙)。
编辑完成后,保存文件并在游戏中运行 /reload。
❓ 故障排除
问:骑上后鬼怪没有变快。
答:下马并重新骑乘——有时属性更改需要重新骑乘才能生效。
问:我可以在已经驯服了鬼怪的现有世界中使用吗?
答:可以,但只有安装后新生成的鬼怪才会拥有随机速度。现有的鬼怪保持其原始速度。
问:速度感觉太慢/太快。
答:请参阅上面的自定义部分——你可以轻松更改数值。
👤 鸣谢
由 TVcraft01 为 Minecraft 社区创作。
基于赋予快乐鬼怪如同马匹般迷人随机性的理念。
📜 许可证
此数据包可免费使用和修改。如果你将其包含在整合包或视频中,建议署名但非强制要求。
享受你独一无二的极速鬼怪吧!如有任何问题或建议,欢迎留言。
Random Ghast Speed
Give every happy ghast its own unique, permanent flying speed — just like horses!
No more identical ghasts; each one you tame will be either slow, steady, fast, or extremely rare and lightning-quick.
🎯 Features
Randomized speeds – Every new happy ghast gets a randomly assigned flying speed when first ridden.
Horse-like rarity tiers – Speeds are distributed with varying probabilities:
50% – Normal (0.05, vanilla default)
30% – Slow (0.04)
15% – Fast (0.8)
5% – Very Fast (0.1)
Permanent per ghast – Once set, the speed stays with that ghast forever (even after reloading the world).
Lightweight – Runs once per second, minimal performance impact.
Works in multiplayer – Each player experiences their own ghast's speed independently.
⚙️ How It Works
The datapack uses a simple but effective mechanic:
Every second it checks for players riding happy ghasts.
When a new ghast is mounted (one without the ghast_speed_set tag), it generates a random number 1–100.
Based on that number, it assigns one of four speed tiers and sets the flying_speed attribute permanently.
The ghast is tagged to prevent re-rolling.
The speeds are carefully chosen to match the horse feel – from sluggish to thrillingly fast.
📦 Installation
Download the .zip file.
Place it in your world's datapacks folder:
Singleplayer: .minecraft/saves/world_name/datapacks/
Server: world/datapacks/
Start the world (or run /reload if already in-game).
Optional – If the load message doesn't appear, run /function hello:load once.
That's it! All new happy ghasts from now on will have random speeds.
✅ Compatibility
Minecraft Java Edition 1.21.7 – 26.3
Works on both singleplayer and multiplayer servers.
Does not require any mods or resource packs.
Fully compatible with other datapacks (as long as they don't modify the same attributes on happy ghasts).
🛠️ Customization (For Advanced Users)
You can easily tweak the speed values and rarity percentages by editing the set_random_speed.mcfunction file inside the datapack.
Change Speed Values
Look for lines like:
execute if score @s ghast.rarity matches 1..50 run attribute @s minecraft:flying_speed base set 0.05
Replace 0.05 with any number you like (e.g., 0.3 for even faster ghasts).
Change Rarity Percentages
The numbers after matches define the percentage ranges:
1..50 = 50%
51..80 = 30%
81..95 = 15%
96..100 = 5%
Adjust them to your liking (they must cover 1–100 with no gaps).
After editing, save the file and run /reload in-game.
❓ Troubleshooting
Q: The ghast doesn't move faster after mounting.
A: Dismount and remount – sometimes attribute changes need a remount to take effect.
Q: Can I use this on an existing world with already-tamed ghasts?
A: Yes, but only new ghasts spawned after installation will have random speeds. Existing ghasts keep their original speed.
Q: The speeds feel too slow / too fast.
A: See the Customization section above – you can easily change the numbers.
👤 Credits
Created by TVcraft01 for the Minecraft community.
Based on the idea of giving happy ghasts the same charming randomness as horses.
📜 License
This datapack is free to use and modify. If you include it in a modpack or video, a credit is appreciated but not required.
Enjoy your uniquely speedy ghasts! If you have any issues or suggestions, feel free to leave a comment.
评论 0
登录后参与评分
还没有评论,来抢沙发吧