Hub Gadgets

Discussion in 'Plugin Development' started by IIxUnderWorldxII, Nov 13, 2014.

Thread Status:
Not open for further replies.
  1. I'm working on a hub gadget type plugin and I'm trying to implement spawning & riding entities. I've looked everywhere for the horse but I can't find how to saddle it and when spawned able to ride. I've also had issues separating commands, there in different classes but when I try run the command from the 2nd class it just copies the command from the main plugin.
     
  2. Offline

    drpk

    IIxUnderWorldxII
    Code:java
    1. Horse horse = (Horse) loc.getWorld().spawnEntity(loc, EntityType.HORSE);
    2.  
    3. horse.getInventory().setSaddle();

    also, please expand on the command issue. Are there any stacktraces?
     
  3. drpk Doesn't seem to work.
     
  4. Offline

    jensdeboom

  5. Offline

    Skionz

    IIxUnderWorldxII Did you create a new saddle ItemStack and fill the setSaddle() method's parameter with it?
     
  6. Offline

    jensdeboom

    IIxUnderWorldxII Umh lol then add new ItemStack(Material.SADDLE) as a parameter...
     
  7. Offline

    Skionz

  8. Offline

    TheCodingCat

    don't you have to make it tamed first? And to set the saddle I'm pretty sure
    horse.getInventory().setSaddle(new ItemStack(Material.SADDLE));
     
  9. Offline

    jensdeboom

    ?
     
  10. I'm sorta new and sorta experienced, I've been doing it for a while now but I'm not great, I just need guidance so, whats 'setSaddle() methods parameter'

    TheCodingCat I've tamed it.

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

    Skionz

  12. Offline

    jensdeboom

    Skionz ah k :p [OFFTOPIC] Could you look at my thread "stop spawning blocks from becoming solid" because I have an issue and I feel like I'm doing something wrong/stupid [/OFFTOPIC]
     
  13. Offline

    Skionz

  14. Skionz I also want to ask, how would I do particle effects around the head? Links?
     
  15. Offline

    Skionz

  16. Skionz Also what would I change it to, = true; or...
     
  17. Offline

    Skionz

    IIxUnderWorldxII considering HorseInventory isn't a boolean, no. You wouldn't change it to = true;
     
  18. Skionz What would I change it to then...
     
  19. Offline

    Skionz

    IIxUnderWorldxII An instance of the HorseInventory class. Use Horse#getInventory().
    You really need to learn java before attempting the bukkit api.
     
Thread Status:
Not open for further replies.

Share This Page