Is this custom command block possible?

So I’m not new to snap but I’m still new to custom block making. Before I start testing and possibly just waste time; I wanna ask if this is even possible.

I want to make a custom command block that combines

[if [ (answer) = (text) ] ]

{condition script}

and let it have multiple inputs, like the little arrow that allows you to do an “Else if” but have it be an “And if” instead of “Else if”

I can try to explain in a different way if needed, but I am wondering is this possible?

You’re talking about a block that does something like this?
if <> and if <>@<:> then { ... }:: control

No, I am talking about something where the arrow makes another command line

like if one conditional Is true then something happens

and if another separate conditional is also true, then something else happens

Oh, so an else-if that doesn’t stop if the first condition is true. I see.

You can, but it’s a little silly, since its effect will be the same as just using a bunch of regular IF blocks:


But the notation for making an input group (such as grouping a Boolean input slot and a C-slot) is pretty hideous, because Jens doesn’t think anyone should do it except himself. :~( If you’re new to custom blocks, that’s not the one you should start with, imho.

Im not starting with this as my first custom block, Im just not used to using the command customizations or any of the menu items.

also, yes, that is what I have been using lol, I’m just wondering if it’s possible to turn that into a custom block to make my coding a little bit easier.

you get used to it, though

That doesn’t solve the issue of the syntax being hideous, undocumented, and undiscoverable.

untitled script pic (6)
in case this is what you were asking for, here it is
i can’t find a way to get the labels exactly perfect, but the block works

it actually seemed pretty simple, i don’t know what you mean by this


unless you mean the numerical values for the inputs being confusing, which i agree with, but i just went back to a past post to help make the block

I just use %b, %s, %clr, %txt, etc

I never said it did.

wow i can’t believe i never knew those were options

I didn’t know for a while, but I just tried it one day when I didn’t remember what number color corresponded to.

Is that a normal block and I’m just blind or is that a custom block?

also side note: I love your profile picture so much

You can actually also just use “text”, “number”, “boolean” etc.

yes, it is a custom block, i was just trying my best to make it look like a primitive

thanks! although it’s just from a reddit post, i wish i had a cat to take this pic with lol

oh, interesting

now i feel stupider :laughing:

Don’t feel stupid, it’s completely undocumented, snap doesn’t show it, and I first learned about it when jens mentioned it on the forum (and I’m pretty sure bh also didn’t know about it until then).

yeah we really need a different input system.

There should be a graphical user interface. You should be able to set the type of an input to “input group,” in which case what appears in the block prototype is a rectangle with black border and filled with the color of the custom block you’re building (or alternatively, you can think of it as having a transparent interior. Inside the rectangle would be a plus sign, which you can click to put an input slot or title text in the input group. I guess the rectangle has to be enclosed in an orange oval like an input slot name, with a “…” after the rectangle because the whole point is that the group can be repeated.

I mean, this is just off the top of my head, but you get the idea: you should be able to add inputs and title text in an input group the same as you can in the entire block.