Plugin Help spawn slime with custom size and effects

Discussion in 'Plugin Help/Development/Requests' started by jkctech, Nov 13, 2014.

Thread Status:
Not open for further replies.
  1. Hello,
    i am working on a plugin which spawns a slime of size 3, adds invulnarability and sets the velocity to 2, so it bounces.
    but i'm struggling with spawning the thing.
    i can spawn the entity but i have absoluteliy no idea how to apply the size, the invulnarability and the velocity. the velocity works on players, but i have no idea how to apply it to mobs.

    can someone please help me?
    thanks in advance.
     
  2. Offline

    Mammothskier

    Usually it's best to provide a bit of code in your forum post.

    The way I've always done it is spawn the slime. It will be size 1 when you spawn it. Then use slime.setSize(). From my understanding, for making it invoulnarable, you should listen for when the entity is damaged and cancel the event for that specific entity.

    Edit: it may be worth looking at my code in my Giants plugin. The source can be found at https://github.com/Mammothskier/Giants
     
  3. thx, i will look into it, but the setSize thing doesn't seem to work for me :/ do you have an example code for me? would be appriciated, thx.
     
  4. Offline

    Mammothskier

    The spoonfeeds are real....
    MagmaCube entity = (MagmaCube) loc.getWorld().spawnEntity(location, EntityType.MAGMA_CUBE);
    entity.setSize(size);

    Same thing, but for slimes.
     
Thread Status:
Not open for further replies.

Share This Page