Skip to content

Mappet target selectors

McHorse edited this page Jun 19, 2021 · 2 revisions

Mappet adds a couple of selectors to target selector system, which allow to target players and NPCs better.

mpid selector

mpid selector allows to target NPC entities (mappet:npc) by their NPC ID.

For example @e[mpid=test] will capture all the NPCs with their NPC ID test. You can also use ! in front to target all NPCs whose NPC ID isn't what you want, so @e[mpid=!test] will target all NPCs whose NPC ID isn't test.

mpe selector

mpe selector allows to target player and NPC entities using simple math expressions, where variable names are name of the states that you want to compare. When using this target selector, make sure you don't have any spaces (as target selectors can't contain spaces in general).

If a player or NPC doesn't have a state by given variable name, then the variable value will be presumed as 0, so be careful.

For example: you want to target all players that read dialogue by ID intro (considering that final reaction nodes' Mark read is enabled), this can be done by checking for dialogues.intro state, like this @a[mpe=dialogues.intro>0] (or @a[mpe=dialogues.intro]).

Another example: you changed player state using /mp state set command, and want to teleport all people with currency state being greater than or equals to 10000, this can be done by executing following command:

/tp @a[mpe=currency>=10000] -69 63 420
Clone this wiki locally