Skip to content

World morphs

McHorse edited this page Aug 26, 2021 · 2 revisions

World morphs is a Mappet cosmetic mechanism (kind of like HUD scenes) which allows to spawn/display morphs to players in the world or attached to entities. This is very useful for creating visual effects using morphs (i.e. sequencer animation, Snowstorm particles, etc.) without having to place an NPC, Blockbuster actor or even model block.

The main limitations of world morphs are that they are: temporary and client-side. The first means that they can't be placed until they get removed, i.e. they have limited lifespan. The second means that these morphs are not present on the server side, which means they can't be edited after they went sent to the client. These world morphs also disappear after players leave the server.

How to use

Via commands

You can use world morphs either though following commands:

  • /mp morph add entity <target> <expiration> <rotate> <x> <y> <z> <yaw> <pitch> <morph>, this command spawns a world morph attached to an entity
  • /mp morph add world <expiration> <x> <y> <z> <yaw> <pitch> <morph>, this command spawns a world morph in the world

For example, this command will spawn a diamond hoe above your head for 5 seconds:

/mp morph add world 100 ~ ~2.5 ~ 0 0 {Name:"item"}

Via scripts

You can use IScriptEntity.displayMorph() or IScriptWorld.displayMorph() to spawn a world morph:

function main(c)
{
    var s = c.getSubject();
    var morph = mappet.createMorph('{Name:"item"}');

    s.displayMorph(morph, 100, 0, 2.5, 0);
}

This script will do the same thing as the example in the commands section.

Clone this wiki locally