-
Notifications
You must be signed in to change notification settings - Fork 0
Items
VadamDev edited this page Oct 7, 2022
·
2 revisions
public class ExempleItem extends CustomItem {
public ExempleItem () {
super(new ItemStack(Material.STICK));
}
//Called when a player click on a block or in air
//return true if the event should be cancelled
public boolean onClick(Player player, ItemAction action, Block block, BlockFace blockFace, ItemStack item) {
return false;
}
//Called when a player click on an entity
//return true if the event should be cancelled
public boolean onEntityClick(Player player, Entity clicked, ItemStack item) {
return false;
}
//Called when a player hurt an entity
//return true if the event should be cancelled
public boolean hurtEntity(Player player, Entity victim, ItemStack item) {
return false;
}
//Called when a player mine a block with the custom item
//return true if the event should be cancelled
public boolean mineBlock(Player player, Block block, int exp, ItemStack itemStack) {
return false;
}
//The registry name of the item, like minecraft's unlocalized name.
@Override
public String getRegistryName() {
return "exemple_item";
}
}- Items
- Foods
- Armors Parts
-
- Armor Sets
- Durability Provider
-
- Durability Bar
- Blocks
-
- Block (Soon...)
-
- Tile Entity (Soon...)
- Shaped Recipe
- Shapeless Recipe