Перейти к содержимому
Mineforgian

PreventBuild

A simple but flexible mod that prevents unwanted player actions described in the custom configs

815 загрузок2 подписчиковMITfabric

Обновлён 27 декабря 2025 г. · опубликован 10 мая 2025 г.

logo

PreventBuild

Adds control to prevent the player from performing certain actions that are set in configs. Configs, in turn, have a very flexible structure that allows you to build complex logical conditions describing what actions the mod should prevent.

Original purpose of creating this mod was enhancing experience of hand-building map-arts without using any printers and easy-place mode. But now it's more than just preventing placing and breaking: you can prevent any right- or left-click actions, just make sure there is a suitable condition.

This mod is just cancelling the player's actions, so it's fully client-side.

How to use the mod

It's almost necessary to visit the Wiki to understand how to write a config, because there is no other way to write it except by hand.

There are a few files in config/preventbuild/:

  • conditions/ - contains config .cfg files
  • condition_configs.json - defines which configurations are active by its individual name
  • ore_dictionaries.json - defines custom ore dictionary lists for using in configs

Once you have created/updated your configs, you should update configs in the game using commands. Also configs are updating automatically when the player joins a world.

(For developers) Also you can find out how to create and register your own conditions that you will be able to use in the same config files.

Commands

  • /pb config list - display a list of configs with their status
  • /pb config switch - enable/disable config by name
  • /pb config update - reload all configs

Server restrictions of the conditions

Since I'm trying to keep gameplay fair and rules-friendly, I decided to give server owners the ability to restrict some conditions that they can consider as "cheating-like" actions.

For now, there's only a few of such restrictions. To use them, you need to add the following strings to the plugin message via the "preventbuild:restrictions" channel and send it to players on PlayerRegisterChannelEvent:

NoItemDamage - Disables all the "Item Damage" and "Item Durability" conditions

NoBlockState - Disables the "Block State" condition

NoAgeBlockState - Disables only the use of the "age" state in the "Block State" condition

ResetAll - Resets all restrictions

Example:

@EventHandler
public void onRegisterChannelJoin(PlayerRegisterChannelEvent event) {
	if (event.getChannel().equals("preventbuild:restrictions")) {
		Player player = event.getPlayer();
		ByteArrayDataOutput out = ByteStreams.newDataOutput();
		out.writeUTF("NoItemDamage NoAgeState");
		player.sendPluginMessage(this, event.getChannel(), out.toByteArray());
	}
}

Contacts

If you have some issues with the mod, any questions or just want to leave feedback, you are always welcome:

Note

Well, this is my first relatively serious mod and especially the first one for public use. Thanks for visiting :)

Версии

ВерсияКаналИграЗагрузчикиДатаСкачать
1.4.5+mc1.21.9Релиз1.21.9, 1.21.10, 1.21.11fabric27 декабря 2025 г.Скачать (148 КБ)
1.4.5+mc1.21.6Релиз1.21.5, 1.21.6, 1.21.7, 1.21.8fabric27 декабря 2025 г.Скачать (148 КБ)
1.4.4+mc1.21.9Релиз1.21.9, 1.21.10, 1.21.11fabric31 октября 2025 г.Скачать (148 КБ)
1.4.4+mc1.21.6Релиз1.21.5, 1.21.6, 1.21.7, 1.21.8fabric11 июля 2025 г.Скачать (148 КБ)
1.3.5+mc1.21.6Релиз1.21.5, 1.21.6, 1.21.7fabric3 июля 2025 г.Скачать (140 КБ)
1.3.2+mc1.21.5Релиз1.21.5fabric15 июня 2025 г.Скачать (143 КБ)
1.3.2+mc1.21.4Релиз1.21.4fabric15 июня 2025 г.Скачать (143 КБ)
1.2.3+mc1.21.4Релиз1.21.4, 1.21.5fabric18 мая 2025 г.Скачать (133 КБ)
1.2.2+mc1.21.4Релиз1.21.4, 1.21.5fabric15 мая 2025 г.Скачать (132 КБ)
1.2.0+mc1.21.4Релиз1.21.4, 1.21.5fabric15 мая 2025 г.Скачать (130 КБ)
1.1.0+mc1.21.4Релиз1.21.4, 1.21.5fabric14 мая 2025 г.Скачать (125 КБ)
1.0.1Релиз1.21.4, 1.21.5fabric12 мая 2025 г.Скачать (127 КБ)
1.0Бета1.21.4, 1.21.5fabric11 мая 2025 г.Скачать (127 КБ)
0.8Бета1.21.4, 1.21.5fabric10 мая 2025 г.Скачать (127 КБ)

Ченджлог

1.4.5+mc1.21.9Релиз1.21.9, 1.21.10, 1.21.11 · 27 декабря 2025 г.

Fixed "interactionBlock:" category wasn't preventing interactions with blocks such as chests, beds, repeaters, etc.

1.4.5+mc1.21.6Релиз1.21.6, 1.21.7, 1.21.8 · 27 декабря 2025 г.

Fixed "interactionBlock:" category wasn't preventing interactions with blocks such as chests, beds, repeaters, etc.

1.4.4+mc1.21.9Релиз1.21.9, 1.21.10, 1.21.11 · 31 октября 2025 г.

Updated to 1.21.9

1.4.4+mc1.21.6Релиз1.21.6, 1.21.7, 1.21.8 · 11 июля 2025 г.

Changes and new features

  • Added support for restrictive plugin messages sent from the server to limit the mod's functionality just a little if some of the implemented conditions violate the server rules. It should make the mod more friendly for use on different servers.
    • If the server is restricting some of the conditions you have used in your configs, you will get an error message in the chat once you join or use the /pb config update command.
    • To see the list of the implemented message, check the mod's description.

Fixes and minor changes

  • Fixed "useItem:" category behavior when looking at an interactive block
  • Removed the limitation for config names to have "_" character
  • Configs with the same name will not override each other
  • Exception messages now are more informative and supports localization
  • Automatic update of configs now starts when the player joins the world
1.3.5+mc1.21.6Релиз1.21.5, 1.21.6, 1.21.7 · 3 июля 2025 г.

Changes and new features

Fixes and minor changes

  • Fixed when stripping wood condition cancelled unnecessary cases of right click, e.g. when the player have a shield in the offhand (the game prevents it itself to call another action)
1.3.2+mc1.21.5Релиз1.21.5 · 15 июня 2025 г.

Changes and new features

  • "other:" category replaced by "interactBlock:" category:
    • It's difficult for me to remember why the category simply for both place and block was created, but now it makes much more sense.

      "interactBlock:" category handles any right-click interactions with block, without checking whether it is interactive

  • Message of /pb config list is clickable now: open config file or toggle it

Fixes and minor changes

  • Added shorten value "empty" meaning "block.minecraft.air" for using in configs (i.e. item:empty)
  • Sensitive to whitespaces in configs has become less strict
1.2.3+mc1.21.4Релиз1.21.4, 1.21.5 · 18 мая 2025 г.

Fixes and minor changes

  • Fixed stripping wood condition. Now it works from "useItem:" category;
  • Fixed "carpet on carpet" condition was preventing placing any block on top of the carpet-type block
  • Added pale oak into stripping condition;
  • Added pale moss carpet indo "carpet on carpet" condition
1.2.2+mc1.21.4Релиз1.21.4, 1.21.5 · 15 мая 2025 г.

Changes and new features

  • Added item's durability and damage conditions
    • Prevents if the held item's durability or damage value matches the condition

Fixes and minor changes

  • "useItem:" category now is checked also when right-clicking a block

Комментарии

Загружаем…