Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

Linux NBT editing


  • Please log in to reply
8 replies to this topic

#1

misson20000
  • Minecraft: misson20000

Posted 06 November 2011 - 10:42 PM

I would like to edit my level.dat on linux, but I cannot find a program to do it. So I started experimenting. I'm running Ubuntu 10.04.
I renamed level.dat to level.gz. Then I extracted it. Now I have the unzipped file full of strings and binary code. So I run srtrings on it and I get:
Data
thundering
LastPlayed
Player
SleepTimer
Motion
OnGround
HurtTime
foodExhaustionLevel
foodTickTimer
XpLevel
Health
	Dimension
	Inventory
Damage
Count
Slot
Damage
Count
Slot
Damage
Count
Slot
Damage
Count
Slot
Damage
Count
Slot
Damage
Count
Slot
Damage
Count
Slot
Damage
Count
Slot
Damage
Count
Slot
Damage
Count
Slot	
Damage
Count
Slot
Damage
Count
Slot
Damage
Count
Slot
Damage
Count
Slot
Damage
Count
Slot
foodSaturationLevel@
AttackTime
Sleeping
Fire
	foodLevel
FallDistance=
XpTotal
Rotation
Score
	DeathTime
RandomSeedn
GameType
MapFeatures
version
Time
raining
thunderTime
SpawnX
SpawnY
SpawnZ
	LevelName
Trap Island
SizeOnDisk
rainTime
The file without me running strings on it looks like this:
Data
thundering
LastPlayed3u�
Player
SleepTimer	Motion?�m	
�1뿵,sg�?�m	
foodTickTimerXpLevelHealthiDimensionAir,		Inventory
id!DamageCountSlotidEDamageCountSlotid.DamageCountSlotidDamageCountSlotidDamageCountSlotidDamageCountSlotidKDamageCountSlotidLDamageCountSlotiddDamageCountSloidDamageCountSlot	idDamageCountSlot
idDamageCountSlot
						  id-DamageCountSlot
id2DamageCountSlot	  Pos@Rr����@P^��R��@(�DamageCountSlot
a��foodSaturationLevel@�
AttackTimeSleepingFire��	foodLevel
										  FallDistance=�XpTotal	 RotationË
 �B��Score	DeathTimeXp
RandomSeedn��]�>�GameType
							MapFeaturesversionJ�TimeTraining
																   thunderTime=�SpawnX)SpawnY@SpawnZ����  LevelName
										 Trap Island
I"m pretty sure that a lot of the characters won't show up. So, my ultimate goal here is to have a shell file and I can run it, and it will toggle the game mode. I know there are programs out there, but they won't run on my computer. I'm currently working on a program like that, but if someone's alreadyh made a simple on I can use, can you please tell me?

View PostSomebody named Pitzik4 said:

Hi

Register or log in to remove.

#2

TerrorBite

Posted 17 December 2011 - 08:33 AM

  • Run: sudo apt-get install mono-complete
  • Download NBTedit from here: http://www.minecraft...c/6661-nbtedit/
  • Run: mono NBTedit.exe
  • Browse to your level.dat file
  • Edit all the values in a neat tree format!

Can't exactly use a shell script on that unfortunately, but at least you get a nice GUI.

#3

TheEyes
    TheEyes

    Gold Miner

  • Members
  • 354 posts

Posted 17 December 2011 - 09:47 AM

GUIs are for Windows users.

#4

TerrorBite

Posted 18 December 2011 - 02:35 AM

View PostTheEyes, on 17 December 2011 - 09:47 AM, said:

GUIs are for Windows users.

  • Run: sudo apt-get install mono-complete
  • Download NBTedit from here: http://www.minecraft...c/6661-nbtedit/
  • Write a command-line C# program that uses NBTedit's NamedBinaryTag.dll library, and compile with Mono
  • ????
  • Profit!


#5

misson20000
  • Minecraft: misson20000

Posted 26 December 2011 - 01:18 AM

