#Remove tag on block.right_click event

8 messages · Page 1 of 1 (latest)

lyric oracle
#

i cant figure out how to remove a blocks custom tag on right click (its in a seperate script and verified working), and im fairly sure im just laying out my code incorrectly ... im trying to go through an array of log ids, which will remove their "sapable" tag and damage the sap tap. the blocks arent losing their tags, and the item isnt even getting to the cooldown state either so its not working at all for some reason. ive tried troubleshooting it for like an hr and i still cant figure it out

    const sapLogs = ["#tfc:douglas_fir_logs", "#tfc:spruce_logs", "#tfc:maple_logs", "#tfc:palm_logs"]
    sapLogs.forEach((blockID) => {
        if(event.block.id == blockID && event.item == "kubejs:sap_tap") {
            event.player.addItemCooldown("kubejs:sap_tap", 5)
            if (!event.block.hasTag("ztfc:sapable")) { return; }
            event.player.damageHeldItem("MAIN_HAND", 1)
            event.block.tags.removeTag("ztfc:sapable")
        }
    });
});```
hearty ferryBOT
#

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

lime briar
#

you cannot modify tags at runtime like that

#

plus tags are per block type, not per block in the world

lyric oracle
#

aw, is there any alternative i can do?

lime briar
#

replace it with a different block

lyric oracle
#

thats a fair point, a lot of texturing but yea

#

ty ty