To create the Purple (function) block use:
@SimpleFunction(description = "") // Notice @SimpleFunction
public boolean Statement() {
/*
** boolean can switch to int, String, void, or boolean. Statement can be named
** to the name of your function, do NOT create duplicates. Public can also
** switch to private or public
*/
}
Example function for boolean:
@SimpleFunction(description = "")
public boolean HasThoughtsAboutMe() {
return false;
}
Example function for int:
@SimpleFunction(description = "")
public int HasThoughtsAboutMe() {
return -1;
}
Example function for String:
@SimpleFunction(description = "")
public String HasThoughtsAboutMe() {
return "Nope, we don't care about you.";
}
Example function for void:
@SimpleFunction(description = "")
public void HasThoughtsAboutMe() {
GetStatus();
}
To create the Amber (event) block use:
@SimpleEvent(description = "") // Notice @SimpleEvent
public void Statement() {
/*
** This stays a void! Statement can be named
** to the name of your function, do NOT create duplicates. Public can
** also switch to private or public.
**
** The variables "statement, count", and "crashed" must be thrown when
** this block, so in your block which would throw to this one, you'd use
** Statement("Who knows why your phone died?", 8000, true); Below is
** required to register the block.
*/
}
Example event with one variable:
@SimpleEvent(description = "")
public void GotAppleCount(int count) {
EventDispatcher.dispatchEvent(this, "GotAppleCount", count);
}
Example event with multiple variables:
@SimpleEvent(description = "")
public void GotAppleCount(int count, String statement, boolean areApples) {
EventDispatcher.dispatchEvent(this, "GotAppleCount", count, statement, areApples);
}
Example event with no variable:
@SimpleEvent(description = "")
public void GotAppleCount() {
EventDispatcher.dispatchEvent(this, "GotAppleCount");
}
Follow @yusufcihan’s example for properties, I no longer use them.