#Painter API logspam

18 messages · Page 1 of 1 (latest)

late zodiac
#

I was trying to make a bar of sorts when I encountered an issue with the Painter API. I have no errors in the logs and I'm very confused because this is my first time using Painter.

My current code is as-is in the file attached.

wooden pivotBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

late zodiac
#

gnome >:(

#

well at least the entire file is visible from discord

topaz roost
#

pretty sure painter is client only

late zodiac
#

then why does it draw correctly from the server

#

it works perfectly but it just kills the logs

topaz roost
#

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

late zodiac
#

hmm

#

i'll try that when i get back on

topaz roost
#

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.
late zodiac
#

i think i got it to work

#

yeah

#

i did

#

doing what the wiki said worked