Skip to content

Bad custom event load order #154

@AmazinAxel

Description

@AmazinAxel

Describe the bug

Events initialized in a different folder are not parsed first and cause errors when reloading all scripts

To reproduce

Put this code in a file in the server's root scripts folder (e.g. customevent.sk)

event "test":
	pattern: test

Then, put this code in a folder (e.g. test/test.sk)

on test:
	exit

Reload all scripts (or restart the server) - you will get this error

Image

Notice that when reloading just test/test.sk, there won't be an error

Expected behavior

There should not be an error when reloading all scripts

Server information

  • skript-reflect: v2.6.1
  • Skript: v3.13.1
  • Bukkit: Paper 1.21.10-113-9fc21bc
  • Minecraft: 1.21.10
  • Java:
openjdk 21.0.9 2025-10-21
OpenJDK Runtime Environment (build 21.0.9+8-nixos)
OpenJDK 64-Bit Server VM (build 21.0.9+8-nixos, mixed mode, sharing)
  • OS: NixOS (25.11.20251108.b6a8526 - Xantusia)

Additional context

Putting the event code in a folder prefixed with ! fixes the issue. The custom event is not loaded before parsing the rest of the code.
This issue does not occur when the custom event is declared and used in the same folder - this seemingly only affects custom events called in subdirectories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions