[
api ]
Create Item
Code (Java):
ItemStack button
=
new ViewItemBuilder
(Material.
DIAMOND
)
.
name
(
"§cButton"
)
.
lore
(
"§fClick Me!"
)
.
action
(ViewItem.
ACTION_CONSOLE_COMMAND
)
.
value
(
"give %player% diamond 1"
)
.
build
(
)
;
Import
plugin.yml
Code (YAML):
depend
:
[ProtocolLib,CraftGUI
]
Your plugin .java
Code (Java):
private
static ViewGuide guide
;
public
void setupGuide
(
)
{
RegisteredServiceProvider
<ViewGuide
> rsp
= Bukkit.
getServer
(
).
getServicesManager
(
).
getRegistration
(ViewGuide.
class
)
;
if
(rsp
==
null
)
{
this.
getLogger
(
).
warning
(
"CraftGUI not found!"
)
;
return
;
}
guide
= rsp.
getProvider
(
)
;
...
}