Minecraft plugin players query chat input one after the other?

Ar
- in Plugins
2

I wanted to use this code to make a plugin by asking one after the other whether the player writes yes or no in the chat: . I have the following problem: if the player writes "yes", the first and second IF loops are triggered. The second should only be triggered when the player writes "yes" the second time.

An

IF is a block, not a loop
Comparisons are made with two = (i.e. ==)
Why are you creating a task for a text output?
I would do that with some kind of simple machine. So an enum with the possible states, and then with a command, set the next state with a switch block.
Something like hatkiritoschongefragt is difficult to read, prefer to use hasKiritoSchonGeffrage. Called itself CamelCase. Alternatively, underscores are also possible, but this is actually more likely to be done with c programs.
You don't see where your variables are stored, but the way it looks, I suspect that you will run into problems if multiple players answer the questions at the same time because you don't differentiate between players.

An

That's how I would write it