net.minecraft.entity.item

## Class EntityMinecartContainer

- java.lang.Object
- - net.minecraft.entity.Entity
  - - net.minecraft.entity.item.EntityMinecart
    - - net.minecraft.entity.item.EntityMinecartContainer

- All Implemented Interfaces:
    IInventory
  Direct Known Subclasses:
    EntityMinecartChest, EntityMinecartHopper

      public abstract class EntityMinecartContainer
      extends EntityMinecart
      implements IInventory

- - ### Field Summary

    - ### Fields inherited from class net.minecraft.entity.item.EntityMinecart

      `defaultDragAir, defaultMaxSpeedAirLateral, defaultMaxSpeedAirVertical`

    - ### Fields inherited from class net.minecraft.entity.Entity

      `addedToChunk, boundingBox, capturedDrops, captureDrops, chunkCoordX, chunkCoordY, chunkCoordZ, cloakUrl, dimension, distanceWalkedModified, entityCollisionReduction, entityId, fallDistance, field_70135_K, field_82151_R, field_98038_p, fireResistance, height, hurtResistantTime, ignoreFrustumCheck, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, myEntitySize, noClip, onGround, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, renderDistanceWeight, riddenByEntity, ridingEntity, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, skinUrl, stepHeight, ticksExisted, timeUntilPortal, velocityChanged, width, worldObj, yOffset, ySize`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EntityMinecartContainer(World par1World)`
    `EntityMinecartContainer(World par1World, double par2, double par4, double par6)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `closeChest()`
    `ItemStack` | `decrStackSize(int par1, int par2)` Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new stack.
    `int` | `getInventoryStackLimit()` Returns the maximum stack size for a inventory slot.
    `String` | `getInvName()` Returns the name of the inventory.
    `ItemStack` | `getStackInSlot(int par1)` Returns the stack in slot i
    `ItemStack` | `getStackInSlotOnClosing(int par1)` When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like when you close a workbench GUI.
    `boolean` | `interact(EntityPlayer par1EntityPlayer)` Called when a player interacts with a mob.
    `boolean` | `isStackValidForSlot(int par1, ItemStack par2ItemStack)` Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
    `boolean` | `isUseableByPlayer(EntityPlayer par1EntityPlayer)` Do not make give this method the name canInteractWith because it clashes with Container
    `void` | `killMinecart(DamageSource par1DamageSource)`
    `void` | `onInventoryChanged()` Called when an the contents of an Inventory change, usually
    `void` | `openChest()`
    `void` | `setDead()` Will get destroyed next tick.
    `void` | `setInventorySlotContents(int par1, ItemStack par2ItemStack)` Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
    `void` | `travelToDimension(int par1)` Teleports the entity to another dimension.

    - ### Methods inherited from class net.minecraft.entity.item.EntityMinecart

      `applyEntityCollision, attackEntityFrom, canBeCollidedWith, canBePushed, canBeRidden, canUseRail, createMinecart, func_70489_a, func_70495_a, func_95999_t, func_96094_a, getBoundingBox, getCartItem, getCollisionBox, getCollisionHandler, getCurrentCartSpeedCapOnRail, getDamage, getDefaultDisplayTile, getDefaultDisplayTileData, getDefaultDisplayTileOffset, getDisplayTile, getDisplayTileData, getDisplayTileOffset, getDragAir, getEntityName, getMaxCartSpeedOnRail, getMaxSpeedAirLateral, getMaxSpeedAirVertical, getMinecartType, getMountedYOffset, getRollingAmplitude, getRollingDirection, getShadowSize, getSlopeAdjustment, hasDisplayTile, isInvNameLocalized, isPoweredCart, moveMinecartOnRail, onActivatorRailPass, onUpdate, performHurtAnimation, setCanUseRail, setCollisionHandler, setCurrentCartSpeedCapOnRail, setDamage, setDisplayTile, setDisplayTileData, setDisplayTileOffset, setDragAir, setHasDisplayTile, setMaxSpeedAirLateral, setMaxSpeedAirVertical, setPositionAndRotation2, setRollingAmplitude, setRollingDirection, setVelocity, shouldDoRailFunctions`

    - ### Methods inherited from class net.minecraft.entity.Entity

      `addEntityID, addToPlayerScore, addVelocity, canAttackWithItem, canRenderOnFire, copyDataFrom, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, func_82143_as, func_82146_a, func_82149_j, func_85029_a, func_85031_j, func_96090_ax, func_96091_a, func_96092_aw, func_98034_c, func_98035_c, getAir, getBrightness, getBrightnessForRender, getCollisionBorderSize, getDataWatcher, getDistance, getDistanceSq, getDistanceSqToEntity, getDistanceToEntity, getEntityData, getExtendedProperties, getEyeHeight, getHasActivePotion, getLastActiveItems, getLookVec, getMaxInPortalTime, getParts, getPersistentID, getPickedResult, getPortalCooldown, getRotationYawHead, getTeleportDirection, getTexture, getYOffset, handleHealthUpdate, handleLavaMovement, handleWaterMovement, hashCode, isBurning, isCreatureType, isEating, isEntityAlive, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInvulnerable, isImmuneToFire, isInRangeToRenderDist, isInRangeToRenderVec3D, isInsideOfMaterial, isInWater, isOffsetPositionInLiquid, isRiding, isSneaking, isSprinting, isWet, mountEntity, moveEntity, moveFlying, onCollideWithPlayer, onEntityUpdate, onKillEntity, onStruckByLightning, playSound, readFromNBT, registerExtendedProperties, resetEntityId, setAir, setAngles, setCurrentItemOrArmor, setEating, setFire, setHasActivePotion, setInPortal, setInWeb, setLocationAndAngles, setPosition, setPositionAndRotation, setRotationYawHead, setSneaking, setSprinting, setWorld, shouldRenderInPass, shouldRiderSit, toString, unmountEntity, updateCloak, updateRidden, updateRiderPosition, writeToNBT`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface net.minecraft.inventory.IInventory

      `getSizeInventory, isInvNameLocalized`

