-
-
Notifications
You must be signed in to change notification settings - Fork 3
Variable: properties
Misat11 edited this page May 9, 2020
·
3 revisions
Properties is not used by this library but you can use it in your plugin. We recommended to use properties if you want to do some action after click and if you want to modify item in gui, we recommended to use custom variable but it depends on your mind.
There are more variants how to work with properties!
Yaml: Properties with variables:
- stack: ...
properties:
- name: myProperty
variable: "Hello World"
- name: anotherProperty
variable: "Hello"
variable2: "World"
Multiple properties without variables:
- stack: ...
properties:
- myProperty
- anotherProperty
Single property without variable:
- stack: ...
properties: myProperty
Groovy:
item('...') {
property 'myProperty' // single property without variables
property('anotherProperty', [ // single property with variables
variable: 'Hello',
variable2: 'World!'
])
}
...
PlayerItemInfo item = /* here you can get item from somewhere, example from event by */ event.getItem();
if (item.hasProperties()) { // Check if properties are exists
for (Property property : item.getProperties()) {
/* Here you can do some actions with property */
}
}
...
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)