Skip to content

WorldObjectExtension

juanosarg edited this page May 30, 2026 · 2 revisions

<- Back

WorldObjectExtension is a def extension that adds a few custom behaviours for new world objects.

    // Prevent any ObjectSpawnDef from triggering on this particular map.
    // This is meant as a blanket ban to all spawn, rather than blocking
    // this WorldObjectDef in every single ObjectSpawnDef that exists.
    public bool disableObjectSpawnDefs = false;

How do I use this code?

This Def Extension is added to the WorldObjectDef of the roof you want to add them to.

If you aren't sure if the WorldObjectDef ALREADY has an extension (for example, if you think another mod will add their own), always use XPATH (xml patching) to add an extension, as there is already a PatchOperationAddModExtension to ensure they don't collide.

For example, on Vanilla Gravship Expanded, this allows us to disable Vanilla Vehicles Expanded vehicle wrecks from spawning in space maps

<modExtensions>
      <li Class="VEF.Maps.WorldObjectExtension">
            <disableObjectSpawnDefs>true</disableObjectSpawnDefs>
      </li>
</modExtensions>

Clone this wiki locally