#how to read multilayered nbt

24 messages · Page 1 of 1 (latest)

sacred palm
#

i'm trying to get the id of the fluid from the mekanism chemical tank and it's stored in the nbt I just don't know how to access it.

winged ivyBOT
#

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

sacred palm
#

it looks like {mekData:{GasTanks:[{Tank:0b,stored:{amount:9223372036854775807L,gasName:"mekanism:steam"}}]}} btw

spring hare
#

nbt.mekData.GasTanks[0].stored.gasName

sacred palm
#

other question, how would you get the mod id from said fluid id

spring hare
#

the mekanism part?

sacred palm
#

yeah

spring hare
#
let id = nbt.mekData.GasTanks[0].stored.gasName
let mod = id.split(':')[0]
sacred palm
#

also do liquids have block lang?

spring hare
#

they should but i dont know much about those or how to get it hmmm

sacred palm
#

how can i turn mod.somegas into gas.mod.somegas

spring hare
#

as a string?

sacred palm
#

yeah

spring hare
#

just append ;o

#

'gas.' + 'mod.somegas'

sacred palm
#

right...

#

always gotta overlook the simple things heh

spring hare
sacred palm
#

it works!

spring hare
#

noice

sacred palm
#

for reference (i'll probably example script this)

hybrid perchBOT
#

Paste version of message.js from @sacred palm

hybrid perchBOT
#

Please close your ticket (with </ticket close:1054771505520717835> or the button atop this thread) once you resolved your issue! This also helps others that would like to help out, as they don't have to look into this thread to check if it has been resolved by now.

Do you have any other questions regarding your issue? Feel free to ask!
Note: You should generally create a new post for unrelated issues.