Custom entity inventory

Discussion in 'Plugin Development' started by DarkBladee12, Dec 22, 2013.

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

    DarkBladee12

    Hey guys, is it possible to create an inventory similar to the horse inventory, but for another entity and without the armor and saddle slots? I've already tried something with hooking into NMS, but I didn't succeed :/ (It only opens a normal inventory without the entity model)

    Bump.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  2. Offline

    Chlorek

    There is a number of inventories you can use, let's call it "types". You can't create any inventory you like.
     
  3. Offline

    DarkBladee12

    Chlorek I know that, but I think it may be possible to make a custom entity inventory, just like you can make custom entities by extending NMS classes.
     
  4. Offline

    Chlorek

    Anyway you can't change slots placements or remove them at all. It's generally all way managed by client how it looks.
    (I am not up to date cuz I have not played Minecraft since 1.4, but as far as I know it is still not possible).
     
  5. Offline

    DarkBladee12

    Chlorek Well, it's possible to remove the saddle slot (for example the inventory of a skeleton horse has no saddle slot), so I assume it's possible to remove saddle and armor slot and just change the entity model which is tracked by the inventory.
     
  6. Offline

    Chlorek

    DarkBladee12
    I don't know too much about all these horses and horse-like creatures, but it looks like they generally use different inventories, they are not 'same type'. If there exists any inventory wihout saddle and armor slot then it is possible to achieve, if there is no, then it's not possible.
     
  7. Offline

    DarkBladee12

  8. Offline

    Chlorek

  9. Offline

    DarkBladee12

    Chlorek Well but the last field type is the id of the EntityHorse, so I think you can use the id of another entity instead and this will be displayed then^^
     
  10. Offline

    Chlorek

    DarkBladee12
    Yes, it's just a packet, you can send it, it's that "simple".
     
  11. Offline

    Mrawesomecookie

    DarkBladee12 Certain entites that extend LivingEntity allow to have a inventory, CraftPlayer, and CraftSkeleton for example. However, other entities like CraftWitherSkull don't. It depends on what kind of entity you want to use. These generally extend the InventoryHolder class.
     
  12. Offline

    Techy4198

    Mrawesomecookie I assume it works only for whatever the Craft equivalent is for LivingEntities.
     
  13. Offline

    Mrawesomecookie

    Yes. HumanEntity is a InventoryHolder so you can getInventory() on it.
    Code:
    public abstract interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, InventoryHolder
    Code:
    public abstract interface LivingEntity extends Entity, Damageable
    Some entities don't technically have a inventory but they have "equipment"
    Code:
            zom.getEquipment().setBoots(new ItemStack(Material.DIAMOND_BOOTS));
    You can't hack protocol. When you do this it gets sent as a packet. You need to have a horse for the game to open a horse inventory.
     
  14. Offline

    RawCode

    you just can't, GUI rendered client side.
     
Thread Status:
Not open for further replies.

Share This Page