Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ________________________________________________
- Tooltip for items, eg armour, food, ect.
- Imports:
- import net.minecraftforge.fml.relauncher.SideOnly;
- import net.minecraft.entity.player.EntityPlayer;
- import java.util.List;
- Code:
- @SideOnly(Side.CLIENT)
- public void addInformation(ItemStack itemStack, EntityPlayer player, List dataList, boolean bool) {
- dataList.add("\u00A7fThis is a tooltip");
- }
- __________________________________________________
- Tooltip for blocks.
- Imports:
- import net.minecraftforge.fml.relauncher.SideOnly;
- import javax.annotation.Nullable;
- import net.minecraft.client.util.ITooltipFlag;
- import java.util.List;
- Code:
- @SideOnly(Side.CLIENT)
- public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, ITooltipFlag advanced)
- {
- tooltip.add("\u00A7fThis is a tooltip");
- }
- Colour codes for tooltips, see https://minecraft.gamepedia.com/Formatting_codes
- _________________________________________________________
- Enchanted glow effect, used on nether star and golden apple.
- Imports:
- import net.minecraftforge.fml.relauncher.SideOnly;
- Code:
- @SideOnly(Side.CLIENT)
- public boolean hasEffect(ItemStack par1ItemStack)
- {
- return true;
- }
- _____________________________________________________
- Makes it so tools cannot be enchantable with books. Setting enchantability to 0 in mcreator only disables it for enchanting it via enchanting table.
- Code:
- @Override
- public boolean isBookEnchantable( final ItemStack itemstack1, final ItemStack itemstack2 )
- {
- return false;
- }
- ____________________________________________________
- Random amount of items dropped when broken block.
- Code:
- public int quantityDropped(IBlockState state, int fortune, Random random) {
- return random.nextInt(5) + 1;
- }
- ____________________________________________________
- How much xp is given when block is broken.
- Code:
- public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune)
- {
- return 1;
- }
- ______________________________________________________
- If block has properties of bookshelf, make number higher for better enchanting power.
- Code:
- public float getEnchantPowerBonus(World world, BlockPos pos)
- {
- return 1;
- }
- _____________________________________________________
- If block can be used as a beacon base.
- Code:
- public boolean isBeaconBase(IBlockAccess worldObj, BlockPos pos, BlockPos beacon)
- {
- return true;
- }
- _____________________________________________________
- If block can be broken by Wither or Enderdragon.
- Imports:
- import net.minecraft.entity.Entity;
- Code:
- @Override
- public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity entity) {
- if (entity instanceof net.minecraft.entity.boss.EntityDragon) {
- return false;
- }
- else if ((entity instanceof net.minecraft.entity.boss.EntityWither) || (entity instanceof net.minecraft.entity.projectile.EntityWitherSkull)) {
- return false;
- }
- return true;
- }
- __________________________________________________________
- Adjust speed of how fast you eat this food, default is 32.
- Code:
- public int getMaxItemUseDuration(ItemStack stack)
- {
- return 32;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement