Horse type problem

Discussion in 'Spigot Plugin Development' started by iO_5, Jul 26, 2018.

  1. 当我多次使用/zuoqi ride命令
    生成的马有时是图片1(白马),有时是图片2(驴)
    怎么办?
    When I use the /zuoqi ride command multiple times
    The spawn horse is sometimes Image1, sometimes Image2.
    How to do?
    Do you see pictures?
    image1:
    [​IMG]
    image2:
    [​IMG]

    Code (Java):

    ...
    ...
    if ( args[0].equals("ride") ) {
                        Entity entity = player.getWorld().spawnEntity(player.getLocation(), EntityType.HORSE);
                        Horse horse = (Horse)entity;
                        horse.setAdult();
                        horse.setColor(Horse.Color.WHITE);
                        horse.setCustomName("§6"+player.getName() + "is ride");
                        horse.setTamed(true);
                        horse.setOwner(player);
                        horse.getInventory().setSaddle(new ItemStack(Material.SADDLE));
                        horse.setNoDamageTicks(Integer.MAX_VALUE);
                        horse.setPassenger(player);
                        player.sendMessage(Main.here.getConfig().getString("showMessage").replaceAll("&", "§"));
                        return true;
                  }
     
     
  2. i don't like weebs. Sorry.
    plus google translate doesn't work.
     
  3. If you relog, does it change anything?
     
  4. same
     
  5. try setting the horse's style
    horse#setStyle
     
  6. Small probability will be:(
    [​IMG]