Minecraft Blogs / Art

Tapir Mod- Tapir Leather| Mod Code #003

  • 62 views, 2 today
  • 4
  • 2
MCTapir avatar MCTapir
Level 25 : Expert Nerd
16
Today we are going to see the Code of the Tapir leather.
New Version doesnt come today i must learn for school :-(
But he are the Code:

package net.mcreator.tapire.item;

import net.minecraftforge.registries.ObjectHolder;

import net.minecraft.item.Rarity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.Item;
import net.minecraft.block.BlockState;

import net.mcreator.tapire.TapireModElements;

@TapireModElements.ModElement.Tag
public class TapirleatherItem extends TapireModElements.ModElement {
@ObjectHolder("tapire:tapirleather")
public static final Item block = null;
public TapirleatherItem(TapireModElements instance) {
super(instance, 1);
}

@Override
public void initElements() {
elements.items.add(() -> new ItemCustom());
}
public static class ItemCustom extends Item {
public ItemCustom() {
super(new Item.Properties().group(ItemGroup.MISC).maxStackSize(64).rarity(Rarity.COMMON));
setRegistryName("tapirleather");
}

@Override
public int getItemEnchantability() {
return 0;
}

@Override
public int getUseDuration(ItemStack itemstack) {
return 0;
}

@Override
public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) {
return 1F;
}
}
}
Tags

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2021
www.planetminecraft.com

Welcome