Need help starting a plugin

Discussion in 'Plugin Development' started by LukeZaz, Feb 9, 2011.

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

    LukeZaz

    Hi, i'm new to Bukkit Plugin Development, Using samkio's Basic tutorial i've created a small successful plugin but this is as far as i've gone,

    On the old HMOD forums i had one plugin i needed to develop, I'm not doing that here, But i've got another large plugin i want to develop, And i don't really know how to start,

    I play the MMORPG game Rift, where a world called Telara is under seige by multiple different Rifts, each one different, What i want to do is make a sort-of Rift plugin for Bukkit, I don't know if its possible yet but i still want to try and start,


    Like rift there will be factions, Each one will be based on already-existing mobs to simplify it, The sides will be:
    Zombies
    Skeletons
    Creepers

    Each faction will have certain mobs that are associated with it:
    Zombies:

    • Zombies [zombie]
    Skeletons:
    • Skeletons [skeleton]
    • Spiders [spider]
    • (LATER VERSIONS) Jockeys (Skeletons riding Spiders)
    Creepers:
    • Creepers [creeper]
    Each faction will possibly in later versions have more mobs,
    Each faction will attack each other, or help others of its own kind (Creepers help mobs in the Creeper Faction, but attack mobs like Skeletons who are in the Skeleton Faction)
    Each faction will spawn occasionally on the map, And will keep that area, Eventually spawning more mobs which go around to a random place and build a Foothold, which spawns more mobs, but slowly, Footholds can be destroyed,

    Right now, all i want to do is make current mobs of one faction attack other mobs of other factions, Basically make the zombies attack skeletons spiders & creepers and skeletons/spiders kill zombies and creepers etc

    How would i start this?
     
  2. Offline

    Slayer9x9

    Sounds like you want to use the Creature.setTarget method found in craftbukkit.jar build 292+
    http://bamboo.lukegb.com/browse/BUKKIT-CRAFTBUKKIT-292

    My suggestion (ub3r sudo-code :p):
    1) When a mob spawns (and when the particular mob moves) check a radius for any other mob.

    2) If the found mob matches a specified mob (i.e. settings file, etc...), perform the Creature.setTarget (using the appropriate type casting)

    3) From here, the mob should start attacking the mob

    --if you dont want the mobs to target players:
    4) Somewhere, perform a check to see if the target is a player - if so null the target and perform another check (excluding detection of a player)


    Not sure if would work at all, but it's a start.
     
  3. Offline

    LukeZaz

    I don't really know how to do 3.5/4 of that,

    1.If there is one, Wheres the JavaDocs for Bukkit so i can see a list of events?
    2.How do i check a radius for a certain mob?
    3.How do i use Creature.setTarget?
    4.How do i make the mob attack?
    5.How would i make the mob not attack certain mobs (i'd prefer to start with zombies as a start, make them attack other non-zombies.)

    Also i still want them to attack players so i don't have a question on 4) :p

    Appreciating the reply weather i understood it or not, So thanks :D
     
  4. Offline

    Plague

  5. Offline

    LukeZaz

    Thanks, But where should i look among that for what i'm looking to do?
    --- merged: Feb 11, 2011 3:50 PM ---
    Bumping...Its been a day and i've received no reply.

    I don't intend to annoy anybody here, But can someone please help me out here?
    --- merged: Feb 12, 2011 1:57 AM ---
    Bumping again... Please reply!
     
  6. Offline

    retsrif

    Well, check the javadocs for LivingEntity or Creature. For the radius, you can get the location of that mob, and then basically check for a mob a specific amount from that location. For setTarget, check the javadocs :), and to make it attack, check the docs. If you want it to attack certain mobs, then you just have to let it check the radius, then check if there's a mob, then if there's a mob of that type you want it to attack, and set it to attack.
     
  7. Offline

    Plague

    Heh, I did read all the bumps, but the only answer was the same as resrif's, so I never posted anything... Read the docs, I never used those functions.
     
Thread Status:
Not open for further replies.

Share This Page