-
Notifications
You must be signed in to change notification settings - Fork 10
Mappet target selectors
Mappet adds a couple of selectors to target selector system, which allow to target players and NPCs better.
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 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
If parts of the wiki don't make sense with Mappet's latest version, or you weren't able to recreate examples (i.e. outdated information), feel free to report the page and section that is out of date on community's Discord server (make sure to mention which Mappet’s version did you use).