Ok. GUI works for me. I never knew that I could get mono working like that. The only problem is it gives me this big error when I run NBTEdit. It says
**
ERROR:mini-trampolines.c:341:mono_magic_trampoline: assertion failed: (*vtable_slot)
Stacktrace:

  at System.Windows.Forms.ToolStripButton..cctor () <0xffffffff>
  at System.Windows.Forms.ToolStripButton..cctor () <0x00014>
  at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>
  at NBTedit.MainForm.InitializeComponent () <0xffffffff>
  at NBTedit.MainForm.InitializeComponent () <0x005b4>
  at NBTedit.MainForm..ctor () <0x0004b>
  at (wrapper remoting-invoke-with-check) NBTedit.MainForm..ctor () <0xffffffff>
  at NBTedit.Program.Main (string[]) <0x0010b>
  at (wrapper runtime-invoke) NBTedit.Program.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

	mono() [0x47b77f]
	/lib/libpthread.so.0(+0xf8f0) [0x7ff3ce78d8f0]
	/lib/libc.so.6(gsignal+0x35) [0x7ff3ce1aba75]
	/lib/libc.so.6(abort+0x180) [0x7ff3ce1af5c0]
	/lib/libglib-2.0.so.0(g_assertion_message+0x144) [0x7ff3cee0bbb4]
	/lib/libglib-2.0.so.0(+0x65130) [0x7ff3cee0c130]
	mono() [0x483c8a]
	[0x403d1168]

Debug info from gdb:

[Thread debugging using libthread_db enabled]
[New Thread 0x7ff3cd051700 (LWP 13148)]
[New Thread 0x7ff3cf490700 (LWP 13147)]
0x00007ff3ce78c93d in read () from /lib/libpthread.so.0
  3 Thread 0x7ff3cf490700 (LWP 13147)  0x00007ff3ce78d11d in nanosleep ()
   from /lib/libpthread.so.0
  2 Thread 0x7ff3cd051700 (LWP 13148)  0x00007ff3ce78bb50 in sem_wait ()
   from /lib/libpthread.so.0
* 1 Thread 0x7ff3cf487740 (LWP 13146)  0x00007ff3ce78c93d in read ()
   from /lib/libpthread.so.0

Thread 3 (Thread 0x7ff3cf490700 (LWP 13147)):
#0  0x00007ff3ce78d11d in nanosleep () from /lib/libpthread.so.0
#1  0x0000000000556342 in ?? ()
#2  0x00007ff3ce7849ca in start_thread () from /lib/libpthread.so.0
#3  0x00007ff3ce25e70d in clone () from /lib/libc.so.6
#4  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7ff3cd051700 (LWP 13148)):
#0  0x00007ff3ce78bb50 in sem_wait () from /lib/libpthread.so.0
#1  0x00000000004e4aaa in ?? ()
#2  0x0000000000505035 in ?? ()
#3  0x0000000000570073 in ?? ()
#4  0x000000000058de21 in ?? ()
#5  0x00007ff3ce7849ca in start_thread () from /lib/libpthread.so.0
#6  0x00007ff3ce25e70d in clone () from /lib/libc.so.6
#7  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7ff3cf487740 (LWP 13146)):
#0  0x00007ff3ce78c93d in read () from /lib/libpthread.so.0
#1  0x000000000047b8f4 in ?? ()
#2  <signal handler called>
#3  0x00007ff3ce1aba75 in raise () from /lib/libc.so.6
#4  0x00007ff3ce1af5c0 in abort () from /lib/libc.so.6
#5  0x00007ff3cee0bbb4 in g_assertion_message () from /lib/libglib-2.0.so.0
#6  0x00007ff3cee0c130 in g_assertion_message_expr ()
   from /lib/libglib-2.0.so.0
