How to store a Mob ?

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

  1. Offline


    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


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


    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


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


    oh , I am trying to make custom mobs for dungeons and store them by their names
  6. Offline


    You might be able to spawn it, save its data and then despawn it afterwards?
  7. Offline


    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. Online


    Just spawn it and teleport it to a cage and then, when you need it, just teleport it out of the cage.

Share This Page