Skip to content
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";
    }
}

Introduction

Using CustomContentLib

Items

Blocks

  • Blocks
    • Block (Soon...)
    • Tile Entity (Soon...)

Recipes

  • Shaped Recipe
  • Shapeless Recipe

Clone this wiki locally