Skip to content

IllegalArgumentException when using Painting#getArt() on custom painting variant #11237

@Toseflo

Description

@Toseflo

Expected behavior

1.21 introduced support for data driven custom paintings. I didn't expect them to throw an exception.

Observed/Actual behavior

You get the following stacktrace when trying to run the method.
stacktrace.txt

Steps/models to reproduce

  1. Install the TestPainting datapack on the server
    TestPainting.zip
  2. Give yourself the custom painting with /give @p painting[entity_data={id:"minecraft:painting",variant:"test:new_painting"}]
  3. Run Painting#getArt(), e.g., with this event listener:
public class TestListener implements Listener {
    @EventHandler
    public void onHangingPlace(HangingPlaceEvent event) {
        Entity entity = event.getEntity();
        if (!(entity instanceof Painting painting)) {
            return;
        }

        painting.getArt();
    }
}

Plugin and Datapack List

Only the TestPainting datapack and a plugin for the event listener.

Paper version

This server is running Paper version 1.21.1-5-master@7d7f123 (2024-08-10T22:35:17Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21-49-b0ef3ca (MC: 1.21)

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.type: bugSomething doesn't work as it was intended to.upstream: bukkitIssues exists in Bukkit and/or CraftBukkit.version: 1.21.1Game version 1.21.1

    Type

    No fields configured for Bug.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions