elBukkit / MagicPlugin

A Bukkit plugin for spells, wands and other magic
http://mine.elmakers.com
MIT License
247 stars 148 forks source link

class brain OCELOT_ATTACK didn't end attacka after defeat enemy #1210

Open vajuvung opened 1 year ago

vajuvung commented 1 year ago

So if i use ocelot attack and X entity with ocelot attack defeat Y entity then X entity will still try to kill Y entity that didn't exist and will stuck in one place and cast spell until X entity didn't die. Any solution?

code:

mag_minion:
  icon: gold_nugget{CustomModelData:10}
  icon_disabled: barrier
  quick_cast: true
  requires: LibsDisguises
  hidden: true
  locked: true
  mode: hidden
  ownable: true
  actions:
    cast:
    - class: SpawnEntity
      owned: true
      entity_attributes:
        generic_attack_damage: "attack_damage * 1"
      brain:
        goals:
        - type: trigger
          trigger: attack
          priority: 1
          goals:
            - OCELOT_ATTACK
        - type: follow_owner
          priority: 2
        - type: random_stroll
          distance: 12
          priority: 3
        targets:
          - MAGIC_OWNER_HURT_TARGET
          - MAGIC_OWNER_HURT_BY_TARGET
      triggers:
        attack:
          cast:
            Podstawowy_atak: 20   
  parameters:
    target: self
    health: "health_max * 5"
    radius: 2
    helmet: iron_helmet
    cancel_on_damage: 0.5
    type: skeleton
    name: Mag
    item: bow
    disguise_target: self
PhvntxmX commented 1 year ago

why you are using it like this? its simply triggers itself lol

vajuvung commented 1 year ago

i wanted to create mob that slow down movement speed when attack target and normal movement speed when follow player/leader