PaperMC / PaperMC/Paper

NoSuchMethodError for (removed adventure) Book interface's setter

Open
#14,030 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: needs triage version: 26.2
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior

When compiling against Paper 26.1.2 (or before) using the BookMeta#pages setter methods should also work on a 26.2 server since it is api.

Observed/Actual behavior

[17:35:25 INFO]: TheosRee issued server command: /bookmetatest getter
[17:35:29 INFO]: TheosRee issued server command: /bookmetatest setterArray
[17:35:29 ERROR]: Command exception: /bookmetatest setterArray
java.lang.NoSuchMethodError: 'net.kyori.adventure.inventory.Book org.bukkit.inventory.meta.BookMeta.pages(net.kyori.adventure.text.Component[])'
at TR-Test.jar//de.ree.theos.Test$1.execute(Test.java:69) ~[?:?]
at io.papermc.paper.command.brigadier.bukkit.BukkitCommandNode$BukkitBrigCommand.run(BukkitCommandNode.java:83) ~[paper-26.2.jar:26.2-20-2c0341f]
at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.3.10.jar:?]
at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:30) ~[paper-26.2.jar:26.2-20-2c0341f]
[…more stack trace]
[17:35:33 INFO]: TheosRee issued server command: /bookmetatest setterList
[17:35:33 ERROR]: Command exception: /bookmetatest setterList
java.lang.NoSuchMethodError: 'net.kyori.adventure.inventory.Book org.bukkit.inventory.meta.BookMeta.pages(java.util.List)'
at TR-Test.jar//de.ree.theos.Test$1.execute(Test.java:68) ~[?:?]
at io.papermc.paper.command.brigadier.bukkit.BukkitCommandNode$BukkitBrigCommand.run(BukkitCommandNode.java:83) ~[paper-26.2.jar:26.2-20-2c0341f]
at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.3.10.jar:?]
at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:30) ~[paper-26.2.jar:26.2-20-2c0341f]
[…more stack trace]

Steps/models to reproduce
getServer().getCommandMap().register("ignored", new Command("bookmetatest") {
    @Override
    public boolean execute(final CommandSender sender, final String label, final String[] args) {
        final ItemStack book = ItemStack.of(Material.WRITTEN_BOOK);
        final BookMeta meta = (BookMeta) book.getItemMeta();
        switch (args[0]) {
            case "getter" -> meta.pages();
            case "setterList" -> meta.pages(List.of());
            case "setterArray" -> meta.pages(Component.empty());
        }
        return true;
    }
});

targetting the following version or any before down to like 1.18

<dependency>
    <groupId>io.papermc.paper</groupId>
    <artifactId>paper-api</artifactId>
    <version>26.1.2.build.72.stable</version>
    <scope>provided</scope>
</dependency>
Plugin and Datapack List

The test plugin

Paper version

This server is running Paper version 26.2-20-dev/26.2@2c0341f (2026-06-17T19:31:24Z) (Implementing API version 26.2.build.20-alpha)
You are 28 version(s) behind
Download the new version at: https://papermc.io/downloads/paper
Previous version: 26.2-19-80d1098 (MC: 26.2)

This server is running Paper version 26.2-48-main@87c4d42 (2026-07-04T14:09:05Z) (Implementing API version 26.2.build.48-alpha)
You are running the latest version
Previous version: 26.2-20-2c0341f (MC: 26.2)

Other

it is since https://fill-ui.papermc.io/projects/paper/version/26.2?build=20 with
https://github.com/PaperMC/Paper/commit/2c0341f9f291cba995c5293122bf888138427d17#diff-e0871225f23971b54756b88cbe0d16e1aa4995d857a5d0c56aa7c18e904f647eL17-R20
I asked on Discord and it was suggested to open the issue in Paper instead Adventure because it is an Item-/BookMeta issue and should probably get an api-version rewrite.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the BookMeta.pages(List) and pages(Component[]) calls in the reproduction, then inspect the API change in commit 2c0341f9f291cba995c5293122bf888138427d17. Check the Paper API compatibility and api-version rewrite handling around BookMeta. Done means plugins compiled against 26.1.2 can invoke both setters on 26.2 without NoSuchMethodError, with regression coverage for the shown cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
47/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.