#How do I add tags to an item, again?

26 messages · Page 1 of 1 (latest)

dense cipher
#

The idea is adding two tags to book like items, so that they can get placed on bookshelves from "Workshop for handsome adventurers", and the same with the potion racks. This is like the third way I try to make this happen... what am I doing wrong? It has to be something incredibly stupid, I just can't see it. Can someone lend me a hand and two neurons?

crude ironBOT
#

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

surreal schoonerBOT
#

Paste version of server.log, workshop_for_handsome_adventurers.js from @dense cipher

#

You can modify tags with KubeJS, and the wiki has a page on that!

dense cipher
#

Yeah. Exactly. This didn't work: event.add('forge:cobblestone', 'minecraft:diamond_ore')

#

This one didn't work either: event.add('c:stones', '#forge:stone')

#

what am I doing wrong!??

boreal ice
#

define "didnt work" hmmm

dense cipher
#

The tag was not added to the items, name by id. When you checked with /bookshelf hand TAGS with one of them in hand, the item didn't have the tags

#

Am I breaking everything because I put it into a function?

boreal ice
#

im trying to read your script, and i cant tell what youre trying to do there

#

these strings, are they IDs or tags?

dense cipher
#

those are item IDs

boreal ice
#

because then in the function youre using them as tags

#

which dont exist

#

so it returns no items

#

so nothing changes

#

give me a minute to refactor this

dense cipher
#

sure, thanks a lot

boreal ice
#

what exactly are you trying to do with event.get(books_to_add).getObjectIds()

dense cipher
#

good question. I was thinking you had to call that to get the object id from the string I was using. That's to get item ids from a tag, then?

#

I think I understand now why it failled

boreal ice
#

maybe this is closer to what you want

#
console.info('KJS: Workshop for handsome adventurers')

function make_book_shelfable(e, book_to_add) {
    console.info("KJS[WFHA]: add books to shelves - " + book_to_add)
    e.add('c:books', book_to_add)
    e.add('forge:books', book_to_add)
}

function make_bottle_shelfable(e, bottle_to_add) {
    console.info("KJS[WFHA]: add bottles to shelves - " + bottle_to_add)
    e.add('workshop_for_handsome_adventurer:allowed_on_potion_shelf', bottle_to_add)
}

ServerEvents.tags('item', e => {
    make_book_shelfable(e, 'vampirism:vampire_book')
    make_book_shelfable(e, 'minecraft:enchanted_book')
    make_book_shelfable(e, 'patchouli:guide_book')
    make_bottle_shelfable(e, 'botania:mana_bottle')
})

console.info('KJS: Workshop for handsome adventurers - ENDED')
dense cipher
#

Yeah, I just redid the functions into something very similar to that, and it finally worked

#

Thank you so much, I've been on tilt for an hour at least xDDDD