#Cant add tags to fluids

128 messages · Page 1 of 1 (latest)

autumn spruce
#
ServerEvents.tags('block', event => {
    const path_array = ['rnr:base_course', 'tfc:salt_water', 'tfc:river_water', 'minecraft:water']

    path_array.forEach(block => {
        event.add('via_romana:path_block', block)
        event.add('tfc:paths', block)
    })
})

Trying to add path tags to these blocks. Tags are not showing up in JEI and seemingly not working in via romana either. First time using kubejs. This is located in server_scripts. Using neoforge not forge. Reloads without errors.

ionic vergeBOT
#

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

west tangle
#

you don’t have to do it like that

#
ServerEvents.tags('block', event => {
    const path_array = ['rnr:base_course', 'tfc:salt_water', 'tfc:river_water', 'minecraft:water']

    event.add('via_romana:path_block', path_array)
    event.add('tfc:paths', path_array)

})
#

anyhow tags are kindof broken

autumn spruce
#

but let me double check to make sure it doesnt work like that either

west tangle
#

either ways makes no difference but that forEach is inefficient

autumn spruce
#

yeah it did not make a difference

west tangle
#

try reloading twice

#

or re-join world and /reload

#

and they should work but never on first world load 😒

#

kubejs has some issues

autumn spruce
#

tried restarting the entire game already

west tangle
#

may be better off making a datapack of tags

#

for now

autumn spruce
#

absolutely no idea how to do that

#

ah ok seems straightforward

autumn spruce
west tangle
#

kubejs/data/via_romana/tags/blocks/path_block.json

kubejs/data/tfc/tags/blocks/paths.json

{
  "replace": false,
  "values": [
    "rnr:base_course",
    "tfc:salt_water",
    "tfc:river_water",
    "minecraft:water"
  ]
}
#

you’re adding block tags, so tags/blocks

autumn spruce
#

ah right

#

ok got it thanks

west tangle
#

also note that

#

if those 2 tags already exist, you’ll be replacing it with just those

#

i forgot exactly how to not have tags be replaced

autumn spruce
#

you pass "replace": false

west tangle
#

right

autumn spruce
#

can i just /reload datapacks ?

west tangle
#

yea

autumn spruce
#

doesnt seem to be working 😃

west tangle
#

atleast i thought 😅

autumn spruce
#

trying restarting

west tangle
#

also hmm, second thought, i wonder if they’re supposed to blocks and not fluid

autumn spruce
#

yeah no still no luck

#

well the base course block doesnt get the tag either

west tangle
#

or items instead

#

hmm

#

weird

autumn spruce
#

ill try with fluids

#

nope lol

west tangle
#

i honestly had given up trying to use tags with kubejs because what i’m doing is more complicated

#

getting tags from items and mix/matching them around with other items dynamically, hard to do datapacks lol

#

especially since getting tags on items first load doesn’t work until after you reload 😔

#

and some items won’t even give tags

#

it’s a mess, and i can’t figure out why tags are acting like this

#

though i haven’t had an issue adding tags normally

autumn spruce
#

hmm im not sure im using this correctly but using /kubejs list_tags forge:fluid_type lists 0 fluids so maybe theyre not registered correctly

#

but ive got no idea how this works nowadays 🥲

#

ah it is a minecraft fluid

#

so let me try this

I guess now I know For anybody wondering, Fluid tags go in datapacks\yourdatapackfolder\data\minecraft\tags\fluids\

west tangle
#

didn’t you just try fluids and it didn’t work?

#

you used kubejs event or renamed datapack folder?

autumn spruce
#

renamed folder

west tangle
#

oh you moved to minecraft namespace

#

if you did /kubejs list_tags tfc:fluids

#

it should’ve showed there

autumn spruce
#

tfc:fluids doesnt exist

#

it shows in minecraft:fluids though

#

ah

west tangle
#

but you created that datapack entry so it should’ve existed

#

i’m so confused

autumn spruce
#

would be huge if things just worked

west tangle
#

yea such a headache

autumn spruce
#

ok so tfc has a different tag for flowing fluids

#

so it got tfc:salt_water and tfc:flowing_salt_water

#

so i will just add both to my via_romana allowed blocks list

autumn spruce
#

ok stupid question

#

if kubejs list_tags minecraft:fluid gives me the tag tfc:any_water

#

do i reference it via tfc:any_water ?

west tangle
#

#tfc:any_water

autumn spruce
#

