MobCode is a powerful programming language designed to compile into Minecraft function files. Write clean, modular code with namespaces, classes, functions, and macros.
Everything you need to create sophisticated Minecraft datapacks with modern programming concepts
Clean, intuitive syntax that compiles to efficient Minecraft function files
namespace example
{
class exampleclass
{
function testfunction
{
tellraw @a "hello, world!";
}
}
function classless
{
Item.Give(@a,minecraft:stick,10);
}
}
namespace example
{
function calculate
{
$number = 10 * 2 - 5;
say $number$;
}
function if
{
$cond = {"a":5,"b":3};
if $cond.a$ > $cond.b$
{
say true;
}
}
function times
{
$repeat = 3;
times $repeat$
{
say repeated;
}
}
function while
{
$countdown = 10;
while $countdown$ > 0
{
$countdown = $countdown$ - 1;
say repeated;
}
}
}
namespace example
{
@load
function load
{
say load;
}
@tick
function tick
{
playsound minecraft:entity.arrow.hit_player voice @a;
}
}
Join the community and start building amazing Minecraft datapacks with MobCode today