ThePredictdocs v0.0.1 RC

Authoring

Targets, participants & threat

What a mob can perceive, who it may fight (players, other mobs, any living entity) and the extra threat ThePredict adds to the MythicMobs threat table.

What a mob perceives

ThePredict decides only with what the mob could perceive, so its behavior stays believable:

  • Who: the participants the policy below admits, within the mob's Options.FollowRange (never more than decision.searchRadiusBlocks). By default that means living players in SURVIVAL or ADVENTURE; a player in CREATIVE or SPECTATOR does not exist for ThePredict.
  • What: visible details of a player (a raised shield, a drawn bow, the item in hand, effects) only with line of sight and when the player is not invisible. A player's tendency (closing in, backing off, strafing) comes from how they actually move, never from raw keyboard input.
  • What Jev reads: bands and facts (MELEE, RANGED, CRITICAL, RAISING_SHIELD…), never coordinates, names or UUIDs. Inside each encounter, players are player_1, player_2… and other entities entity_1, entity_2… with their species.
  • No double hits: one cast per choice and per cooldown, one vanilla hit per 20 ticks, no hits during the target's invulnerability frames and no hits into a blocking shield (unless the skill ignores shields). The threat ThePredict adds is capped per window.
  • The history of an encounter is discarded when it ends.

Who can take part

A participant is anything a mob perceives, targets and fights. It can be any living entity, not only a player. A small policy built from native Minecraft, Paper and MythicMobs distinctions decides who qualifies. Without configuration, only players in SURVIVAL or ADVENTURE take part, and requests to Jev are exactly the same as without the feature.

The global policy is the participants section of config.yml (participants.playerGameModes, participants.entities.allow, participants.entities.deny, participants.entities.profilesMayAllow, participants.entities.perceiveNonTargets). Each profile can refine it with an optional Participants section:

Profile keyDefaultRule
PlayerGameModesthe global listA subset of the global list; a mode outside it is an error. []: these mobs never perceive or attack players.
Entities.Allow[]Selectors added to the global allow list. Ignored with a warning when the admin set profilesMayAllow: false.
Entities.Deny[]Selectors added to the global deny list; they never take part.
Entities.PerceiveNonTargetsthe global valuetrue only if the global key allows it. With false, the mob only perceives its own target among entities; with true it also perceives allowed entities nearby (at most participants.entities.maxCandidatesPerMember per mob).

Selectors

A selector is prefix:value text; each list holds up to 16. Loading only checks the shape; values are resolved when profiles bind (on every /mm reload), and an unknown value warns with its path (for example Participants.Entities.Allow[0]) and is ignored.

SelectorMatches when
type:<key>The entity type is that one: type:minecraft:zombie (without a namespace, minecraft).
tag:<key>The type is in that entity-type tag, vanilla or from a datapack: tag:minecraft:undead. Tags are read when profiles bind: after /minecraft:reload, run /mm reload.
category:<SpawnCategory>Its spawn category: MONSTER, ANIMAL, WATER_ANIMAL, WATER_AMBIENT, WATER_UNDERGROUND_CREATURE, AMBIENT, AXOLOTL, MISC.
kind:<KIND>It is a LIVING entity, a MOB, an ENEMY (wider than monster: includes slime, ghast, phantom, hoglin and shulker), a MONSTER or an ANIMAL.
mythic:* or mythic:<MobId>It is a MythicMobs mob, or one of that exact type (case-sensitive).
faction:<name>Its MythicMobs faction, any case.
team:<name>Its main scoreboard team, any case.
tagged:<tag>It has that /tag scoreboard tag, exactly.
predictorIt is a mob bound to ThePredict.

How the policy decides

The first rule that applies wins:

  1. An invalid or dead entity never takes part.
  2. The mob itself and the members of its own encounter (its allies) never do.
  3. A player takes part when their game mode is listed, and nothing else applies to players.
  4. An armor stand never does.
  5. Anything matching a Deny selector never does.
  6. Anything on the same side as the mob never does.
  7. Anything matching an Allow selector does.
  8. Everything else does not.

Sides. Two entities are on the same side when both are MythicMobs mobs with the same faction (any case), or else when they share a main scoreboard team. Sides never apply to players, even in a team. An encounter is a side: its members are allies and its participants are rivals. Two ThePredict mobs fighting each other form two encounters, each with its own request and its own point of view.

Watch out ThePredict mobs without a faction are rivals

A broad allow (kind:MONSTER, kind:MOB, predictor) also admits other ThePredict mobs. Without a Faction or a team, they are rivals: two of them fighting the same player form separate encounters (more requests), and if their AITargetSelectors pick each other (for example - 1 monsters), they fight each other. For a group that should fight together, give them the same Faction: in MythicMobs and target with - 1 nearestOtherFactionMonsters instead of - 1 monsters, or add their faction to the deny list.

