I have few questions 1. How to get location where I am looking to spawn something screenshot (Move your mouse to reveal the content) screenshot (open) screenshot (close) I tryed this but didn't work: Code: p.getEyeLocation().getBlock().getLocation() 2. Question PlayerInteractEvent with Mob_egg. How to disable spawning of mob. When I click egg its spawn 2 mobs. How to remove original one. 3. Question How to add to horse saddle. And is there anyway to follow you with setting horse.Owner(player) or horse.setTarget(p) or do I need to use other method. Edit: Ok I know answer to 1.st question. I used this e.getClickedBlock().getLocation()
Everything is working thansk. Only 3rd question I want to set so the pet is following to owner and add saddle to it.(horse.setequipment don't work I think)
Code:java horse.setTarget(livingEntity);horse.getInventory().setSaddle(new ItemStack(Material.SADDLE));
I set it Code: horse.setTarget(p); but its not working. and another problem I set like this Code: horse.setColor(Color.BROWN); but horse is sometimes spawns as donkey
@bronzzze Do you know what casting is? And if you're using a development kit, you should be able to scroll through all the methods that you horse. contains (which should have a .setType or something like that in there)
Ty. Sorry beacuse I am so annoying is this correct Code: LivingEntity le = (LivingEntity)p; horse.setTarget(le);
I tryed it and didn't work I tryed to add this too: Code: Player p = e.getPlayer(); LivingEntity le = (LivingEntity)p; AnimalTamer at = (AnimalTamer) p; horse.setTarget(le); horse.setTamed(true); horse.setOwner(at);
Try debugging. Make a method that sends a player a message or that uses System.out.println(); Have it print out the getTarget,the getOwner ect.
Player class extends HumanEntity, which extends LivingEntity. So a Player is actually a LivingEntity. Try this to make the horse follow the player: http://bukkit.org/threads/make-a-mob-follow-a-player.351739
@FisheyLP I used this method And got this error: Code: 14:31:01] [Server thread/WARN]: [Bantha] Task #2 for Bantha v1.0 generated an exception java.lang.NoClassDefFoundError: org/bukkit/craftbukkit/v1_7_R4/entity/CraftEntity at me.bronzzze.pets.EggClickEvent$1.run(EggClickEvent.java:91) ~[?:?] at org.bukkit.craftbukkit.v1_8_R1.scheduler.CraftTask.run(CraftTask.java:53) ~[craftbukkit-1.8.jar:git-Bukkit-e87122e] at org.bukkit.craftbukkit.v1_8_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:349) [craftbukkit-1.8.jar:git-Bukkit-e87122e] at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:653) [craftbukkit-1.8.jar:git-Bukkit-e87122e] at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:284) [craftbukkit-1.8.jar:git-Bukkit-e87122e] at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:598) [craftbukkit-1.8.jar:git-Bukkit-e87122e] at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:506) [craftbukkit-1.8.jar:git-Bukkit-e87122e] at java.lang.Thread.run(Unknown Source) [?:1.7.0_75] I guess problem is I used in code import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; and server is v1.8 spigot Edit: Line 91 is Code: ((EntityInsentient) ((CraftEntity) e).getHandle()).getNavigation().a(p.getLocation().getX(), p.getLocation().getY(), p.getLocation().getZ(), f);