# RestrictIO Banning blocks and items with ease # RestrictIO ##### Links - Curse - [Source](https://git.unitedworldminers.com/io/RestrictIO) - [Issues](https://git.unitedworldminers.com/io/RestrictIO/issues) - [Development builds](https://git.unitedworldminers.com/io/RestrictIO/pipelines?scope=branches) # Ban Entry Structure Every ban entry has a structure consisting of Criterias, Actions and Triggers # Criterias A ban entry may have multiple criterias that will be matched against when checking a block or item. Every criteria has to match for a ban entry to fit.
**Name****Parameters****Description**
IDString itemIDMatch the item id (e.g. `minecraft:stone`). Blocks without a corresponding item can't be matched
Metaint metaMatch the item meta or damage.
DimensionString dimNamethe world name where the entry should apply. The id is also allowed
NbtString nbtJsonMatches the item's NBT tag. For blocks it matches to the tile entity's NBT. For blocks without tile entity this criteria will be ignored.
PlayerString nameThe playername of the player for which the the entry should be valid
ModString modidThe modID the item will be matched against. The modID is the first part of the item's resource location (e.g. `minecraft` for `minecraft:stone`)
NotCriteria critNegates a given criteria (e.g. `Not(Dimension(0))` will be any dimension exept 0)
AndCriteria c1, Criteria c2Combines two criterias with a logical AND. This is not very useful in the ban entry itself because the criterias in the ban entry are already linked to each other with AND
OrCriteria c1, Criteria c2Combines two criterias with a logical OR
# Actions A ban entry may have multiple actions that will be executed when an item or block matches its criterias.
**Name****Parameters****Description**
Remove-Removes the item or block from the world. By default the player can keep the block or item that is banned (this is useful when an item is only banned in some dimensions).
MessageString messagePrints a message to the player.
Log-Logs the incident to the console
KickString kickMessageKicks the player from the server with the given message
BanString kickMessage, String banMessageBans a player from the server
ServerCommandString commandExecutes a command in a console point of view
PlayerCommandString commandExecutes a command in a player point of view
The command of ServerCommand and PlayerCommand has some patterns for the execution environment:
%pThe player name
%uuidThe player's UUID with hypens
%idThe item id
%metaThe item meta / damage
%sizeThe item stack size
%dimThe dimension id of the incident
# Triggers There are different incidents where RestrictIO checks whether the item or block is banned. You can specify for every Ban entry in which case it should be checked.
**Name****Description****Checked Items****Performance Cost**
BlockBreakWhen a block gets brokenThe block being brokenlow
BlockPlaceWhen a block gets placedThe block being placedlow
InvScanPeriodic (all 30s) scan of all player inventoriesAll stacks in the player's inventorylow
ItemDropWhen a player drops an item or when he diesThe item(s) being droppedlow
ItemPickupWhen a player tries to pickup an itemThe items will be picked uphigh
ItemInteractWhen a player interacts (item rightclick, block left or rightclick)The (optional) block the player interacts with and/or (optional) the item in handvery high
ReciepeRegistrationWhen the reciepes get registered. The reciepe will be disabled globally!All standard shape(less) crafting outputson startup

For performance reasons you should use as few triggers as possible for your needs.

Don't use BlockBreak/BlockPlace in conjunction with ItemInteract! ItemInteract covers the them.

##### Examples: - Blocking a machine that is not placed - BlockPlace - ReciepeRegistration (when not allowed anywhere) - Blocking a machine that may have already been placed - ItemInteract - ReciepeRegistration (when not allowed anywhere). - Completely blocking an item or block that is already in inventories and in the world - ItemDrop - ItemPickup - ItemInteract - ReciepeRegistration - InvScan # Manage Bans After you got to read what a ban consists of we have to talk about adding and removing bans. # Ingame GUI RestrictIO has an ingame GUI that can be opened with `/rio gui`. # RestrictIO command You can manage the bans over the console with the `/rio` commands.

Unfortunately you can't edit a ban over console - you have to remove the old and recreate it. Alternatively you can edit a ban with the ingame GUI or by editing the file.

##### Adding a ban `/rio ban ` - Criterias: `none` or a comma-separated list of criterias (see [criteria list](https://wiki.ender.io/books/restrictio/page/criterias "Criterias")) - Actions: `none` or a comma-separated list of actions (see[ action list](https://wiki.ender.io/books/restrictio/page/actions "Actions")) - Triggers: `none` or `all` or a comma-separated list of triggers (see [trigger list](https://wiki.ender.io/books/restrictio/page/triggers "Triggers"))

If you want to use spaces in strings like in the Message action, use underscores instead of spaces! If you explicitly want to use underscores, escape them with a backslashes.

**Examples:** `rio ban ID(minecraft:wool),meta(12) remove(),Message(This_is_banned!!!) all` removes brown wool and gives a message at all incidents. `rio ban mod(minecraft) none blockbreak,blockplace` blocks any block break or place without any other action ##### Removing a ban `rio unban ` removes a ban entry of the ban list at the specified index. You can obtain the index with `/rio list`. Note that if you want to delete several entries, the index may be moved. # File editing RestrictIO uses the JSON format for storing the ban entries. The file is located at `./config/RestrictIO/restrictedItems.json`. It is only useful to edit current values as it is fairly simple (i.e. if you don't have enough space for your text in the GUI or console). Adding new criterias/actions/etc. needs you to know the field names (the JSON is a serialization of the data structure in the core). For that you have to look into the [source code](https://git.unitedworldminers.com/io/RestrictIO). If you have edited your file you can reload it with `rio reload`. # Commands / Admin OptOut #### Commands ##### /restrictio <subcommand> This is the main command of RestrictIO. It can also be accessed by `/rio`.
**Subcommand****Additional Parameters****Description**
gui-Opens a GUI if the console is too ugly for you
reload-Reloads the config, overrides current config if it succeeds to load the new config
list-Lists all current ban entries
ignoreoptional playernameexecutes /ignoreitembans
showentry indexShows a single ban entry
bancriterias, actions, triggersCreates and adds a new ban entry (see [managing bans](https://wiki.ender.io/books/restrictio/page/restrictio-command "RestrictIO command")). Saves the config afterwards
unbanentry indexRemoves a ban entry. Saves the config afterwards
##### /ignoreitembans As an admin you might want to ignore the restrictions given for the users. In the individual entries you can of course exclude yourself with a player criteria, but this might be easier with `/ignoreitembans` or `/rio ignore`. This command toggles a optOut for you or the player you specified in the arguments. You can also toggle this in the mod's GUI.