Skip to content

Fix datapack location on 26.x - #777

Open
JsNcAr wants to merge 2 commits into
APDevTeam:mainfrom
JsNcAr:fix/datapack-location
Open

JsNcAr wants to merge 2 commits into
APDevTeam:mainfrom
JsNcAr:fix/datapack-location

Conversation

@JsNcAr

@JsNcAr JsNcAr commented Nov 11, 2026

Copy link
Copy Markdown

Describe in detail what your pull request accomplishes

Since 26.1, World#getWorldFolder() returns the dimension folder, so initializeDatapack() saved movecraft-data.zip into world/dimensions/minecraft/the_end/datapacks, where the server never loads it. This uses Server#getLevelDirectory() (26.1+) through reflection, since the shared code compiles against 1.20.6, and falls back to the main world's folder on older versions.

It also stops onEnable() after initializeDatapack() disables the plugin, which caused the IllegalPluginAccessException.

Servers that already hit the bug recover on the next start: a new pack is written to world/datapacks and enabled.

Tested on Paper 26.2 build 135 (fresh world and an already-affected world) and Paper 1.21.11 build 132 (fresh world): the pack is enabled on first start, and all craft types load on first start and on restart.

Related issues:

Checklist

  • Proper internationalization
  • Tested

JsNcAr and others added 2 commits November 11, 2026 10:23
Since 26.1, World#getWorldFolder() returns the dimension folder, so the
datapack was saved into world/dimensions/minecraft/<dimension>/datapacks,
where the server never loads it. Use Server#getLevelDirectory() when it
exists and fall back to the main world's folder on older versions.

Fixes APDevTeam#776

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
initializeDatapack() calls setEnabled(false) when the datapack cannot be
loaded, but onEnable() kept going and scheduled tasks on the disabled
plugin, causing an IllegalPluginAccessException.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Datapack is saved into a dimension folder on 26.x, so it never loads on fresh servers

1 participant