Solved How to increase speed of creepers

Discussion in 'Plugin Development' started by Aayush, Jun 20, 2020.

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

    Aayush

    Hey i am making op mobs in Minecraft and for creeper i want them to increase their speed.I have tried hasPotionEffect stuff and it worked but the problem is that if creeper explode with hasPotionEffect it also spreads potion effect like splash potion of speed and when Player walked into it they get advantage of that so how can i make creeper fast , without splashing potion when it explodes?
    OR
    Is there any method to do it without using potions?
     
  2. Offline

    Machine Maker

    You can change the "GENERIC_MOVEMENT_SPEED" attribute of the LivingEntity. Read through the JavaDocs to see the exact method.
     
    Aayush likes this.
  3. Offline

    Aayush

    Thanks it is working now..

    Here is the code if anyone needs it
    If(event.getEntityType() == EntityType.CREEPER){
    Creeper creeper = (Creeper) event.getEntity();
    creeper.getAttribute(Attribute.GENERIC_MOVEMENT_SPEES)setBaseValue(#value you wanna put);
    }

    Make sure to put lower values or they just gonna zoom around

    #EDIT - setBaseValue(0.5);
    It works great for 0.5 or <0.5

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 20, 2020
  4. Offline

    Machine Maker

    You don't need to cast the entity to a creeper. You already checked if it was a creeper.
     
  5. Offline

    Aayush

    I am actually new to it and i wanted creeper to be powered creeper everytime they spawn and also increase their radius of explosion that's why i did it in this way i don't know what is the the proper way but this is how i did that..
     
  6. Offline

    Machine Maker

    ah ok. I was just going off of the code you showed me. I didn't see any need to have the entity be a creeper object.
     
    Aayush likes this.
Thread Status:
Not open for further replies.

Share This Page