Chest in A Minecart

Discussion in 'Plugin Development' started by TomTheDeveloper, Apr 15, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    TomTheDeveloper

    Hey, I have one question:

    How can I get the chest in a minecart?
    So I can add stuff to it.

    And no, I don't want to use hoppers.
     
  2. Offline

    Ivan

    Code:java
    1.  
    2. StorageMinecart cart = (StorageMinecart) getWorld().spawnEntity(getLocation(), EntityType.MINECART_CHEST);
    3. Inventory cartinventory = cart.getInventory();
    4.  

    Now you can edit the inventory :D
     
    TomTheDeveloper likes this.
  3. Offline

    TomTheDeveloper

    Ivan
    Thx, bro
    PDF (Plugin Developer Friend) :)
     
    Ivan likes this.
Thread Status:
Not open for further replies.

Share This Page