Skip to content

Instantly share code, notes, and snippets.

@JasperLorelai
Last active February 12, 2024 00:41
Show Gist options
  • Save JasperLorelai/91c50398a2d0e07cf84425d8a6ed8295 to your computer and use it in GitHub Desktop.
Save JasperLorelai/91c50398a2d0e07cf84425d8a6ed8295 to your computer and use it in GitHub Desktop.

Bugfixes:

  • Fixed console command completion for some commands.
  • Fixed showing mana on the food bar so that food changes are fake and food levels aren't modified.
  • Fixed modifying global variables without a player.
  • Fixed RepairSpell saving the repaired chestplate into the helmet slot.
  • Fixed an issue that caused targeting to fail on players if can-target was not specified.
  • Fixed SilenceSpell overriding its targeting to always target players.
  • Fixed an issue that caused invalid entries in remove on CleanseSpell to cause an error.
  • Fixed NPE (error) caused by FlightPathSpell option land-spell not being specified.
  • Fixed ExternalCommandSpell block-chat-output without ProtocolLib sending black lines even when str-blocked-output is empty.

Additions:

  • /ms cast as and /ms cast on will now return the UUID/username of the ray-traced target first.
  • Added /ms util listgoals [uuid] command for listing mob goals of an entity.
  • Added clientbrandname data element and clientname modifier condition (ConditionVar should be the name to compare to for the condition to pass). If the client didn't send this information, the brand name will be null (empty with the data element). For the Notchian client this name defaults to vanilla. Some modified clients report other names such as forge & fabric.
  • Added store-chat-output (Variable name) to ExternalCommandSpell - requires ProtocolLib.

New Spell Effects:

These options support dynamic values through numeric or string expressions.

gametestaddmarker:

Option Description Type Default
name Displayed text. String
color ARGB Color ff000000 (black)
viewer Can be: caster, target, or position. String position
lifetime In milliseconds. Integer 1000
broadcast Sent to all players in the same world. Boolean false
use-viewer-as-target Determines whether the viewer of the effect should be used as the "target" in expressions. Boolean false
use-viewer-as-default Determines whether the viewer of the effect should be used for "recipient" in expressions. Boolean true

Screenshot

gametestclearmarkers:

Option Description Type Default
viewer Can be: caster, target, or position. String position
broadcast Removed for all players in the same world. Boolean false

Structure Spell:

Targets: location.

spell-class: ".targeted.StructureSpell"

Options (support expressions):

  • structure-key (NamespacedKey)
  • rotation (StructureRotation, none by default)
  • mirror (Mirror, none by default)
  • palette (Integer, 0 by default) - The palette index of the structure to use, starting at 0, or -1 to pick a random palette.
  • integrity (Float, 1 by default) - Determines how damaged the building should look by randomly skipping blocks to place. This value can range from 0 to 1. With 0 removing all blocks and 1 spawning the structure in pristine condition.
  • include-entities (Boolean, true by default)
  • relative-offset (Vector)
  • absolute-offset (Vector)
  • point-blank (Boolean, false by default)

Mob Goal Edit Spell:

Targets: entity.

spell-class: ".targeted.MobGoalEditSpell"

You cannot add vanilla goals as that is still WIP on PaperMC's side but they could be rewritten as custom goals. Currently the only custom goals we provide are: look_at_entity_type and path_to.

Custom goals are removed from entities during server restart and sometimes during chunk unload (where the entity is). At the moment to have persistent goals you have to apply them along with a TagEntitySpell, then on the magicspellsloading passive trigger target all entities with an AOE spell with ignore-radius, filtering for entities with the applied tag, then target them with the same MobGoalEditSpell spell to re-apply goals.

Options:

  • remove-all - Boolean, false by default, supports expressions.
  • remove-types - List of GoalType.
  • remove-vanilla - List of VanillaGoal. While you could use remove with the appropriate namespaced key (minecraft:...), the key sometimes differs from the VanillaGoal field name. This option also throws errors on invalid VanillaGoals listed - goals are often removed or renamed between minecraft versions.
  • remove - List of NamespacedKey strings. magicspells is the default namespace if left unspecified.
  • add - List of configuration sections to configure a custom goal to be added. Each should have a goal to specify the custom goal to add, an optional priority option (Integer, 0 by default), and a data configuration section to pass possibly required additional data to a goal. Example:
add:
    - goal: path_to
      priority: 1
      data:
        position:
          x: "%var:meta_location_x%"
          y: "%var:meta_location_y%"
          z: "%var:meta_location_z%"

Built-in custom goal data:

These options support dynamic values through numeric or string expressions.

look_at_entity_type:

Due to default values, data in this goal isn't required.

Option Type Default
range Float 10
chance Float 100
only-horizontal Boolean false
type Entity Type player

path_to:

In this goal data is required because position is required.

Option Description Type Default
speed Walk speed. Double 0.2
position Position in the same world as the entity, hence a vector. Vector
distance-allowed Distance above which to activate the goal. Double 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment