C
C#5d ago
Slait

How to get value in big TagCompound

I`m making minecraft schematic analyzer in c#, and i need to get BlockList and BlockPalette from entity. It looks like this:
entity: (Compound)
CanUpdate: 1
Contraption: (Compound)
Type: bearing
Anchor: (Compound)
Y: 0
Z: 0
X: 0
Blocks: (Compound)
BlockList: List with 1 items
Palette: List with 1 items
SubContraptions: List with 0 items
CapturedMultiblocks: List with 0 items
DisabledActors: List with 0 items
Actors: List with 0 items
Superglue: List with 0 items
Stalled: 0
BoundsFront: List with 6 items
BottomlessSupply: 0
Interactors: List with 0 items
Facing: 1
Passengers: List with 0 items
Seats: List with 0 items
Sails: 0
OnGround: 0
Angle: 52,797543
Stalled: 0
Air: 300
ControllerRelative: (Compound)
Y: -1
Z: 0
X: 0
UUID: System.Int32[]
Invulnerable: 0
id: create:stationary_contraption
FallDistance: 0
ForgeCaps: (Compound)
Motion: List with 3 items
Rotation: List with 2 items
Axis: Y
Pos: List with 3 items
Fire: -1
PortalCooldown: 0
Initialized: 1
posx: -0,5
posy: 0,5
posz: -0,5
entity: (Compound)
CanUpdate: 1
Contraption: (Compound)
Type: bearing
Anchor: (Compound)
Y: 0
Z: 0
X: 0
Blocks: (Compound)
BlockList: List with 1 items
Palette: List with 1 items
SubContraptions: List with 0 items
CapturedMultiblocks: List with 0 items
DisabledActors: List with 0 items
Actors: List with 0 items
Superglue: List with 0 items
Stalled: 0
BoundsFront: List with 6 items
BottomlessSupply: 0
Interactors: List with 0 items
Facing: 1
Passengers: List with 0 items
Seats: List with 0 items
Sails: 0
OnGround: 0
Angle: 52,797543
Stalled: 0
Air: 300
ControllerRelative: (Compound)
Y: -1
Z: 0
X: 0
UUID: System.Int32[]
Invulnerable: 0
id: create:stationary_contraption
FallDistance: 0
ForgeCaps: (Compound)
Motion: List with 3 items
Rotation: List with 2 items
Axis: Y
Pos: List with 3 items
Fire: -1
PortalCooldown: 0
Initialized: 1
posx: -0,5
posy: 0,5
posz: -0,5
How do i get it without making thousands of loops and ifs?
2 Replies
Jimmacle
Jimmacle5d ago
can't tell you with the amount of information given what kind of data structure is this in?
Slait
SlaitOP5d ago
nbt? i think i need to make some recursive function to parse it and there is no easy way to just directly get value :(

Did you find this page helpful?