- - ### Constructor Detail

    - #### EntityMinecartContainer

          public EntityMinecartContainer(World par1World)

    - #### EntityMinecartContainer

          public EntityMinecartContainer(World par1World,
                                 double par2,
                                 double par4,
                                 double par6)

  - ### Method Detail

    - #### killMinecart

          public void killMinecart(DamageSource par1DamageSource)

      Overrides:
        `killMinecart` in class `EntityMinecart`

    - #### getStackInSlot

          public ItemStack getStackInSlot(int par1)

      Returns the stack in slot i
      Specified by:
        `getStackInSlot` in interface `IInventory`

    - #### decrStackSize

          public ItemStack decrStackSize(int par1,
                                int par2)

      Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new stack.
      Specified by:
        `decrStackSize` in interface `IInventory`

    - #### getStackInSlotOnClosing

          public ItemStack getStackInSlotOnClosing(int par1)

      When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like when you close a workbench GUI.
      Specified by:
        `getStackInSlotOnClosing` in interface `IInventory`

    - #### setInventorySlotContents

          public void setInventorySlotContents(int par1,
                                      ItemStack par2ItemStack)

      Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
      Specified by:
        `setInventorySlotContents` in interface `IInventory`

    - #### onInventoryChanged

          public void onInventoryChanged()

      Called when an the contents of an Inventory change, usually
      Specified by:
        `onInventoryChanged` in interface `IInventory`

    - #### isUseableByPlayer

          public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer)

      Do not make give this method the name canInteractWith because it clashes with Container
      Specified by:
        `isUseableByPlayer` in interface `IInventory`

    - #### openChest

          public void openChest()

      Specified by:
        `openChest` in interface `IInventory`

    - #### closeChest

          public void closeChest()

      Specified by:
        `closeChest` in interface `IInventory`

    - #### isStackValidForSlot

          public boolean isStackValidForSlot(int par1,
                                    ItemStack par2ItemStack)

      Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot.
      Specified by:
        `isStackValidForSlot` in interface `IInventory`

    - #### getInvName

          public String getInvName()

      Returns the name of the inventory.
      Specified by:
        `getInvName` in interface `IInventory`

    - #### getInventoryStackLimit

          public int getInventoryStackLimit()

      Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this more of a set than a get?*
      Specified by:
        `getInventoryStackLimit` in interface `IInventory`

    - #### travelToDimension

          public void travelToDimension(int par1)

      Teleports the entity to another dimension. Params: Dimension number to teleport to
      Overrides:
        `travelToDimension` in class `Entity`

    - #### setDead

          public void setDead()

      Will get destroyed next tick.
      Overrides:
        `setDead` in class `EntityMinecart`

    - #### interact

          public boolean interact(EntityPlayer par1EntityPlayer)

      Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
      Overrides:
        `interact` in class `Entity`