A player the policy does not admit at the top of the threat table leaves the mob without a target for ThePredict (it does not fall back to Mob#getTarget()): safe, since nothing is cast against that player. With an entity the policy does not admit, ThePredict does fall back to Mob#getTarget().

The target is still chosen natively. MythicMobs or vanilla pick the target (threat table, AITargetSelectors). To make a mob attack other creatures, give it a native target selector, for example - 1 monsters or - 1 nearestSpecificFaction{f=blue}, and admit those creatures in Participants.

What Jev reads about other entities

An entity reaches Jev as entity_N plus its species, the key of its type without namespace: entity_1 is a zombie, entity_2 is a wither skeleton, target is a zombie. Its custom name, Display, MythicMobs ID, faction and UUID never travel. Local outputs (inspect, records) do show the species: Target: entity_1 (zombie) ….

Jev gets fewer facts about an entity than about a player, never invented ones:

FactPlayerMob with items (skeleton, pillager, piglin, witch, armed zombie)Other living entity
Health and armoryesyesyes
Raising a shield, blockingyesfrom the item in use (BLOCKS_ATTACKS), with the vanilla block delaysame
Shield disabled, attack recharging, pearl on cooldownyes——
Drawing a bow, bow fully drawnyesfrom the item in use—
Crossbow loaded, holds a totemyesfrom equipment—
Eating or drinkingyesfrom the item in use—
Gliding, invisible, mace diveyesyes or equivalentyes or equivalent
Long-reach weaponyesfrom the weapon in hand—
Tendencyfrom movement and distancefrom velocity and distancesame
Reachable on foot, visible, flankableyesyesyes
Out of the target's reachyesfrom its ThePredict profile, or the vanilla melee check of a Mobthe vanilla check if it is a Mob
Threatyesyesyes
Species—yesyes

Example: a two-faction duel

The mob of the other faction uses the same profile with faction:duel_red swapped for its rival:

AIConfig/Profiles/duel_blue.ymlYAML
schemaVersion: 2
duel_blue_ai:
  MythicID: ThePredictGuardian
  Objective: Defeat the red duelist in front of you
  Choices:
    punch: { Kind: VANILLA_MELEE }
  Tactics:
    press: { Movement: APPROACH, Choice: punch, Description: Close in and hit the rival }
    hold: { Movement: HOLD, Description: Wait for the rival to come closer }
  Participants:
    PlayerGameModes: []
    Entities:
      Allow: ['faction:duel_red']

Safe mob-versus-mob duels

To pit two mobs against each other without ever touching players or other mobs, combine four independent safeguards:

  1. Native targeting of the rival only: AITargetSelectors with - 0 clear and - 1 nearestSpecificFaction{faction=<rival>}. A player only counts as part of a faction with the permission faction.<name in lower case> and without mythicmobs.nofaction; operators and * have both, so they stay out. Never give faction.<rival> to a player.
  2. No threat from players: Modules: ThreatTable: false, so a player's hit never changes the target.
  3. Profiles that only admit the rival: Participants: PlayerGameModes: [] and Entities: Allow: ['faction:<rival>']. ThePredict then never perceives, targets or casts against anything else.
  4. Single-target damage: every damaging skill targets @target, never an area.

For a fair comparison with a classic boss, give both sides the same stats, base goals and skills (a shared MythicMobs Template helps), set Damage: 0 on both and put all damage in skills, gate the classic timer skills with predictorcontrol false, and make every round end (for example a delay 1800 then remove @self on spawn). Run the arena in its own world with natural spawning off. /thepredict duel records everything both mobs decide and do (see Storage & records).

Enriched threat

The MythicMobs threat table still picks the target. ThePredict adds (or removes) threat for facts MythicMobs does not measure, with the weights of the profile's Threat section. It works with and without Jev.

Threat keyDefaultEffect
AssistsOthers1.5When a player heals or buffs other participants with a splash or lingering potion: weight × participants reached, added to that player in the table of every active member of the encounter.
RangedHarass1.0Multiplies the final damage of each projectile from a player who is not the mob's target, in that mob's table.
BlockedHits0.25Points per mob hit the player blocks with a shield, in that mob's table.
UnreachableDecayPerSecond2.0Points per second the target loses while the mob cannot reach it on foot: after two decisions following a path that does not reach the target, it is removed at each decision. Nothing is removed while the mob stands still without a path. No window cap.
MaxPerWindow20.0Cap of points added per mob table, player and fact in each 100-tick (5 s) window. Must be above 0.

Units and limits:

  • With ThreatTable.UseDamageTaken: true, the native table adds one point per point of damage, so the weights are in points of final damage. Ranged harass uses the final Bukkit damage, after armor, resistance and absorption.
  • MythicMobs switches target when another entity passes the current target's threat by 10 %. ThePredict never forces that switch.
  • With ThreatTable.DecayUnreachable: true on the mob, MythicMobs already lowers the unreachable target's threat: ThePredict ignores UnreachableDecayPerSecond so it is not removed twice, and the catalog warns Threat.UnreachableDecayPerSecond: is ignored because mob '<Mob>' enables ThreatTable.DecayUnreachable.
  • A mob without Modules.ThreatTable does not use enriched threat; inspect says no threat table (Modules.ThreatTable off): enriched threat inactive for this mob.
  • Setting every weight to 0 turns enriched threat off for that profile.
  • With decision.logDecisions the console shows lines like Threat +1.50 ALLY_ASSISTED for player_2 sent to the table of mob <uuid> or Threat -2.00 UNREACHABLE for player_1 sent to the table of mob <uuid>, without player names.

ThePredict 0.0.1 · release candidate. These pages describe this build, checked against its source code; it has not been verified on a live server yet.

ThePredict is an independent MythicMobs addon. Jev is TypeSafe's decision model; naming it does not imply endorsement. Fonts: Pixelify Sans, Inter and JetBrains Mono, under the SIL Open Font License.