Back To Top | |
Introduction | |
Usage | |
Classes and Parameters | |
Class References | |
Parameter Lists | |
Opcodes | |
Obfuscation | |
Shortcuts | |
Programs | |
Examples |
/bytecodeexec [opcode] <arguments>
for standard instructions and /bytecodeexec [action] <arguments>
for special actions.
net.minecraft.world.biome.BiomeGenBase
or Reika.ChromatiCraft.TileEntity.AOE.Effect.TileEntityAccelerator
. The second form, generally more convenient - and in some cases required due to command character limit counts - is as a shorthand form, referenced as simply the class's simple name preceded with '#', eg #BiomeGenBase
and #TileEntityAccelerator
for the two examples above. Note that aside from some common presets, classes' shortcuts must be defined explicitly, using the define
special action (details below).
Full Class Name | Shortcut |
---|---|
java.lang.String | String |
java.lang.Object | Object |
java.lang.Enum | Enum |
java.util.ArrayList | ArrayList |
java.util.HashMap | HashMap |
java.lang. Class | Class |
java.lang.reflect.Field | Field |
java.lang.reflect.Method | Method |
java.lang.reflect.Array | Array |
java.util.Arrays | Arrays |
java.lang.Math | Math |
net.minecraft.world.World | World |
net.minecraft.entity.Entity | Entity |
net.minecraft.entity.EntityLivingBase | EntityLivingBase |
net.minecraft.entity.player.EntityPlayer | EntityPlayer |
net.minecraft.entity.player.EntityPlayerMP | EntityPlayerMP |
net.minecraft.tileentity.TileEntity | TileEntity |
net.minecraft.block.Block | Block |
net.minecraft.item.Item | Item |
net.minecraft.init.Blocks | Blocks |
net.minecraft.init.Items | Items |
net.minecraft.item.ItemStack | ItemStack |
net.minecraft.world.biome.BiomeGenBase | Biome |
net.minecraft.world.biome.BiomeGenBase | BiomeGenBase |
net.minecraft.server.MinecraftServer | Server |
net.minecraft.server.MinecraftServer | MinecraftServer |
net.minecraft.world.gen.ChunkProviderServer | ChunkProviderServer |
net.minecraft.world.gen.ChunkProviderGenerate | ChunkProviderGenerate |
net.minecraftforge.common.DimensionManager | DimensionManager |
cpw.mods.fml.common.FMLCommonHandler | FML |
net.minecraftforge.common.MinecraftForge | Forge |
net.minecraftforge.common.util.ForgeDirection | ForgeDirection |
cpw.mods.fml.common.Loader | Loader |
net.minecraftforge.fluids.Fluid | Fluid |
net.minecraftforge.fluids.FluidStack | FluidStack |
net.minecraftforge.fluids.FluidRegistry | FluidRegistry |
cpw.mods.fml.common.registry.GameRegistry | GameRegistry |
net.minecraftforge.oredict.OreDictionary | OreDictionary |
Reika.DragonAPI.Libraries.Java.ReikaASMHelper | ASMHelper |
Reika.DragonAPI.Libraries.Java.ReikaReflectionHelper | ReflectionHelper |
Reika.DragonAPI.Libraries.Java.ReikaJavaLibrary | JavaLibrary |
Reika.DragonAPI.Libraries.Java.ReikaStringParser | StringParser |
Reika.DragonAPI.Libraries.Java.ReikaArrayHelper | ArrayHelper |
Reika.DragonAPI.Libraries.MathSci.ReikaMathLibrary | MathLibrary |
Reika.DragonAPI.Libraries.MathSci.ReikaPhysicsHelper | PhysicsHelper |
Reika.DragonAPI.Libraries.World.ReikaWorldHelper | WorldHelper |
Reika.DragonAPI.Libraries.World.ReikaBiomeHelper | BiomeHelper |
Reika.DragonAPI.Libraries.World.ReikaBlockHelper | BlockHelper |
Reika.DragonAPI.Libraries.Registry.ReikaItemHelper | ItemHelper |
Reika.DragonAPI.Libraries.ReikaInventoryHelper | InventoryHelper |
Reika.DragonAPI.Libraries.ReikaPlayerAPI | PlayerAPI |
Reika.DragonAPI.Libraries.Registry.ReikaPlantHelper | PlantHelper |
Reika.DragonAPI.Libraries.Registry.ReikaCropHelper | CropHelper |
Reika.DragonAPI.Libraries.Registry.ReikaOreHelper | OreHelper |
Reika.DragonAPI.Libraries.Registry.ReikaTreeHelper | TreeHelper |
Reika.DragonAPI.ModList | ModList |
Reika.DragonAPI.ModRegistry.ModOreList | ModOreList |
Reika.DragonAPI.ModRegistry.ModWoodList | ModWoodList |
Reika.DragonAPI.ModRegistry.ModCropList | ModCropList |
A;B;C;D...
where A, B, C, D, etc are the argument types, such as int
, double
, or an object type (full name or shortcut, eg #String
). For no-arg methods, simply provide a single ';', eg invokestatic #SomeClass doThing ;
to call fully.qualified.namespace.SomeClass.doThing()
.
Opcode | Description | Arguments | Consumes N Objects From Stack | Adds N Objects To Stack | Notes |
---|---|---|---|---|---|
LDC | Load literal onto stack | 1 string | 1 | The argument will be parsed to null, an integer, then a float (for decimals use the F suffix), then a double, then a string in that order of attempts | |
NEW | Instantiate object | Class Reference, Parameter List String | Any | 1 | Consumes as many objects from the stack as the constructor is stated to require |
DUP | Duplicate top of stack | 1 | |||
POP | Remove top of stack | 1 | |||
SWAP | Swap stack top | Swaps the position of the top two objects on the stack. | |||
INVOKESTATIC | Call static method | Class Reference, Name, Parameter List String | Any | 0 or 1 | Consumes as many objects from the stack as the method has parameters. Will put a return value back on the stack for non-void methods. |
INVOKEVIRTUAL | Call instance method | Class Reference, Name, Parameter List String | Any | 0 or 1 | Consumes as many objects from the stack as the method has parameters, plus one for the object instance. Object instance must be below the parameters on the stack. Will put a return value back on the stack for non-void methods. |
OBJMETHOD | Call instance method from object | Name | Any | 0 or 1 | Finds the named method in the class defining the object on the top of the stack and invokes it. Consumes as many objects from the stack as the method has parameters, plus one for the object instance. Object instance must be the top of the stack. Will put a return value back on the stack for non-void methods. |
GETSTATIC | Fetch static field | Class Reference, Name | 1 | ||
GETFIELD | Fetch instance field | Class Reference, Name | 1 | 1 | Consumes the object instance from the stack |
OBJFIELD | Fetch field value from object | Name | 1 | 1 | Consumes the object on the top of the stack, and returns that object's value of the specified field to the stack. |
SETFIELD | Set field value | Class Reference, Name | 2 | Sets the named field in the specified class, with the top of the stack being the new field value and the value below it being the object instance (use null for static fields) | |
INSTANCEOF | Check instanceof | 2 | 1 | Checks if the object represented by the top of the stack is of the class object below it in the stack. Returns boolean. | |
MAKEARRAY | Construct object array | Array Length | Any | 1 | Constructs a new Object[] whose members consist of the top N objects from the stack, removing all of them in the process. |
GETARRAY | Get array index | 2 | 1 | Fetches the object at the Nth index of the array at the top of the stack, where N is the integer below it on the stack. | |
SETARRAY | Set array index | 3 | Fetches the array at the top of the stack, and sets its Nth index to X, where N is the integer below the array and X is the object below that. | ||
CONCAT | Concatenate strings | 2 | 1 | Pops the two objects off the top of the stack, concatenates their string values (lower-upper order), and returns to the stack. | |
ITERATE | Iterate collection or array | Unimplemented | |||
OUTPUT | View stack contents | ||||
WRITE | Write stack to file | File path | |||
FLUSH | Clear stack | All |
&invokevirtual name args
will not remove the instance object from the stack, allowing for multiple successive &invokevirtual
calls without reloading it onto the stack (though any parameters will still need to be).
func_147439_a
instead of getBlock
. This means that for vanilla classes, you will need a copy of the mappings to know the names of the members you wish to reference, such as can be found in the standard mcp-srg.srg
file.
Class | Deobfuscated Name | Obfuscated Name |
---|---|---|
World | getBlock | func_147439_a |
World | getBlockMetadata | func_72805_g |
World | getTileEntity | func_147438_o |
World | getPlayerEntityByName | func_72924_a |
World | getPlayerEntityByUUID | func_152378_a |
World | provider | field_73011_w |
EntityLivingBase | getHealth | func_110143_aJ |
EntityPlayer | getCurrentEquippedItem | func_71045_bC |
ItemStack | getItem | func_77973_b |
ItemStack | getItemDamage | func_77960_j |
ItemStack | stackSize | field_77994_a |
TileEntity | worldObj | field_145850_b |
TileEntity | xCoord | field_145851_c |
TileEntity | yCoord | field_145848_d |
TileEntity | zCoord | field_145849_e |
Entity | worldObj | field_70170_p |
Entity | posX | field_70165_t |
Entity | posY | field_70163_u |
Entity | posZ | field_70161_v |
BiomeGenBase | biomeID | field_76756_M |
BiomeGenBase | theBiomeDecorator | field_76760_I |
loadsrg
special action with a filepath argument to load the mcp-srg.srg file from disk, but be aware that like all commands, this runs on the serverside, and so if you are running the command on a non-local server referencing a file on your own PC is not going to work.
Command String | Arguments | Description |
---|---|---|
define | Fully qualified class name | Define a class reference shortcut. Can use *stack* to fetch the class defining the object on the top of the stack (popping it off the stack in the process) instead |
mapsrg | Class Reference, Obf Name, Deobf Name | Map one srg name |
loadsrg | File path | Load Forge MCP-SRG file |
shortcuts | See class shortcuts | |
self | Load self (EntityPlayer object) onto the stack | |
getplayer | Name | Load logged-in player (EntityPlayer object) onto the stack |
held | Load held item (ItemStack object) onto the stack | |
look | Load looked-at position onto the stack (World and three ints), ready for an invocation of a world function like getBlock or getTileEntity | |
getclass | Qualified Class Name | Load Class object onto the stack |
startprogram | Name, [Properties...] | Start 'recording' a bytecodeexec 'program' |
saveprogram | Finish 'recording' a bytecodeexec 'program' and save to disk | |
runprogram | Program Name | Run a bytecodeexec 'program' |
admin
and public
properties respectively). To create a program, start recording, then run the opcode commands as normal. Note that special shortcuts like self
or look
will not function.
/meteor
command in that mod.
BiomeDecorator.treesPerChunk
) of the Ice Plains biome type to match that of the vanilla Forest biome (whatever it might be, even if mods changed it, instead of a hardcoded value). Obviously, this would only apply to newly generated chunks, and would reset once the server is rebooted.