-
-
Notifications
You must be signed in to change notification settings - Fork 3
Groovy Format
Misat11 edited this page May 30, 2020
·
4 revisions
This library can use .groovy
files for guis!
Just load it with this simple structure!
import org.screamingsandals.simpleinventories.SimpleInventories;
import org.screamingsandals.simpleinventories.inventory.Options;
...
Options options = new Options(myAwesomePlugin);
// some configuration
SimpleInventories format = new SimpleInventories(options);
try {
format.loadFromDataFolder(plugin.getDataFolder(), "gui.groovy");
} catch (Exception e) {
e.printStackTrace();
}
...
f you are not sure if your format is correct, just try it with SimpleInventories-Plugin and look at console! We don't know any online groovy checker.
inventory {
category('DIAMOND_CHESTPLATE;1;Armor') {
item('...') {
/* use properties! We don't support custom variables in groovy shop (ok, it's possible via getItemMap().put('key', 'value')) */
property 'myCustomProperty', [
myCustomVariable: 'myCustomValue',
myCustomVariable2: 'myCustomValue2'
]
}
category('...') {
category('...') {
item('...')
item('...')
}
item('...')
}
}
}
Can't find what are you looking for on this wiki? Maybe our automatically generated javadoc could help you https://docs.screamingsandals.org/simpleinventories/simpleinventories-core/
- Welcome on this wiki
- Formats:
- Variables:
- Callbacks: (Groovy only)
-
Examples:
- Making shop (Groovy only)
- Making vault shop (Groovy only)