#Custom structure summon with multiple orientations.

1 messages · Page 1 of 1 (latest)

still vigil
#

I made a script that detect custom structure summon with multiple orientations.
the script support custom patterns like:

const patternTypes = {
    "*": undefined,
    "a": "minecraft:air",
    "s": "minecraft:stone",
    "p": "minecraft:pumpkin",
};

const pattern = [
    ["asa"],
    ["sss"],
    ["ppp"]
];

or even 3D ones like:

const patternTypes = {
    "*": undefined,
    "a": "minecraft:air",
    "s": "minecraft:stone",
    "p": "minecraft:pumpkin",
};
const pattern = [
    [
        "asa",
        "asa",
        "asa",
    ],
    [
        "sss",
        "sss",
        "sss",
    ],
    [
        "ppp",
        "ppp",
        "ppp",
    ]
];

the size is customizable too. the function need a bit of optimization, the first example lag spike is between 5ms to 20ms

#

The

    "*": undefined,

part is for type any (any block can be there).
The last block in the Object is the block that run the checks

olive pike
#

this is so cool i wish i can do it one day

still vigil
fading flint
#

Nice!

#

Where's that script?

still vigil
weary willow
#

Nice

still vigil
#
  • made it into a class to support constructing multiple patterns detection
  • you can now pass a callback function for spawning the entity
  • the function now use runJob
    TODO:
    deal with the multi spawning when two structures share the same detection block (see the end of the vid)
#
// Example usage:
const detector = new StructureDetector(
    {
        "*": undefined,
        "a": "minecraft:air",
        "s": "minecraft:stone",
        "p": "minecraft:pumpkin"
    },
    [
        ["asa"],
        ["sss"],
        ["ppp"]
    ],
    (dimension, pos) => {
        const entity = dimension.spawnEntity("minecraft:zombie", pos);
        entity.nameTag = "Summoned Zombie";
    }
);

world.afterEvents.playerPlaceBlock.subscribe(({ block, dimension }) => {
    detector.detectStructure(dimension, block);
});
dull elbow
#

Is this library/addon going to be publicly available?

vale sable
#

I think this "custom summon structure/totem" could be useful of summoning custom withers (especially wither storm)

still vigil
still vigil
stoic harness
#

It’s from minato so it is surely be lit 🔥