Skip to content

Delay.isDelayed does not track at trigger-level and causes evaluation mistakes across event triggers. #8298

@Jjman739

Description

@Jjman739

Skript/Server Version

[20:32:30 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[20:32:30 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[20:32:30 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[20:32:30 INFO]: [Skript] Server Version: 1.21.8-60-29c8822 (MC: 1.21.8)
[20:32:30 INFO]: [Skript] Skript Version: 2.13.1 (skriptlang-github)
[20:32:30 INFO]: [Skript] Installed Skript Addons: None
[20:32:30 INFO]: [Skript] Installed dependencies: None

Bug Description

I have no idea how or why, but for some reason, when one script has an "on target" event that waits 1 tick and then checks if the target exists, any other target events lose the ability to read the target listener. However, this error only occurs on a cold start. Reloading the offending script fixes it until the next server reboot.

Expected Behavior

What one script does should not affect event variable availability in another script. Specifically in this case, regardless of the state of the offending script, other "on target" listeners should be able to grab the target from the event.

Steps to Reproduce

Step 1
Write listener.sk

on target:
	send action bar "%entity% is targeting %target%" to all players

Have an iron golem fight a spider or something. Note that it works as expected.
iron golem is targeting spider

Step 2
Write interference.sk

on target:
	wait 1 tick
	target of entity exists

Spawn a new spider in front of the golem, and note that it still works.

Step 3
Stop the server and launch it again.
Spawn a new spider, and see that it breaks.
iron golem is targeting <none>

Step 4
Run /skript reload interference.sk
Spawn a new spider, and see that it works again.

Errors or Screenshots

No response

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn issue that needs to be fixed. Alternatively, a PR fixing an issue.priority: lowIssues that are not harmful to the experience but are related to useful changes or additions.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions