#Painter API logspam
18 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
pretty sure painter is client only
then why does it draw correctly from the server
it works perfectly but it just kills the logs
it's because you're trying to always remove objects even if they aren't currently painted
if (bp(event.player) == bpMax(event.player)) {
event.server.scheduleInTicks(20, (cb) => {
event.player.paint({bpbg: {remove: true}})
event.player.paint({bpbg2: {remove: true}})
event.player.paint({bp: {remove: true}})
})
}
it's complaining because of this step and saying that the object doesn't exist you're trying to remove
you can do
event.player.paint({"*":{remove:true}})
and it should happily clear everything without complaint
or it looks like at a minimum the object needs a type.... so
event.player.paint({bpbg: {type:"rectangle", remove: true}})
might also work
not sure on the second one
other other other option, from the wiki https://wiki.latvian.dev/books/kubejs-legacy/page/painter-api
is to attach the painter objects to the player at login and make them visible or not as needed.... then if you're always sending visible:false it's no big deal
If the object is re-occuring, it's recommended to create objects at login with all of its static properties and visible: false, then update it later to unhide it. Painter objects will be cleared when players leave world/server, if its persistent, then it must be re-added at login every time.