EngineHub / EngineHub/CraftBook

Suggestion: Variable IF/CHECK

Open
#1,070 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
320
Forks
166
Avg merge
6d 21h
Merged PRs (30d)
2

Description

CRAFTBOOK-3328 - Reported by Omanoctoa

Hello!
I know you have VAR ICs to check a Variable's value, but they are not always ideal in situations where you do not want use blocks/signs (such as in commands). The /cb var command is super-useful, but is missing a key element: The ability to CHECK (or compare) a variable by command. In essense, an IF command.

My suggestion is to add a subcommand to the Variable command: CHECK

/cb var CHECK

Basically, this would be a super-compact and streamlined Command version of the VAR ICs. The VAR CHECK command would compare the existing value of a variable to the Check value, and outputs TRUE/FALSE. If it results in a TRUE output, then it runs the argument as a CONSOLE command. I suggest running as Console, because I'm not sure how you would indicate how to run it as Player, Superuser or Console otherwise, without using symbols within the command structure (such as "/#say hello" being run from Console).

Apart from the argument, this would basically just be a command variation of the VAR ICs. It would have very useful applications where using blocks/signs is not possible.

Cheers!
Omanoctoa.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.