Magic

Magic

190k Downloads

CloseInventory class not working

NightScythe1 opened this issue · 0 comments

commented

The 'CloseInventory' class doesn't seem to be working. The 'checktrigger' for 'right_click' and 'interact' also do not seem to trigger when opening containers, GUIs, etc.
Video here to show the spell below in action
This spell is designed to be a 'scrying' spell, but is supposed to stop & cancel if the player interacts with anything and closes the inventory on a constant repeat. It works if the player tries to attack or interact with a normal block, but they can still open containers & inventory.

scry:
  creator: NightScythe1
  creator_id: 22e0650d-d3f2-4bbc-afef-02bd3b1407ec
  name: Scry
  description: |-
    §7Spy on a target in
    §7the same dimension as
    §7you. §cWARNING!§7 Must
    §7have an empty inventory
    §7except for scrying item.
  icon: spyglass
  cancel_effects: true
  actions:
    cast:
    - class: PlayEffects
      effect: scry
    - class: PlayerSelect
      cross_world: false
      actions:
        - class: Parallel
          actions:
            - class: ChangeContext
              target_caster: true
              target_self: true
              target: self
              actions:
                - class: StashWand
                  return_on_finish: true
                - class: ClearInventory
                - class: Vanish
                - class: SpawnEntity
                  invulnerable: true
                  type: armor_stand
                  set_target: true
                  disguise_target: self
                  disguise:
                    type: player
                - class: PlayEffects
                  effect: scry_target
                - class: Interval
                  duration: 20000
                  actions:
                    - class: Command
                      command: clear @p
                      console: true
                    - class: InventoryClose
                    - class: Disarm
                      keep_in_inventory: true
                    - class: CheckTrigger
                      trigger: drop
                      actions:
                        - class: Teleport
                        - class: Stop
                    - class: CheckTrigger
                      trigger: block
                      actions:
                        - class: Teleport
                        - class: Stop
                    - class: CheckTrigger
                      trigger: interact
                      actions:
                        - class: Teleport
                        - class: Stop
                    - class: CheckTrigger
                      trigger: death
                      actions:
                        - class: Teleport
                        - class: Stop
                    - class: CheckTrigger
                      trigger: damage_dealt
                      actions:
                        - class: Teleport
                        - class: Stop
                    - class: CheckTrigger
                      trigger: damage
                      actions:
                        - class: Teleport
                        - class: Stop
                    - class: CheckTrigger
                      trigger: left_click
                      actions:
                        - class: Teleport
                        - class: Stop
                    - class: CheckTrigger
                      trigger: right_click
                      actions:
                        - class: Teleport
                        - class: Stop
                - class: Teleport
            - class: Interval
              duration: 20000
              actions:
                - class: ChangeContext
                  target_caster: true
                  actions:
                    - class: Velocity
                      speed: 0
                    - class: PotionEffect
                      duration: 250
                      effects_particles: false
                      add_effects:
                        levitation: 255
                        weakness: 10
                        slow_digging: 10
                        invisibility: 0
            - class: Teleport
  parameters:
    undo: 10
    target: none
    target_armor_stand: true
    target_invisible: true
    target_self: false