yeah via romana config omits the # unless there is a distinction between including # and without # but given that the tag tfc:paths worked i wouldnt assume so

west tangle
#

you can only reference from same tag type

autumn spruce
#

using minecraft:fluid doesnt work either

autumn spruce
#

Cant add tags to fluids

west tangle
#

like if you have tags in romana/tags/fluids/path_blocks.json

you can’t reference that in minecraft/tags/blocks/, only minecraft/tags/fluids

autumn spruce
#

ah ok

west tangle
#

you would have to put path_blocks in each fluids, items, blocks to be referenced in fluids, items, blocks, etc

#

that was my message i deleted cause i second doubted myself if you can reference but yea you can

#

just gotta make sure it’s tagged with prefix #

#

may be helpful looking at these tags too

autumn spruce
#

sorry, im super unfamiliar with how minecraft works

#

if i have the tfc:any_water tag listed under minecraft:fluid

#

const water_blocks = event.get('tfc:any_water').getObjectIds()
Do i get all fluid blocks like this ?

west tangle
#

if #tfc:any_water is reference under #minecraft:fluid, tfc:any_fluid would all be minecraft:fluid, so #minecraft:fluid would have all tfc:any_water tags

autumn spruce
#

can you give me an example of how i would do the above? Im not sure i follow

west tangle
#

if you want all minecraft fluids to be tfc fluid, you’ll reference #minecraft:fluid in #tfc:any_fluids

autumn spruce
#

no i just want to get all object ids of objects/blocks/fluids listed under #tfc:any_fluids

west tangle
#

oh

autumn spruce
#
ServerEvents.tags('fluid', event => {
         const add_tags_to = event.get('tfc:any_water').getObjectIds()
      event.add('via_romana:path_block', add_tags_to)
})

figured i should try changing the 'block' argument to fluid maybe

#

not sure that fixes anything

#

but minecraft just freezes

west tangle
#

in your script, you’ll be getting all id’s and tags from tfc:any_fluds and adding it to via_romana:path_blocks

autumn spruce
#

is that not what i want to do

west tangle
#

yes you asked and was correcting that’s right

autumn spruce
#

ok great -- it still doesnt work lol

#
ServerEvents.tags('fluid', event => {
         const add_tags_to = event.get('tfc:any_water').getObjectIds()
      event.add('via_romana:path_block', add_tags_to)
    event.add('tfc:paths', add_tags_to)
})
ServerEvents.tags('block', event => {
         const add_tags_to = event.get('tfc:any_water').getObjectIds()
      event.add('via_romana:path_block', add_tags_to)
    event.add('tfc:paths', add_tags_to)
})
ServerEvents.tags('item', event => {
         const add_tags_to = event.get('tfc:any_water').getObjectIds()
      event.add('via_romana:path_block', add_tags_to)
    event.add('tfc:paths', add_tags_to)
})

doesnt either

west tangle
#

after you add tags you can check them:

console.log(event.get('via_romana:path_block').getObjectIds())

#

and look in logs/kubejs/server.log for output

#

and or do /kubejs list_tags via_romana:path_block

autumn spruce
#

empty array 🤔

west tangle
#

blame kubejs

#

it might not be getting the tags from tfc:any_water

autumn spruce
west tangle
#

that has been my issue, even just getting tags from an ItemStack. always an empty array

autumn spruce
#

in general only forge, minecraft and moonlight have a registry

west tangle
#

check

console.log(event.get('tfc:any_water').getObjectIds())

autumn spruce
#

tfc any water:[minecraft:water, minecraft:flowing_water, tfc:river_water, tfc:salt_water, tfc:flowing_salt_water, tfc:spring_water, tfc:flowing_spring_water]

#

looks correct

west tangle
#

weird so tags aren’t being added at all

autumn spruce
#

stupid question

#

do i need to move the server startup script folder to my world folder

#

given it logs correctly i wouldnt assume so

west tangle
#

lol no

#

i wonder if it’s because it’s a list and not an array? try this

ServerEvents.tags('fluid', event => {
         const add_tags_to = event.get('tfc:any_water').getObjectIds().toArray()
      event.add('via_romana:path_block', add_tags_to)
})
west tangle
#

i really don’t know anymore. i gave up on using kubejs with tags for now until it’s fixed, for the 11th time lol

autumn spruce
#

already tried with a foreach over it instead of an iterable

#

toArray conversion doesnt work either

#

HUH

#

🙏 please let the restart work

#

Assuming it is a via romana issue now since it is tagged