Magic

Magic

190k Downloads

Magic Mob Wands/Attributes Issue

NightScythe1 opened this issue ยท 2 comments

commented

It doesn't seem to be possible to functionally apply custom magic attributes to Magic Mobs, or at least checking for them being present is quite difficult. I'm working on a new 'stat' system for the HTTYD pack, and part of this includes giving dragons some Magic Attributes on their held wand. However, I can't seem to use other spells to check/read the Mob's stat:

read_dragon:
  actions:
    cast:
    - class: CustomProjectile
      actions:
        - class: Message
          message_target: false
          message: "TARGET: $target_health_dragon"
        - class: Message
          message_target: false
          message: "CASTER: $health_dragon"
        - class: Message
          message_target: true
          message: "TARGET: $target_health_dragon"
        - class: Message
          message_target: true
          message: "CASTER: $health_dragon"
  parameters:
    target: other
    range: 32

I've tried attaching this to a Magic Mob's "interact_spell" and changing the "interact_spell_source" and "interact_spell_target" between "mob" and "player" but every time, it will only read the player's stat (regardless if they're the source or target) but never the mob's. The mob's stat is always printed as 0. I've tried applying the attribute directly to the mob and applying it to the mob's item but neither work. Since i'll have to be using this stat in formulas in spells, I'd need it to be able to print the mob's value and not default to 0.

Another weird factor is that when running the following command next to the mob to get all of its data:
/data get entity @e[distance=..10,limit=1,type=!minecraft:player]
It does print the mob's correct attribute, but only when its attribute is on an item, and it doesn't print it when it's applied directly to the mob's config.

commented

Magic Mobs can't edit held wands through spells either, for instance through the use of ModifyProperties.

commented

Turns out I needed to apply the mob's attributes under the 'mage' parameter. E.g.

  mage:
    attributes:
      health_species: 1.5

However, the issue persists with held-item/wand attributes not being applied