-
Notifications
You must be signed in to change notification settings - Fork 1
Developer Inventory Static
ludgart edited this page Jan 12, 2021
·
2 revisions
Creating Inventory
Create a new class and extend from the InventoryZocker
public class MyCustomInventory extends InventoryZocker {
Extend the required methods
@Override
public String getTitle() {
return "My Title"
}
@Override
public InventoryType getInventoryType() {
return InventoryType.CHEST;
}
@Override
public Integer getSize() {
return 54;
}
@Override
public void setupInventory() {}
The method setupInventory() get triggered, when the player open the inventory.
Adding a item to the Inventory
this.addItem(new InventoryEntryBuilder()
.setItem(new ItemBuilder(CompatibleMaterial.DIAMOND_SWORD.getMaterial())
.setDisplayName("My Custom Item")
.addItemFlags(ItemFlag.HIDE_ENCHANTS))
.setSlot(11)
.build());
Dynamic border
// Add this method to the setupInventory() method.
this.fillBorders();
Open the inventory for a player
Zocker zocker = Zocker.getZocker(uuid);
new MyCustomInventory().open(zocker);
Information
Server Owner
Developer
- Basic
- Installation & Configuration
- Hello World
- Command
- Config
- Material
- Sound
- Particle
- Message
- Title
- ActionBar
- Advanced
- ItemBuilder
- Storage
- Inventory
- Static
- Updatable
- Anvil
- Player Data
- Get
- GetList
- Set
- HasValue
- IsValue
- Insert
- Delete
- OfflineZocker
- Item Serializer
- Custom Event
- Utilit
- Common Problems
- Frequently Asked Questions