Paper
Paper copied to clipboard
IllegalArgumentException when using Painting#getArt() on custom painting variant
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
- Install the TestPainting datapack on the server TestPainting.zip
- Give yourself the custom painting with
/give @p painting[entity_data={id:"minecraft:painting",variant:"test:new_painting"}]
- 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