Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[Solved] How do I copy TileEntity NBT information from one TileEntity to another?


Recommended Posts

Hey all, I was wondering how I would copy the contents of a TileEntity to another, such as copying a chest's contents, or a furnace's items and cook time, etc., to another chest/furnace that already exists in the world. Any help is appreciated.

Cheers.

Edited by CommandCore
Solved
Link to post
Share on other sites
2 hours ago, diesieben07 said:

TileEntity#save on the source tile entity to get the data. Remove x, y and z from the resulting component, then call TileEntity#load on the target tile entity.

Worked like a charm, thanks

Link to post
Share on other sites
  • CommandCore changed the title to [Solved] How do I copy TileEntity NBT information from one TileEntity to another?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • oh thats not all it didnt copied all is that enough to know the problem
    • 21:49:22.953 STDERR main [org.spongepowered.asm.mixin.transformer.MixinTransformer:transformClassBytes:519]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28) 21:49:22.953 LaunchWrapper main Unable to launch java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.NoClassDefFoundError: net/minecraft/world/World at net.minecraft.client.main.Main.main(SourceFile:38) ... 6 more Caused by: java.lang.ClassNotFoundException: net.minecraft.world.World at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 7 more Caused by: org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:521) at org.spongepowered.asm.mixin.transformer.Proxy.transform(Proxy.java:72) at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ... 9 more Caused by: java.lang.AbstractMethodError at org.spongepowered.asm.mixin.transformer.MixinInfo.preApply(MixinInfo.java:1212) at org.spongepowered.asm.mixin.transformer.MixinTargetContext.preApply(MixinTargetContext.java:1126) at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:274) at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:353) at org.spongepowered.asm.mixin.transformer.MixinTransformer.apply(MixinTransformer.java:724) at org.spongepowered.asm.mixin.transformer.MixinTransformer.applyMixins(MixinTransformer.java:703) at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:509) ... 12 more 21:49:22.966 STDERR main [java.lang.ThreadGroup:uncaughtException:1052]: net.minecraftforge.fml.relauncher.FMLSecurityManager$ExitTrappedException 21:49:22.966 STDERR main [java.lang.ThreadGroup:uncaughtException:1052]: at net.minecraftforge.fml.relauncher.FMLSecurityManager.checkPermission(FMLSecurityManager.java:49) 21:49:22.967 STDERR main [java.lang.ThreadGroup:uncaughtException:1052]: at java.lang.SecurityManager.checkExit(SecurityManager.java:761) 21:49:22.967 STDERR main [java.lang.ThreadGroup:uncaughtException:1052]: at java.lang.Runtime.exit(Runtime.java:107) 21:49:22.967 STDERR main [java.lang.ThreadGroup:uncaughtException:1052]: at java.lang.System.exit(System.java:971) 21:49:22.967 STDERR main [java.lang.ThreadGroup:uncaughtException:1052]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:138) 21:49:22.967 STDERR main [java.lang.ThreadGroup:uncaughtException:1052]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28) 21:49:23.085 launcher main Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=256m; support was removed in 8.0 21:49:23.085 monitor Process Monitor Process crashed with exit code 1   Thats the log after the launch
    • It is a tile entity block, the list will max out at 9 slots, so there will be 9 block models (a bit like a composter)
    • When i start minecraft with my forge modpack it loads and ends instantly with the error code 0 in the logs there is the error code 0 so what can i do to fix it.
    • I'm writing a mod for weapons and I ran into the problem of projectile position when shooting. How can I spawn a projectile so that when viewed from the first person, it flies out of the weapon, and not from the center of the screen?
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.