New to Plugins

Discussion in 'Plugin Development' started by armtutorials, Jul 29, 2016.

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

    armtutorials

    I am new to learning java and have been really interested. I have been having one issue as a rookie to this language and that is how do I have an if statement that is "running" at all times.

    To preface, I am trying to make a plugin that makes aggressive mobs (example: zombies) not be aggressive towards players unless they are attacked. (A mechanic similar to enderman). My problem is that I am new. I have found a few things but still am lacking knowledge. It would be nice if someone could point me in the right direction. I found EntityTargetEvent and EntityTargetLivingEntityEvent while looking around but am not sure how to implement it.

    I don't want to be spoon fed a plugin, I want to learn. It would be appreciated if you could point me in the right direction with a few resources to get me started on this plugin. (Though source code for something likes this would be useful to me, so if you REALLY want to you can post it but otherwise just help me out ;} )

    I found https://mods.curse.com/bukkit-plugins/minecraft/mob-control/766311 which does this but with a command, I basically want to disable mob tracking unless the mob is provoked without a command being enabled. Should I look more into loops or is that totally wrong?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 29, 2016
  2. Offline

    ArsenArsen

  3. Offline

    MarinD99

  4. Offline

    ArsenArsen

    That exists? I did not realize that event is a thing.
     
  5. Offline

    MarinD99

    It exists, but I somehow try and avoid using it. When it comes to actual mob manipulation(setting a specific walk path for an entity, for instance), I somehow prefer to change its PathFinderGoals.
    I deliberately didn't recommend it here, as it can get quite complex at times, and seeing as the user is new to Java, I figured it'd be best to avoid it for now.
     
  6. Offline

    armtutorials

    so essentially I would schedule an event that checks if an entity targets a player and cancels it? If that is correct, how do I cancel events?
     
  7. Offline

    ArsenArsen

    .setCanceled(true)

    http://wiki.bukkit.org/Event_API_Reference
     
  8. Offline

    MarinD99

    @armtutorials Essentially yes. Read up on the JavaDocs link I sent you. I just made a small plugin based on this premise.
     
  9. Offline

    Zombie_Striker

    @kindak
    Do not bring any type of discussion off of the bukkit forums. All discussions should either stay in the thread they started in, or in a new thread in the appropriate forum.
     
Thread Status:
Not open for further replies.

Share This Page