How to store a Mob ?

Discussion in 'Plugin Development' started by cdnyassuo34, Mar 21, 2020.

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

    cdnyassuo34

    Hi, I am currently working on a plugin and I am now facing a problem, I have no clue about how to Create a variable of a mob like you would store an Item into an ItemStack variable and store it into an hashmap and if anyone have an idea about how to do it i'd be very happy to learn it ^^ (I am not a native English speaker so might be a little bit bad and only started a few month ago)
    thanks for reading it ^^
     
  2. Offline

    bowlerguy66

    Are you asking for the Entity object?
    Code:
    Entity entity = ...;
    Map<Entity, Integer> score = ...;
    LivingEntity is also useful.
     
  3. Offline

    cdnyassuo34

    yes, but without spawning it . just storing it .... I might ask somethign stupid but what do I add
    Entity entity = .. <-here ? because the "new Entity()" method has many function to fill
     
  4. Offline

    wand555

    You cannot with bukkit. You have to spawn it first. (Though why would you store an entity before spawning it?)
     
  5. Offline

    cdnyassuo34

    oh , I am trying to make custom mobs for dungeons and store them by their names
     
  6. You might be able to spawn it, save its data and then despawn it afterwards?
     
  7. Offline

    wand555

    I think you still have to spawn them (and despawn immediately afterwards) because even with nms you need to pass a world through the constructor and add the entity to that world when you have a custom mob class.
     
  8. Offline

    CraftCreeper6

    @cdnyassuo34
    Just spawn it and teleport it to a cage and then, when you need it, just teleport it out of the cage.
     
Thread Status:
Not open for further replies.

Share This Page