Venus Fire Trap, an enemy by Maurice.

Custom enemies are a new feature of Mario: SE, which allows to add new enemies to the game without touching the code, instead using JSON.

Vanilla enemies were converted to that system, and map-makers can add custom enemies to a mappack, or modify the vanilla ones.


At the top of your new enemy.json file, you can optionally copy all the properties from another enemy by adding "base=enemy" at the top. For beginners this is recommended as it allows you to skip some more complicated properties. It is also very useful for simple variations on an enemy, as all enemies with the same base will change if the base enemy changes.

After that, it will follow this pattern:

	"number": value,
	"string": "value",
	"boolean": true/false,
	"array": [value, "value", true, etc.]

Note that the final element does not have a comma at the end. Of course, most text properties have only a few acceptable values even though you can put anything there.

Very early into enemy.lua, there is code that parses all the properties into values in the enemies' property table. Every property in their enemy.json file will be added, even if it is not used anywhere.

A list of every property can be found on the Custom Enemy Documentation.

Collision Edit

Enemies derive their collision through two different properties: "category" and "mask".

Categories Edit

The "category" property is a simple number, 1 through 31. It decides which enemies and entities collide with it.

Masks Edit

The "mask" property, on the other hand, is an array. If it is true, it will not collide with entities or enemies of that category. You can use this to make background enemies that don't collide with anything, enemies that pass right through each other, or even specialized blocks that only collide with particular enemies or the player.

Here is the reference list, as shown in physics.lua:

---2: WORLD
---3: MARIO
---4: GOOMBA
---5: KOOPA
---8: GEL
---9: BOX
--16: BOWSER
--17: FIRE
--18: VINE
--19: SPRING
--21: LAKITO
--22: BUTTON --Not used anymore
--24: CHEEP
--25: DOOR
--29: PLANT
--30: SQUID
--31: UPFIRE

However, categories that refer to other enemies aren't hardcoded and can be freed up by changing that enemy's category. Additionally, you can add as many extra categories as you want, but masks without this category will use category 1 instead. This includes hardcoded masks, such as the player's.

To make it easier to edit, it's usually formatted so that each line directly correlates with a paragraph in the code, like so:

"mask": [    true, 
             true, true, true, true, true,
             true, true, true, true, true,
             true, true, true, true, true,
             true, true, true, true, true,
             true, true, true, true, true,
             true, true, true, true, true],

This mask specifically collides with nothing. Stopping at the first "true" will produce the same effect.

Custom Timers Edit

Custom Timers are an array. Their function is to let enemies preform actions or change their properties after a specified time. They are not used often because their only trigger is time. To use it, you have to put arrays in the array: The first slot is the delay, the second one is the action, the third one is the arguments.

Further Reading Edit

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.