跳到正文

Nerflytra – Nerf elytra boosting

作者:Penny_Less

Disable or discourage using rockets while flying, performant and configurable.

收藏

截图

介绍

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

Nerflytra – Make rockets burn elytras

This performant datapack stops/discourages players from using rockets to fly long distances by breaking their elytra or reducing its durability by 10% every time they do.

This pack is configurable, you can configure whether players elytras are damaged or entirely broken when they rocket, how often the pack checks (for the performance paranoid out there), and whether to allow some players to be excluded from this datapack’s elytra-burning proclivities. See the How to section for guidance.

How to

Damage instead of destroy the elytra

Run /function nerflytra:toggle_damaging_instead_of_destroying_elytra.
When toggled on, this will make the datapack reduce the durability by 10% (instead of setting it directly to 1%) every time they use a rocket. Since this only occurs once per rocket-usage, players can use longer-lasting rockets to fly for longer.

If you want this to do even less damage, you can make the datapack check less frequently as described below. Note that this will make fireworks do far less damage.
To change this manually, you can edit the damage number in the file /data/item_modifier/lower_durability.json, this is a percentage between 1.00 and 0.00.

Allow certain players to use rockets

You can exclude players from this datapack by giving them the scoreboard objective nerflytra.can_rocket with the value 1. Setting this to the value 0 will stop them from using rockets again.
The command to do this will look like /scoreboard players set PLAYERNAME nerflytra.can_rocket 1.

Make the datapack check less frequently

By default the datapack checks for flying players twice per second, and is very perfomant. If you don’t need that precision or are extra cautious about performance, you can make this datapack check even less frequently with the function /function nerflytra:toggle_frequency. Note that if you’ve also configured this pack to only damage elytras instead of destroy them, this will make the elytra take significantly slower damage.

How it works

If a player is flying with an elytra in their chest slot when the datapack checks, and they have used firework rockets since the last check, their chest slot is damaged.
The datapack checks twice per second by default, but you can change this like described in the How to section.
If you set the option to not break the elytra but instead damage it, the elytras durability is reduced instead of destroyed, only half the sound effects play, and no message is shown.
If you’ve set this option but want it to do even less damage than usual, you can make the datapack check less frequently as described in the How to section.

License

This work is licensed under GPLv3. You can think of it as allowing you to do anything with this code, as long as what you do with it also uses the GPLv3 license, and is shared for free.
If you have code suggestions you can reach out via bio and I can update the datapack, or potentially open a git repository for collaboration.

常见问题

Nerflytra – Nerf elytra boosting 支持哪些 Minecraft 版本?

Nerflytra – Nerf elytra boosting 支持 Minecraft Java 版 1.21–1.21.1,共 2 个版本。下载时注意选择和你游戏版本一致的文件。

Nerflytra – Nerf elytra boosting 怎么安装?

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

评论

登录后评论和评分