Files

76 lines
1.9 KiB
Markdown

# IScriptFactory.vector4
[← IScriptFactory](index.md) · [← Master](../../wiki.md)
Parça 5/11 · [önceki](vector4-4.md) · [sonraki](vector4-6.md)
an item stack with block specified by ID, or an empty item stack if the block doesn't exist
getParticleType
EnumParticleTypes getParticleType(java.lang.String type)
Get Minecraft particle type by its name.
You can find out all of the particle types by typing in /particle command, and looking up the completion of the first argument
(i.e. press tab after typing in /particle and a space).
var explode = mappet.getParticleType("explode");
var pos = c.getSubject().getPosition();
c.getWorld().spawnParticles(explode, true, pos.x, pos.y + 1, pos.z, 50, 0.5, 0.5, 0.5, 0.1);
getPotion
Potion getPotion(java.lang.String type)
Get Minecraft potion effect by its name.
You can find out all of the particle types by typing in /effect command, and looking up the completion of the second argument
(i.e. press tab after typing in /particle Player and a space).
var slowness = mappet.getPotion("slowness");
c.getSubject().applyPotion(slowness, 200, 1, false);
createMorph
default AbstractMorph createMorph(java.lang.String nbt)
Create a morph out of string NBT.
var morph = mappet.createMorph("{Name:\"blockbuster.alex\"}");
// Assuming c.getSubject() is a player
c.getSubject().setMorph(morph);
createMorph
AbstractMorph createMorph(INBTCompound compound)
Create a morph out of NBT.
var tag = mappet.createCompound();
tag.setString("Name", "blockbuster.alex");
var morph = mappet.createMorph(tag);
// Assuming c.getSubject() is a player
c.getSubject().setMorph(morph);
createUI
default IMappetUIBuilder createUI()
Create a UI. You can send it to the player by using IScriptPlayer.openUI(IMappetUIBuilder) method.
function main(c)
{