Skip to content
CoolSquid edited this page Jul 7, 2017 · 5 revisions

Welcome to the React wiki!

React is a Minecraft mod that allows the user to execute configurable actions whenever an event occurs. React uses the HOCON format for its configuration files. A script/configuration looks like this:

dimension_travel=[
	{
		action=cancel
		conditions {
			mob {
				type=player
			}
			target_dimension {
				id=0
			}
		}
	}
	{
		action=send_chat
		target=every_player
		target_filters {
			min_xp_level=10
		}
		conditions {
			mob {
				type=player
			}
			target_dimension {
				id=0
			}
		}
		parameters {
			message="Someone was denied entry to the overworld!"
		}
	}
]

The configuration consists of 6 main parts: the events, the actions, the targets, the target filters, the conditions, and the parameters. Events are located on the top level, they are defined as arrays, e.g. dimension_travel=[]. The actions go inside the events, e.g. dimension_travel=[ { action=cancel } ] (NOTE: each event may only appear once per file). The action= part tells React what action you want to execute, e.g. cancel (which tries to cancel the event). Targets also go inside the action's curly brackets, e.g. target=every_player. They can be restricted with target filters:

target=every_player
target_filters {
	min_xp_level=10
}

Target filters get all the targets from the target type, and remove the ones which don't match the specified filters. A list of target filters may be found here.

Another important concept is conditions. Conditions are used to prevent an action from being executed if certain conditions have not been met.

conditions {
	side=client // only run the script if we're a client
}

Targets and target filters can also be used inside conditions:

conditions {
	mob {
		type=player
	}
}

This checks whether the mob the event refers to is a player. Any target and target filter may be used here.

The last major concept to understand is parameters. Parameters are used to pass information onto the actions, so they know what to do. For example, this can be the message in a send_chat action:

action=send_chat
parameters {
	message="Hello player!"
}

Clone this wiki locally