Thanks! Means a lot :3 edit: @gjossep heres the source: Code:java package me.Corrie.TestPlugin; import java.util.HashSet; import net.minecraft.server.EntityCreature;import net.minecraft.server.Navigation; import org.bukkit.Bukkit;import org.bukkit.Location;import org.bukkit.command.Command;import org.bukkit.command.CommandSender;import org.bukkit.craftbukkit.entity.CraftCreature;import org.bukkit.entity.EntityType;import org.bukkit.entity.Player;import org.bukkit.entity.Zombie;import org.bukkit.event.EventHandler;import org.bukkit.event.Listener;import org.bukkit.event.player.PlayerInteractEvent;import org.bukkit.plugin.java.JavaPlugin; public class TestPlugin extends JavaPlugin implements Listener{HashSet<EntityCreature> mobs = new HashSet<EntityCreature>();public void onDisable(){ }public void onEnable(){Bukkit.getPluginManager().registerEvents(this,this);}@Overridepublic boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){Player player = (Player)sender;Location loc = player.getTargetBlock(null, 100).getLocation();loc.setY(loc.getY()+1);Zombie z = (Zombie) loc.getWorld().spawnCreature(loc, EntityType.ZOMBIE);EntityCreature ec = ((CraftCreature)z).getHandle();mobs.add(ec);return true;}@EventHandlerpublic void oninteract(PlayerInteractEvent event){Location loc = event.getPlayer().getTargetBlock(null, 100).getLocation();loc.setY(loc.getY()+1);for(EntityCreature ec : mobs){Navigation nav = ec.al();nav.a(loc.getX(),loc.getY(),loc.getZ(),1.0f);}} } also, its not really reflection as it is hacky. I misused the term earlier, apologies.
Hm, the potion effect isn't doing anything. Even if I set it to 20000 power, the zombies stay at their original speed! D:
slowness or speed potion effects doesn't affect mobs Her plugin seem to do the trick, with some adjustments though, if i can figure out which libraries she's using :S which is the craftbukkit jar
@CorrieKay Yeah, I can't really understand what she did there. If she could help me finish this little part, I would be very greatful.
Um, sure, ill explain.. But not right now. its like, 1am and im about to head to bed, and its a little more complicated than im willing to explain right this moment x3 Tomorrow!
Corrie explained in a previous thread how to do this: http://forums.bukkit.org/threads/setting-new-direction-for-creatures-to-go-in.74489/#post-1108987
somewhere at the resources section is a way how to hook into the movements of entites, mayby yif you call the entity's move functions 2 times instead of 1 time each tick, it ill move faster
so i'm trying this speed thing. but i can't wrap my head around the creation part of a new mob. this is how i got, but i don't know how to define the location where the zombies are spawning. this is what i got so far: HashSet<EntityCreature> mobs = new HashSet<EntityCreature>(); Location loc = ; loc.setY(loc.getY()+1); Zombie z = (Zombie) loc.getWorld().spawnCreature(loc, EntityType.ZOMBIE); EntityCreature ec = ((CraftCreature)z).getHandle(); Navigation nav = ec.al(); nav.a(loc.getX(),loc.getY(),loc.getZ(),0.5f); @CorrieKay got any tips?
Nono, don't store EntityCreatures in collections, I believe it causes memory leaks because if it is in a chunk the server unloads, the server will try to unload it, but can't. Store UUIDs of Entities instead and then create a method that returns an entity when supplied with a UUID. Then define your EntityCreature and do the navigation stuff.
i know there was something in the resources forum about how to inject custom mobs into the server (not really custom, but classes that like, extends Zombie, or something) I think thats where you need to go, however im not sure where the thread is exactly.
I just wish the minecraft server code wasn't so damn obfuscated so we devs can pick through it easier and actually understand anything it does.
@CorrieKay, think you could explain how you would do that using only the standard bukkit API? I think it could help alot of other also.
http://forums.bukkit.org/threads/tutorial-how-to-customize-the-behaviour-of-a-mob-or-entity.54547/ That is what you were talking about
I did, but actually making it passive (as in, make the server use it when the mob moves, instead of on a command or something via plugin) isnt something i know how to do off the top of my head