#7  0x0000000000483c8a in ?? ()
#8  0x00000000403d1168 in ?? ()
#9  0x00007ff3cf2fedb0 in ?? ()
#10 0x0000000001c76538 in ?? ()
#11 0x00007ff3cf2fedb8 in ?? ()
#12 0x0000000040e12680 in ?? ()
#13 0x0000000001c76538 in ?? ()
#14 0x000000000048267e in ?? ()
#15 0x000000000041b0df in ?? ()
#16 0x0000000006003a86 in ?? ()
#17 0x0000000000000006 in ?? ()
#18 0x000000000053fbbe in ?? ()
#19 0x0000000000541901 in mono_get_method_full ()
#20 0x00000000005447f9 in ?? ()
#21 0x0000000000000001 in ?? ()
#22 0x000000000213a850 in ?? ()
#23 0x00ff000000000000 in ?? ()
#24 0x0000ffffffffffff in ?? ()
#25 0x7500726f7463632e in ?? ()
#26 0x41e000004f000000 in ?? ()
#27 0x6f697463656c6c6f in ?? ()
#28 0x4026000000000000 in ?? ()
#29 0x0000000000000000 in ?? ()

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Aborted
. I have no idea how Windows programs or NBTEdit work. Do you know what's wrong?

View Postmisson20000, on 26 December 2011 - 01:16 AM, said:

Ok. GUI works for me. I never knew that I could get mono working like that. The only problem is it gives me this big error when I run NBTEdit. It says
**
ERROR:mini-trampolines.c:341:mono_magic_trampoline: assertion failed: (*vtable_slot)
Stacktrace:...
. I have no idea how Windows programs or NBTEdit work. Do you know what's wrong?
Odd. I tried it again and it worked for some reason

View PostSomebody named Pitzik4 said:

Hi

#6

squirtleboy
  • Location: jakarta(now)

Posted 26 December 2011 - 01:18 AM

ahyes,gui are for windows!right n otch?
notch: :D
Posted Image

#7

misson20000
  • Minecraft: misson20000

Posted 26 December 2011 - 01:54 AM

Now when I open my file, it gives me an error and says it has been dumped to error.log. I look in there and find:
System.IO.IOException: Invalid argument(s) ReadInternal
  at System.IO.Compression.DeflateStream.CheckResult (Int32 result, System.String where) [0x00000] 
  at System.IO.Compression.DeflateStream.ReadInternal (System.Byte[] array, Int32 offset, Int32 count) [0x00000] 
  at System.IO.Compression.DeflateStream.Read (System.Byte[] dest, Int32 dest_offset, Int32 count) [0x00000] 
  at System.IO.Compression.GZipStream.Read (System.Byte[] dest, Int32 dest_offset, Int32 count) [0x00000] 
  at NamedBinaryTag.StreamHelper.ReadString (System.IO.Stream stream) [0x00000] 
  at NamedBinaryTag.TagCompound.Load (System.String filename, System.String& name) [0x00000] 
  at NBTedit.NBTView.Load (System.String filename) [0x00000] 
System.IO.IOException: Invalid argument(s) ReadInternal
  at System.IO.Compression.DeflateStream.CheckResult (Int32 result, System.String where) [0x00000] 
  at System.IO.Compression.DeflateStream.ReadInternal (System.Byte[] array, Int32 offset, Int32 count) [0x00000] 
  at System.IO.Compression.DeflateStream.Read (System.Byte[] dest, Int32 dest_offset, Int32 count) [0x00000] 
  at System.IO.Compression.GZipStream.Read (System.Byte[] dest, Int32 dest_offset, Int32 count) [0x00000] 
  at NamedBinaryTag.StreamHelper.ReadString (System.IO.Stream stream) [0x00000] 
  at NamedBinaryTag.TagCompound.Load (System.String filename, System.String& name) [0x00000] 
  at NBTedit.NBTView.Load (System.String filename) [0x00000] 

View PostSomebody named Pitzik4 said:

Hi

#8

misson20000
  • Minecraft: misson20000

Posted 26 December 2011 - 03:27 AM

I found something that's working for me. I'm using nbt2yaml.

View PostSomebody named Pitzik4 said:

Hi

#9

jacobems
    jacobems

    Zombie Killer

  • Members
  • 153 posts
  • Minecraft: jacobems

Posted 18 January 2012 - 12:49 AM

anyone know what the DeathTime string does?
I support a coalition of action against #NSA surveillance. Join me – ask US Congress to stop the NSA's alleged actions: stopwatching.us