isMovable: 1b, Items:[], CookingTimes: [I; 0, 0, 0, 0], CookingTotalTimes: [I; 0, 0, 0, 0], ItemTime1: 0, ItemTime2: 0, ItemTime3: 0, ItemTime4: 0 } }""" } _J114 = NBTRemapHelper([ (("Items", "list", []), ("Items", "list", [("utags", "compound")])), (("CookingTimes", "int_array", []), ("CookingTimes", "int_array", [("utags", "compound")])), (("CookingTotalTimes", "int_array", []), ("CookingTotalTimes", "int_array", [("utags", "compound")])) ], "{Items:[], CookingTimes: [I; 0, 0, 0, 0], CookingTotalTimes: [I; 0, 0, 0, 0]}" ) _B111 = NBTRemapHelper( [(("ItemTime1", "int", []), ("ItemTime1", "int", [("utags", "compound")])), (("ItemTime2", "int", []), ("ItemTime2", "int", [("utags", "compound")])), (("ItemTime3", "int", []), ("ItemTime3", "int", [("utags", "compound")])), (("ItemTime4", "int", []), ("ItemTime4", "int", [("utags", "compound")])), (("Item1", "compound", []), ("Item1", "compound", [("utags", "compound")])), (("Item2", "compound", []), ("Item2", "compound", [("utags", "compound")])), (("Item3", "compound", []), ("Item3", "compound", [("utags", "compound")])),
"nbt_identifier": ["universal_minecraft", "beacon"], "snbt": """{ utags: { isMovable: 1b, Secondary: 0, Primary: 0, Levels: -1, Lock: \"\" } }""" } _J112 = NBTRemapHelper( [(("Primary", "int", []), ("Primary", "int", [("utags", "compound")])), (("Secondary", "int", []), ("Secondary", "int", [("utags", "compound")])), (("Levels", "int", []), ("Levels", "int", [("utags", "compound")]))], "{Secondary: 0, Primary: 0, Levels: -1}") _B113 = NBTRemapHelper([(("Primary", "int", []), ("Primary", "int", [("utags", "compound")])), (("Secondary", "int", []), ("Secondary", "int", [("utags", "compound")]))], "{primary: 0, secondary: 0}") j112 = merge([EmptyNBT('minecraft:beacon'), _J112, java_str_lock], ['universal_minecraft:beacon'], abstract=True) j113 = merge( [EmptyNBT('minecraft:beacon'), _J112, java_str_lock, java_keep_packed],
from PyMCTCompiler.primitives.scripts.nbt import NBTRemapHelper java_custom_name = NBTRemapHelper( [(("CustomName", "string", []), ("CustomName", "string", [("utags", "compound")]))], ) java_str_lock = NBTRemapHelper([(("Lock", "string", []), ("Lock", "string", [("utags", "compound")]))], "{Lock: \"\"}") java_keep_packed = NBTRemapHelper([(("keepPacked", "byte", []), ("keepPacked", "byte", [("utags", "compound")]))]) java_loot_table = NBTRemapHelper([ (("LootTable", "string", []), ("LootTable", "string", [("utags", "compound")])), (("LootTableSeed", "long", []), ("LootTableSeed", "long", [("utags", "compound")])) ]) java_item_1 = NBTRemapHelper([(("Item", "compound", []), ("Item", "compound", [("utags", "compound")]))], "{}") java_items_3 = NBTRemapHelper([(("Items", "list", []), ("Items", "list", [("utags", "compound")]))], "{Items: []}") java_items_5 = NBTRemapHelper([(("Items", "list", []), ("Items", "list", [("utags", "compound")]))],
_J113 = NBTRemapHelper( [ ( ("metadata", "string", []), ("metadata", "string", [("utags", "compound")]) ), ( ("mirror", "string", []), ("mirror", "string", [("utags", "compound")]) ), ( ("ignoreEntities", "byte", []), ("ignoreEntities", "byte", [("utags", "compound")]) ), ( ("powered", "byte", []), ("powered", "byte", [("utags", "compound")]) ), ( ("seed", "long", []), ("seed", "long", [("utags", "compound")]) ), ( ("author", "string", []), ("author", "string", [("utags", "compound")]) ), ( ("rotation", "string", []), ("rotation", "string", [("utags", "compound")]) ), ( ("posX", "int", []), ("posX", "int", [("utags", "compound")]) ), ( ("posY", "int", []), ("posY", "int", [("utags", "compound")]) ), ( ("posZ", "int", []), ("posZ", "int", [("utags", "compound")]) ), ( ("sizeX", "int", []), ("sizeX", "int", [("utags", "compound")]) ), ( ("sizeY", "int", []), ("sizeY", "int", [("utags", "compound")]) ), ( ("sizeZ", "int", []), ("sizeZ", "int", [("utags", "compound")]) ), ( ("mode", "string", []), ("mode", "string", [("utags", "compound")]) ), ( ("integrity", "float", []), ("integrity", "float", [("utags", "compound")]) ), ( ("showair", "byte", []), ("showair", "byte", [("utags", "compound")]) ), ( ("name", "string", []), ("name", "string", [("utags", "compound")]) ), ( ("showboundingbox", "byte", []), ("showboundingbox", "byte", [("utags", "compound")]) ) ], '{metadata: "", mirror: "NONE", ignoreEntities: 1b, powered: 0b, seed: 0l, author: "", rotation: "NONE", posX: 0, mode: "DATA", posY: 1, sizeX: 0, posZ: 0, integrity: 1.0f, showair: 0b, name: "", sizeY: 0, sizeZ: 0, showboundingbox: 1b}' )
} }""" } _J19 = NBTRemapHelper( [ ( ("auto", "byte", []), # does not need power ("auto", "byte", [("utags", "compound")])), (("Command", "string", []), ("Command", "string", [("utags", "compound")])), (("conditionMet", "byte", []), ("conditionMet", "byte", [("utags", "compound")])), (("CustomName", "string", []), (None, None, None)), (("LastOutput", "string", []), ("LastOutput", "string", [("utags", "compound")])), (("LastExecution", "long", []), ("LastExecution", "long", [("utags", "compound")])), (("powered", "byte", []), ("powered", "byte", [("utags", "compound")])), (("SuccessCount", "int", []), ("SuccessCount", "int", [("utags", "compound")])), (("TrackOutput", "byte", []), ("TrackOutput", "byte", [("utags", "compound")])) ], '{conditionMet: 0b, auto: 0b, powered: 0b, Command: "", SuccessCount: 0, TrackOutput: 1b}' ) _J19_command_stats = NBTRemapHelper( [(("CommandStats", "compound", []), ("CommandStats", "compound", [("utags", "compound")]))], '{}')
bedrockExtraBlockState: {name: "minecraft:air", states: {}, version: 17629184}, facing: 4, progress: 0.5f, source: 0b, extending: 1b, pistonPosdX: 0, pistonPosdY: 0, pistonPosdZ: 0 } }""" } _JBase = NBTRemapHelper( [(("facing", "int", []), ("facing", "int", [("utags", "compound")])), (("progress", "float", []), ("progress", "float", [("utags", "compound")])), (("source", "byte", []), ("source", "byte", [("utags", "compound")])), (("extending", "byte", []), ("extending", "byte", [("utags", "compound")]))], '{facing: 4, progress: 0.5f, source: 0b, extending: 1b}') _J19 = NBTRemapHelper( [(("blockId", "int", []), ("blockId", "int", [("utags", "compound"), ("javaNumericalBlockState", "compound")])), (("blockData", "int", []), ("blockData", "int", [("utags", "compound"), ("javaNumericalBlockState", "compound")]))], '{blockId: 1, blockData: 0}') _J113 = NBTRemapHelper( [(("blockState", "compound", []),
B113 "EnchantTable" "{isMovable: 1b, rott: -2.351901054382324f}" """ universal = { "nbt_identifier": ["universal_minecraft", "enchanting_table"], "snbt": """{ utags: { isMovable: 1b, rott: 0.0f } }""" } _B17 = NBTRemapHelper([(("rott", "float", []), ("rott", "float", [("utags", "compound")]))], "{rott: 0.0f}") j112 = merge([EmptyNBT('minecraft:enchanting_table'), java_custom_name], ['universal_minecraft:enchanting_table'], abstract=True) j113 = merge([ EmptyNBT('minecraft:enchanting_table'), java_custom_name, java_keep_packed ], ['universal_minecraft:enchanting_table']) b17 = merge([EmptyNBT(':EnchantTable'), _B17, bedrock_is_movable], ['universal_minecraft:enchanting_table'], abstract=True) b113 = merge([EmptyNBT(':EnchantTable'), _B17, bedrock_is_movable],
universal = { "nbt_identifier": ["universal_minecraft", "comparator"], "snbt": """{ utags: { isMovable: 1b, OutputSignal: 0 } }""" } _ComparatorBase = NBTRemapHelper( [ ( ("OutputSignal", "int", []), ("OutputSignal", "int", [("utags", "compound")]) ) ], "{OutputSignal: 0}" ) j112 = merge( [EmptyNBT('minecraft:comparator'), _ComparatorBase], ['universal_minecraft:comparator'], abstract=True ) j113 = merge( [EmptyNBT('minecraft:comparator'), _ComparatorBase, java_keep_packed], ['universal_minecraft:comparator'] )
_JBShared = NBTRemapHelper( [ ( ("MaxNearbyEntities", "short", []), ("MaxNearbyEntities", "short", [("utags", "compound")]) ), ( ("RequiredPlayerRange", "short", []), ("RequiredPlayerRange", "short", [("utags", "compound")]) ), ( ("SpawnCount", "short", []), ("SpawnCount", "short", [("utags", "compound")]) ), ( ("MaxSpawnDelay", "short", []), ("MaxSpawnDelay", "short", [("utags", "compound")]) ), ( ("Delay", "short", []), ("Delay", "short", [("utags", "compound")]) ), ( ("SpawnRange", "short", []), ("SpawnRange", "short", [("utags", "compound")]) ), ( ("MinSpawnDelay", "short", []), ("MinSpawnDelay", "short", [("utags", "compound")]) ) ], '{MaxNearbyEntities: 6s, RequiredPlayerRange: 16s, SpawnCount: 4s, MaxSpawnDelay: 800s, Delay: 20s, SpawnRange: 4s, MinSpawnDelay: 200s}' )
_B17 = NBTRemapHelper( [ ( ("AttachedBlocks", "list", []), ("AttachedBlocks", "list", [("utags", "compound")]) ), ( ("BreakBlocks", "list", []), ("BreakBlocks", "list", [("utags", "compound")]) ), ( ("LastProgress", "float", []), ("LastProgress", "float", [("utags", "compound")]) ), ( ("NewState", "byte", []), ("NewState", "byte", [("utags", "compound")]) ), ( ("Progress", "float", []), ("Progress", "float", [("utags", "compound")]) ), ( ("State", "byte", []), ("State", "byte", [("utags", "compound")]) ), ( ("Sticky", "byte", []), (None, None, None) ) ], "{AttachedBlocks: [], BreakBlocks: [], LastProgress: 0.0f, NewState: 0b, Progress: 0.0f, State: 0b}" )
from PyMCTCompiler.primitives.scripts.nbt import NBTRemapHelper, EmptyNBT, merge, TranslationFile from .common import bedrock_is_movable, java_keep_packed """ Default J113 "minecraft:sign" '{Text4: "{\\"text\\":\\"\\"}", Text3: "{\\"text\\":\\"\\"}", Text2: "{\\"text\\":\\"\\"}", Text1: "{\\"text\\":\\"\\"}"}' B113 "Sign" "{Text: "", TextOwner: "", isMovable: 1b}" """ universal = {"nbt_identifier": ["universal_minecraft", "sign"], "snbt": "{}"} _J19 = NBTRemapHelper([ (("Text1", "string", []), ("Text1", "string", [("utags", "compound")])), (("Text2", "string", []), ("Text2", "string", [("utags", "compound")])), (("Text3", "string", []), ("Text3", "string", [("utags", "compound")])), (("Text4", "string", []), ("Text4", "string", [("utags", "compound")])) ], '{Text4: "{\\"text\\":\\"\\"}", Text3: "{\\"text\\":\\"\\"}", Text2: "{\\"text\\":\\"\\"}", Text1: "{\\"text\\":\\"\\"}"}' ) _B17 = NBTRemapHelper([(("TextOwner", "string", []), ("TextOwner", "string", [("utags", "compound")])), (("Text", "string", []), (None, None, None))], '{TextOwner: ""}') _BText = TranslationFile([{ "function": "code", "options": { "input": ["nbt"], "output": ["new_nbt"], "function": "bedrock_sign_2u" }
B113 "Skull" "{MouthMoving: 0b, MouthTickCount: 0, Rotation: -90.0f, SkullType: 0b, isMovable: 1b}" """ universal = { "nbt_identifier": ["universal_minecraft", "head"], "snbt": """{ utags: { isMovable: 1b, MouthMoving: 0b, MouthTickCount: 0 } }""" } _J19 = NBTRemapHelper([(("Owner", "compound", []), ("Owner", "compound", [("utags", "compound")]))], "{}") _B17 = NBTRemapHelper( [(("MouthMoving", "byte", []), ("MouthMoving", "byte", [("utags", "compound")])), (("MouthTickCount", "int", []), ("MouthTickCount", "int", [("utags", "compound")])), (("Rotation", "float", []), (None, None, None))], "{MouthMoving: 0b, MouthTickCount: 0, Rotation: 0.0f, SkullType: 0b}") skull_types = [ "\"skeleton\"", "\"wither_skeleton\"", "\"zombie\"", "\"player\"", "\"creeper\"", "\"dragon\"" ] bedrock_wall_directions = ["\"north\"", "\"south\"", "\"west\"", "\"east\""]
Fuel: 0b, Items: [], BrewTime: 0s, Lock: \"\", FuelTotal: 0s } }""" } _J112 = NBTRemapHelper( [ ( ("Fuel", "byte", []), ("Fuel", "short", [("utags", "compound")]) ), ( ("BrewTime", "short", []), ("BrewTime", "short", [("utags", "compound")]) ) ], "{Fuel: 0b, BrewTime: 0s}" ) _B113 = NBTRemapHelper( [ ( ("FuelAmount", "byte", []), # How much fuel is left ("Fuel", "short", [("utags", "compound")]) ), ( ("CookTime", "short", []), # Time until finished cooking
ExitPortal: { X: 0, Y: 0, Z: 0 } } }""" } _J19 = NBTRemapHelper([(("Age", "long", []), ("Age", "long", [("utags", "compound")])), (("ExactTeleport", "byte", []), ("ExactTeleport", "byte", [("utags", "compound")])), (("X", "int", [("ExitPortal", "compound")]), ("X", "int", [("utags", "compound"), ("ExitPortal", "compound")])), (("Y", "int", [("ExitPortal", "compound")]), ("Y", "int", [("utags", "compound"), ("ExitPortal", "compound")])), (("Z", "int", [("ExitPortal", "compound")]), ("Z", "int", [("utags", "compound"), ("ExitPortal", "compound")]))], "{Age: 0l}") _B17 = NBTRemapHelper([(("Age", "long", []), ("Age", "long", [("utags", "compound")])), ((0, "int", [("ExitPortal", "list")]), ("X", "int", [("utags", "compound"), ("ExitPortal", "compound")])), ((1, "int", [("ExitPortal", "list")]), ("Y", "int", [("utags", "compound"), ("ExitPortal", "compound")])),
universal = { "nbt_identifier": ["universal_minecraft", "hopper"], "snbt": """{ utags: { isMovable: 1b, Items: [], TransferCooldown: -1 } }""" } _TransferCooldown = NBTRemapHelper( [ ( ("TransferCooldown", "int", []), ("TransferCooldown", "int", [("utags", "compound")]) ) ], "{TransferCooldown: -1}" ) j19 = merge( [EmptyNBT('minecraft:hopper'), _TransferCooldown, java_custom_name, java_str_lock, java_items_5, java_loot_table], ['universal_minecraft:hopper'], abstract=True ) j113 = merge( [EmptyNBT('minecraft:hopper'), _TransferCooldown, java_custom_name, java_str_lock, java_items_5, java_loot_table, java_keep_packed], ['universal_minecraft:hopper'] )
universal = { "nbt_identifier": ["universal_minecraft", "cauldron"], "snbt": """{ utags: { isMovable: 1b, Items: [], PotionId: -1s, PotionType: 0b } }""" } _B110 = NBTRemapHelper( [ (("Items", "list", []), ("Items", "list", [("utags", "compound")])), (("PotionId", "short", []), ("PotionId", "short", [("utags", "compound")])), ( ("PotionType", "byte", []), # this might be wrong for old versions ("PotionType", "byte", [("utags", "compound")])) ], "{Items:[], PotionId: -1s, PotionType: 0b}") b110 = merge([EmptyNBT(':Cauldron'), _B110, bedrock_is_movable], ['universal_minecraft:cauldron'], abstract=True) b113 = merge([EmptyNBT(':Cauldron'), _B110, bedrock_is_movable], ['universal_minecraft:cauldron'])
Full J112 "{RecordItem: {Count: 0b, Damage: 0s, id: \":\", tag: {}}}" J113 "{RecordItem: {Count: 0b, id: \":\", tag: {}}}" """ universal = { "nbt_identifier": ["universal_minecraft", "jukebox"], "snbt": """{ utags: { isMovable: 1b } }""" } _J19 = NBTRemapHelper([(("RecordItem", "compound", []), ("RecordItem", "compound", [("utags", "compound")]))]) _B17 = NBTRemapHelper([(("RecordItem", "compound", []), ("RecordItem", "compound", [("utags", "compound")]))]) j19 = merge([EmptyNBT('minecraft:jukebox'), _J19], ['universal_minecraft:jukebox'], abstract=True) j113 = merge([EmptyNBT('minecraft:jukebox'), _J19, java_keep_packed], ['universal_minecraft:jukebox']) b17 = merge([EmptyNBT(':Jukebox'), _B17, bedrock_is_movable], ['universal_minecraft:jukebox'], abstract=True)
J113 "minecraft:conduit" "{}" B113 "Conduit" "{Active: 0b, Target: -1L, isMovable: 1b}" There are UUID values in both but I am skipping these """ universal = { "nbt_identifier": ["universal_minecraft", "conduit"], "snbt": """{ utags: { isMovable: 1b } }""" } _J113 = NBTRemapHelper([(("target_uuid", "compound", []), (None, None, None))], "{}") _B113 = NBTRemapHelper([(("Target", "long", []), (None, None, None)), (("Active", "byte", []), ("Active", "byte", [("utags", "compound")]))], "{Active: 0b}") j113 = merge([EmptyNBT('minecraft:conduit'), _J113, java_keep_packed], ['universal_minecraft:conduit']) b17 = merge([EmptyNBT(':Conduit'), _B113, bedrock_is_movable], ['universal_minecraft:conduit'], abstract=True) b113 = merge([EmptyNBT(':Conduit'), _B113, bedrock_is_movable], ['universal_minecraft:conduit'])
isMovable: 1b, Direction: 0b, Ringing: 0b, Ticks: 0b } }""" } """ Bedrock 1.14 {Direction: 0, Ringing: 0b, Ticks: 0, isMovable: 1b} Java 1.14 {} """ _B111 = NBTRemapHelper( [(("Direction", "int", []), ("Direction", "int", [("utags", "compound")])), (("Ringing", "byte", []), ("Ringing", "byte", [("utags", "compound")])), (("Ticks", "int", []), ("Ticks", "int", [("utags", "compound")]))], "{Direction: 0, Ringing: 0b, Ticks: 0}") j114 = merge([EmptyNBT('minecraft:bell'), java_keep_packed], ['universal_minecraft:bell']) b111 = merge([EmptyNBT(':Bell'), _B111, bedrock_is_movable], ['universal_minecraft:bell'], abstract=True) b113 = merge([EmptyNBT(':Bell'), _B111, bedrock_is_movable], ['universal_minecraft:bell'])
""" universal = { "nbt_identifier": ["universal_minecraft", "item_frame"], "snbt": """{ utags: { isMovable: 1b } }""" } _B17 = NBTRemapHelper( [ (("ItemDropChance", "float", []), ("ItemDropChance", "float", [("utags", "compound")])), ( # TODO: convert this to an int 0-15 value ("ItemRotation", "byte", []), ("ItemRotation", "float", [("utags", "compound")])) ], "{}") _B113 = NBTRemapHelper( [ (("ItemDropChance", "float", []), ("ItemDropChance", "float", [("utags", "compound")])), ( # TODO: convert this to an int 0-15 value ("ItemRotation", "float", []), ("ItemRotation", "float", [("utags", "compound")])) ], "{}")
universal = { "nbt_identifier": ["universal_minecraft", "banner"], "snbt": """{ utags: { isMovable: 1b, Base: 0, Type: 0 } }""" } # TODO: convert Base into the color property and back _J112 = NBTRemapHelper([ (("Patterns", "list", []), ("Patterns", "list", [("utags", "compound")])), (("Base", "int", []), ("Base", "int", [("utags", "compound")])) ]) _Base2Color = TranslationFile([{ "function": "walk_input_nbt", "options": { "type": "compound", "keys": { "Base": { "type": "int", "functions": [{ "function": "map_nbt", "options": { "cases": { str(index): [{