Freezing mobs with command help

Discussion in 'Plugin Development' started by QuipCream, Jan 29, 2014.

Thread Status:
Not open for further replies.
  1. Offline


    Hello, I am here today to ask of you of how I freeze mobs with a command, for instance if you typed /freeze, it would freeze the mob you're looking at. This is the code I got so far. I'm new to bukkit coding so I wouldn't know how to do this.
    import org.bukkit.craftbukkit.v1_5_R2.entity.CraftLivingEntity;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.PluginManager;
    public class RemovePotionParticles extends JavaPlugin {
        public RemovePotionParticles plugin;
        public void onEnable() {
            getLogger().info("RemovePotionParticles is active and ready.");
        public void onDisable() {
        private void startTask() {
            long interval = 4;
                    new removeParticle(), interval, interval);
        private void endTask() {
        private class removeParticle implements Runnable {
            public void run() {
                for (Player player : getServer().getOnlinePlayers()) {
                    ((CraftLivingEntity) p).getHandle().getDataWatcher().watch(7, 0);
  2. Offline


    You actually want to add the command using the code here:
    1. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
    2. if(cmd.getName().equalsIgnoreCase("basic")){ // If the player typed /basic then do the following...
    3. // doSomething
    4. return true;
    5. } //If this has happened the function will return true.
    6. // If this hasn't happened the a value of false will be returned.
    7. return false;
    8. }

    This is just a example, just paste it into Eclipse if this is what your using and use it as a template. If you get stuck just say.

    If you are new to bukkit I would suggest referring to the wiki which is where I copied that from. You can see it Here. Good luck with your plugin pal!
Thread Status:
Not open for further replies.

Share This Page