Ok so I am having some problems, I have googled and seached these forums to no end trying to find how to award all the players on a scroreboard team XP. I have gotten the scource code for the annihilation plugin and have made a sound addon to that but really need the XP part so please let me know if you don't mind. Thanks and like always any help would be awesome!! -wxwsk8er
wxwsk8er I have never played on shotbow, so I have no clue what the "XP" thing is, mind taking a pic or explaining better?
Ok @nikea. Basicly there are four teams, each with a diffirent color, Blue, Green, Red, and Yellow. When you join you goto a lobby and select your team. And when the match starts you are in your teams base. There is a block of end stone and when mined your team loses a life (teams start with 75 lives) and plays a sound. The team who the player who mined the endstone should recieve 2xp for every player. The last team out or out of life wins. (If you want to play the ip is: US.SHOTBOW.NET and look for the big A ). Avery246813579 there is so much code and spread through a ton of files so I cant post all of it on here. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Do you mean the XP bar or Shotbow's "XP" system which is a global currency used on their servers? Either way I'm not going to help you steal other people's custom gamemodes, but they're two very different things.
garrison / Garris0n I am not trying to steal there gamemodes, there plugin just wasnt built right for my system, I am just trying to make a plugin for my server. And no I just mean XP in general.
There are a few XP-related methods in Player, look here. As a tip for next time, google search your problems and look at the JavaDocs. Also, when you say you "got the source code" for an Annihilation plugin, what exactly do you mean?
Well you can download the annihilation mini game plugin from bukkit then use a archiver to un-jar it, Simple just look in the .class files. Next I don't know how to use java docs. And I have been googling all day.
Actually, you also have to decompile the class files. Java docs are pretty straightforward… you just search what you want and look at the methods. It's standard OOP. But here are the methods if you don't want to look through the Java docs: There's a Player.getLevel(), Player.setLevel(int x), Player.getExp(), Player.setExp(float x). You can use those.
He can't copy code, but is there anything preventing from looking at it and seeing which methods it calls? A genuine question because I don't actually know.
He's trying to modify it and make his own version for his own use as far as I can see. I believe that goes against his license. He can look at it all he wants, though, as far as I know. I mean, there's nothing physical stopping him, but I don't believe a license can say "you can't decompile that". I don't know, ask a lawyer
Yep as for copying the code I didn't really do that that . Instead of copying it I looked at how the basic structure of the annihilation game was coded such as: onNexusDestroy(), onNexusHurt(), onTeamJoin() .... And then coded my own version of these. Then searched these forums for getting and paying sound, setting up a scoreboard team, and just this one giving xp. Thanks for your @helpmorshu9001 and one more question to ya'll can you help me make items shoot snowballs? Hard time with that
wxwsk8er You can listen for PlayerInteractEvent, check if it's a right click, check if it's your item you want to shoot out snowballs, then spawn a snowball with velocity (Or I think it'll just drop to the ground).
Sorry guys I have been out for a while.. anyway so would this code work? Code:java int playerXp = Player.getExp();int NewXp = playerXP + 2;setExp(NewXp); Ok so heres my snowball code but yet it doesn't work!! Can someone tell me what im doing wrong? Code:java package net.wxwsk8er.guns;import org.bukkit.Material;import org.bukkit.event.EventHandler;import org.bukkit.event.block.Action;import org.bukkit.event.player.PlayerInteractEvent;import org.bukkit.entity.Snowball;import org.bukkit.inventory.ItemStack;import org.bukkit.inventory.meta.ItemMeta;import org.bukkit.plugin.java.JavaPlugin; public final class Main extends JavaPlugin { @EventHandler public void onInteract(PlayerInteractEvent e) { ItemStack woodHoe = new ItemStack(Material.WOOD_HOE, 1); ItemMeta woodMeta = (ItemMeta) woodHoe.getItemMeta(); if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) { if(e.getPlayer().getItemInHand().getType() == Material.WOOD_HOE) { e.getPlayer().launchProjectile(Snowball.class); return; }else{ return; } } } } EDIT by Moderator: merged posts, please use the edit button instead of double posting.
You need to register your command for example More infos on how to make an actuall Plugin can be found here http://wiki.bukkit.org/Plugin_Tutorial
Ok @Leeman1234 one thing though I have read that and made my own plugin before but this one doesn't use commands. But are you saying I need to use them? Thanks for your help