Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
MythicMobs MythicMobs
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 144
    • Issues 144
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • MythicCraft
  • MythicMobsMythicMobs
  • Wiki
    • Skills
  • Targeters

Targeters · Changes

Page history
added skipTargetsUpToIndex attribute authored Jan 20, 2025 by Lxlp's avatar Lxlp
Hide whitespace changes
Inline Side-by-side
Showing with 23 additions and 3 deletions
+23 -3
  • Skills/Targeters.md Skills/Targeters.md +23 -3
  • No files found.
Skills/Targeters.md
View page @ fc9226c0
......@@ -339,20 +339,24 @@ This is done with the attributes:
| Attribute <!-- ETA --> | Aliases | Description | Default |
|-----------|-----------|----------------------------------------------------------------------|---------|
| sort | sortby | How to sort the targeted entities/locations | |
| limit | | The limit to the targeted entities/locations after the sort is applied| |
| skipTargetsUpToIndex | stuti | skips the first `n` targets of the targeter after the sort is applied, if >0 |0|
| limit | |The limit to the targeted entities/locations after the skip is applied, if >0 |0|
<!--
| Attribute LTA | Aliases | Description | Default |
|-----------|-----------|----------------------------------------------------------------------|---------|
| sort | sortby | How to sort the targeted entities/locations | |
| limit | | The limit to the targeted entities/locations after the sort is applied| |
| skipTargetsUpToIndex | stuti | skips the first `n` targets of the targeter after the sort is applied, if >0 |0|
| limit | |The limit to the targeted entities/locations after the skip is applied, if >0 |0|
-->
Lets say you want your ability to only target the 2 nearest players within 30 blocks. To do this, you'd simply set the limit 2 to and sort by nearest:
- **@PlayersInRadius{r=30;limit=2;sort=NEAREST}**
```yaml
- mechanic @PlayersInRadius{r=30;limit=2;sort=NEAREST}
```
Currently, sort can have the following values:
......@@ -368,6 +372,22 @@ Currently, sort can have the following values:
- HIGHEST_THREAT
- LOWEST_THREAT
So the targeter will, in this order:
- Sort the targets based on the provided sort attribute, if any (and if limit and skipTargetsUpToIndex are >0)
- Skip the first n targets based on the skipTargetsUpToIndex attribute's value, if >0
- Return the first n targets based on the value of the limit attribute, if > 0
So, in essence, you can fetch target(s) at specific index(es) by using both limit and skipTargetsUpToIndex
```yaml
GiveRewards:
Skills:
- skill{s=[
- message{m="You are first!"} @targeted{limit=1} #targets the player that has the highest threat
- message{m="You are second!"} @targeted{limit=1;stuti=1} #targets the player that has the second highest threat
- message{m="You are third!"} @targeted{limit=1;stuti=2} #targets the player that has the third highest threat
- message{m="You aren't on the podium!"} @targeted{stuti=3} #targets everyone else
]} @ThreatTablePlayers{sort=HIGHEST_THREAT}
```
......
Clone repository
Home
Changelogs
Premium Features
Commands and Permissions
Mythic Add-ons
Compatible Plugins
API Information

Guides
  • Troubleshooting
  • FAQ / Common Issues
  • Examples
Packs

MythicScribe MythicScribe - VSCode Extension

Mobs
  • Mob Options
    • Display Options
  • Mob Levels
  • Mob Factions
  • Power Scaling
  • Damage Modifiers
  • Equipment
  • BossBar
  • Custom AI
  • Custom Kill Messages
  • Threat Tables
  • Immunity Tables
  • Templates
  • Vanilla Overrides
  • Extra: Disguises
  • Extra: ModelEngine

Skills
  • Mechanics
    • Mechanics by Tag
  • Targeters
    • Filters
  • Triggers
  • Conditions
    • In-line conditions
  • Metaskills
  • Placeholders
  • Variables

Items
  • Options
  • Attributes
  • Enchantments
  • Potions
  • Banner Layers
  • Firework

Drops & DropTables
  • Drops
  • DropTables
  • FancyDrops

Spawning
  • Spawners
  • Random Spawns

Stats
  • Custom Stat Options
  • Modifiers
  • Built in Stats

Other
  • Particles Types
  • Audience
  • Equipment Slots
  • Pins
Technical
  • Math
  • Operations
    • Attribute Operations
    • Stats Modifiers
  • SkillTree
  • Advanced User Guides and Techniques