Modifying horse speed/jump

Discussion in 'Archived: Plugin Requests' started by Infectedd, Jul 17, 2013.

  1. Offline

    Infectedd

    Plugin category: Transportation
    Suggested name: Uh.. HorseModify? I'm terrible at this

    What I want: The ability to change a horse's jump height and speed with a command

    Ideas for commands: /horsemodify {jump/speed} {integer} - self-explanatory

    Ideas for permissions: horse.modify

    When I'd like it by: Yesterday. It's not like I can influence your choice.
     
  2. Offline

    kreashenz

    I got it, gimme a few minutes, shouldn't be too hard :D
     
  3. Offline

    Infectedd

    Frankly, I was not expecting suck quick action. Awesome!
     
  4. Offline

    kreashenz

    Infectedd Do you mind about using RemoteEntities (external plugin) because there's no good way to edit a horses speed without potion effects (unless you don't mind the potion effects).
     
  5. Offline

    Garris0n

    Didn't you make a library to edit attributes? I thought the speed/jump were attributes o.o
     
  6. Offline

    kreashenz

    Garris0n For items, not entities. :p Infact, thanks for that. I just remembered something.
     
  7. Offline

    wreed12345

  8. Offline

    Garris0n

    Ah ok. I hope bukkit adds an API for entity/item attributes :p
     
  9. Offline

    Infectedd

    Thank you all!
     
  10. Offline

    Ewe Loon

    Interesting , but it didn't change the speed of horses, but this works

    Code:
        public Double getHorseSpeed(Horse h){   
            AttributeInstance attributes = ((EntityInsentient)((CraftLivingEntity)h).getHandle()).getAttributeInstance(GenericAttributes.d);
            return attributes.getValue();
        }
       
        public void setHorseSpeed(Horse h,double speed){   
            // use about  2.25 for normalish speed  
            AttributeInstance attributes = ((EntityInsentient)((CraftLivingEntity)h).getHandle()).getAttributeInstance(GenericAttributes.d);
            attributes.setValue(speed);
        }
       
    
     
  11. Offline

    mikhaelcool7

     
  12. Offline

    Infectedd

    Wreed, could you use this in your plugin?
     
    wreed12345 likes this.
  13. Offline

    wreed12345

    Interesting the only thing about attributes is I think after every update they usually become broken. Although I will definitely add that into my plugin today. Infectedd
     
    Infectedd likes this.
  14. Offline

    wreed12345


    Ewe Loon
    Hey I was trying out this code but I was having a lot of problems such as classes not existing... I could use some help if you would like to
     
  15. Offline

    Ewe Loon

    you need to import the classes from craftbukkit not bukkit
    thats the jar file you run not the api
    these are the necessary imports

    import net.minecraft.server.v1_6_R2.AttributeInstance;
    import net.minecraft.server.v1_6_R2.EntityInsentient;
    import net.minecraft.server.v1_6_R2.GenericAttributes;
     
    wreed12345 likes this.
  16. Offline

    wreed12345

    ahhh, i think that may have been the problem. that makes sense. I will go try that out
     
  17. Offline

    iFamasssxD

    Currently making this plugin. Should not take long.
     
  18. Offline

    iFamasssxD

  19. Offline

    pokuit

  20. Offline

    timtower Administrator Administrator Moderator

    You import CraftBukkit
     
  21. Offline

    pokuit

    @timetower lol I always speak to you...
    Anyway I did but eclispe is still giving me an error
     
  22. Offline

    timtower Administrator Administrator Moderator

    Did you used the build path thingy?
     
  23. Offline

    pokuit

    timtower yes I did I added to my build path craftbukkit.jar

    even if i do import net.minecraft.server.*;
    It still gives me an error with "no suggestion"

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

Share This Page