Hello everyone, my name is lenis0012 and i am the devlopper of the plugin PvpLevels. And i am here to show you how to use my plugin to modify it using your own plugin. let me first explain how it works, First of all you need to make sure you have the latest PvpLevels jar added as libary (the same way as you did with the bukkit.jar) now, this plugin creates a new class binded to a player to modify its pvp level/amount of kills this how to check a players level once he logs in: Code: @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); PvpPlayer pp = new PvpPlayer(player); int lvl = pp.getLevel(); player.sendMessage(ChatColor.GREEN+"You got level "+String.valueOf(lvl)); } was that really hard?? now to make someone get 1 more level when they right click a button for ex. Code: @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { if(event.getAction() != Action.RIGHT_CLICK_BLOCK) return; Player player = event.getPlayer(); Block block = event.getClickedBlock(); if(block.getType() == Material.BUTTON) { PvpPlayer pp = new PvpPlayer(player); int lvl = pp.getLevel(); pp.setLevel(lvl + 1); player.sendMessage(ChatColor.GREEN+"You are now lvl "+String.valueOf(lvl + 1)); } } so to get the player as a PvpPlayer all you have to do is: PvpPlayer pp = new PvpPlayer(player); and then you can use it. Check BukkitDev for source code and download Updated for PvpLevels v0.2.1 EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Im sorry for all my spelling, i am not english and i type faster than my fingers can handle sometimes
It's no problem, I just fixed it up because I was bored in school You've accomplished more than I have as far as learning languages anyway
Its just 1 class, you can easily use eclipse to see all possible functions. And if thats nto enough you can look it up at github I know that its common for api's to have it but this is a little side project, not a massive plugin made for people to depend on.
lenis0012 Even so, i have a small resources repo on github (link) and i tend to document everything (and when i don't i usually do it later when im done writing the class) because doing so explains what each thing does without having to actually look at the code of a single method. Its simple, easy to do and efficient. Without JavaDocs expect people to ask many questions about how to use your API and also expect people to not use your API as much as compared to making their own (I know i would choose to create my own if i was given the option between my own api vs yours)
Goblom Nice javadocs: https://github.com/Goblom/GameAPI/blob/master/src/main/java/org/goblom/gameapi/data/Arena.java Listen, if you dont agree with me then dont comment at all please. I created this place a while ago to show people how to easily check & set player's levels. I did not find it necesarry to recreate javadocs for this. The function are self-explaining and clearly not hard to use at all. I wish you a good day.