Available Methods
- getItem ( )
- isEmpty ( )
- getItemDamage ( )
- EMPTY
- copy ( )
- getCount ( )
- hasTagCompound ( )
- getTagCompound ( )
- setTagCompound ( )
- setCount ( )
- shrink ( )
- setItemDamage ( )
- damageItem ( )
- getMetadata ( )
- isItemEqual ( )
- setStackDisplayName ( )
- loadItemStackFromNBT ( )
- getMaxStackSize ( )
- getCapability ( )
- addEnchantment ( )
- hasDisplayName ( )
- areItemsEqual ( )
- areItemStackTagsEqual ( )
- splitStack ( )
- writeToNBT ( )
- isItemStackDamageable ( )
- hasCapability ( )
- grow ( )
- getMaxDamage ( )
- getDisplayName ( )
- getEnchantmentTagList ( )
- getOrCreateTag ( )
- areItemStacksEqual ( )
- decrement ( )
- getHasSubtypes ( )
- setTagInfo ( )
- getDamage ( )
- setTag ( )
- getTag ( )
- getTooltip ( )
- setCustomName ( )
- getUnlocalizedName ( )
- isItemEnchanted ( )
- damage ( )
- isStackable ( )
- setDamage ( )
- onItemUse ( )
- useItemRightClick ( )
- isItemDamaged ( )
- clearCustomName ( )
- getDestroySpeed ( )
- tryPlaceItemIntoWorld ( )
- hasTag ( )
- toString ( )
- getMaxCount ( )
- split ( )
- onCrafting ( )
- canHarvestBlock ( )
- getSubCompound ( )
Related Classes
- java.util.Arrays
- java.util.Iterator
- java.util.Random
- javax.annotation.Nullable
- javax.annotation.Nonnull
- org.lwjgl.opengl.GL11
- net.minecraft.world.World
- net.minecraft.block.Block
- net.minecraft.client.Minecraft
- net.minecraft.item.Item
- net.minecraft.entity.Entity
- net.minecraft.entity.player.EntityPlayer
- net.minecraft.util.ResourceLocation
- net.minecraft.nbt.NBTTagCompound
- net.minecraft.tileentity.TileEntity
- net.minecraft.init.Blocks
- net.minecraft.entity.EntityLivingBase
- net.minecraft.entity.player.EntityPlayerMP
- net.minecraft.init.Items
- net.minecraft.util.math.BlockPos
- net.minecraft.nbt.NBTTagList
- net.minecraft.creativetab.CreativeTabs
- net.minecraft.entity.item.EntityItem
- net.minecraft.inventory.IInventory
- net.minecraftforge.fml.relauncher.Side
Java Code Examples for net.minecraft.item.ItemStack#setDamage()
The following examples show how to use
net.minecraft.item.ItemStack#setDamage() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RepairCmd.java From Wurst7 with GNU General Public License v3.0 | 6 votes |
@Override public void call(String[] args) throws CmdException { if(args.length > 0) throw new CmdSyntaxError(); ClientPlayerEntity player = MC.player; if(!player.abilities.creativeMode) throw new CmdError("Creative mode only."); ItemStack stack = getHeldStack(player); stack.setDamage(0); MC.player.networkHandler .sendPacket(new CreativeInventoryActionC2SPacket( 36 + player.inventory.selectedSlot, stack)); ChatUtils.message("Item repaired."); }
Example 2
Source File: OxygenTankItem.java From Galacticraft-Rewoven with MIT License | 5 votes |
private ItemStack applyDefaultTags(ItemStack item, int currentOxy) { CompoundTag tag = item.getOrCreateTag(); tag.putInt(MAX_OXYGEN_NBT_KEY, this.maxOxygen); tag.putInt(OXYGEN_NBT_KEY, currentOxy); item.setDamage(getMaxDamage() - currentOxy); return item; }
Example 3
Source File: BatteryItem.java From Galacticraft-Rewoven with MIT License | 5 votes |
@Override public void appendStacks(ItemGroup group, DefaultedList<ItemStack> groupStacks) { if (this.isIn(group)) { ItemStack charged = new ItemStack(this); GalacticraftEnergy.setEnergy(charged, MAX_ENERGY); groupStacks.add(charged); ItemStack depleted = new ItemStack(this); GalacticraftEnergy.setEnergy(depleted, 0); depleted.setDamage(depleted.getMaxDamage() - 1); groupStacks.add(depleted); } }
Example 4
Source File: BatteryItem.java From Galacticraft-Rewoven with MIT License | 4 votes |
@Override public void onCraft(ItemStack battery, World world_1, PlayerEntity playerEntity_1) { CompoundTag batteryTag = battery.getOrCreateTag(); battery.setDamage(BatteryItem.MAX_ENERGY); battery.setTag(batteryTag); }