AdminSword
About
I was given an idea from a friend about a plugin to make that allowed them to fire fireballs, TNT, and lightning from special swords that admins could use. This is the result of that idea.
Video demo by craftbukkittech
Video is of AdminSword v1.1.
Features
Upon activation by admin or privileged player, right-clicking while holding a sword will activate one of 4 different actions:
- launch a fireball
- strike lightning
- create a block of tnt
- teleport player
Admins may also toggle the ability to fly for themselves and others without giving them creative mode, and they can kill other players with a command.
As of AdminSword v1.3 partial player names are supported. You only need to type enough of a target's name for it to be unique.
Commands
/adminsword toggle - Toggles AdminSword for you or a specified target.
/adminsword type - Changes the type of AdminSword for you or someone else.
/adminsword fly - Toggles flight for you or someone else.
/adminsword kill - Kills a specified player.
/adminsword check - Checks whether you or a target has AdminSword enabled and which sword they have.
/adminsword types - List all sword types.
/adminsword help - Displays help pages.
ADMIN ONLY:
/adminsword setdefault [type] - Sets the default sword type in the configuration.
Usage:
/adminsword with no command will attempt to toggle AdminSword on yourself.
/adminsword toggle [target]
Target is optional. If no target is given then the command will be executed on self.
/adminsword type (swordtype) [target]
Swordtype is required. It can be "fireball", "lightning", "tnt", or "teleport".
Target is optional.
/adminsword fly [target]
Target is optional.
/adminsword kill (target)
Target is required.
/adminsword help [page]
Page is optional.
/adminsword types
Permissions
adminsword.* - Grants full access, including the following:
- adminsword.check - Allows you to check if you have AdminSword enabled.
- adminsword.check.other - Allows you to check if someone else has AdminSword enabled.
- adminsword.fly - Allows you to toggle flight for yourself.
- adminsword.fly.other - Allows you to toggle flight on someone else.
- adminsword.kill - Allows you to kill other non-admin players.
- adminsword.kill.force - Allows you to kill any player, admins included.
- adminsword.toggle - Allow you to toggle AdminSword for yourself.
- adminsword.toggle.other - Allows you to toggle AdminSword for others.
- adminsword.type - Allows you to change the type of your AdminSword.
- adminsword.type.other - Allows you to change the type of someone else's AdminSword.
Type permissions:
- adminsword.type.fireball - Allows you to switch to and use fireball.
- adminsword.type.lightning - Allows you to switch to and use lightning.
- adminsword.type.teleport - Allows you to switch to and use teleport.
- adminsword.type.tnt - Allows you to switch to and use tnt.
If a user has one of those permission nodes then they will be able to switch to and use the corresponding type. By default, users will only be able to use the somewhat non-destructive tools after an admin enables it for them. (lightning and teleport)
If an admin would like them to be able to use other types then they must give them access to the right permission node.
Parent nodes:
- adminsword.* - See above.
- adminsword.normal - Allows user to use all tool types. (Sword must be enabled by admin.)
- adminsword.nondestructive - Allows user to use all non-destructive tools. (Sword must be enabled by admin.)
Future Plans
I will add more types and improve the code from time to time as well as keeping it up to date.
I may also add requested features.
Source Code
Source code for this plugin is included in the jar. Feel free to fork this plugin so long as you let people know that I was the original author.
-
View User Profile
-
Send Message
Posted Nov 4, 2013ARe you aloud to send fireballs out of other players
-
View User Profile
-
Send Message
Posted Jul 14, 2013Doesn't Work! it sais: A Internal Error Occured Trying To Do This Command :(
-
View User Profile
-
Send Message
Posted May 16, 2013Having the same issue.
Other Plugins, WorldGuard, WorldBorder, WorldEdit, dynmap.
2013-05-16 18:05:58 [INFO] Mewimi issued server command: /as 2013-05-16 18:05:58 [SEVERE] null org.bukkit.command.CommandException: Unhandled exception executing command 'as' in plugin AdminSword v1.3.2 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:189) at org.bukkit.craftbukkit.v1_5_R3.CraftServer.dispatchCommand(CraftServer.java:523) at net.minecraft.server.v1_5_R3.PlayerConnection.handleCommand(PlayerConnection.java:965) at net.minecraft.server.v1_5_R3.PlayerConnection.chat(PlayerConnection.java:883) at net.minecraft.server.v1_5_R3.PlayerConnection.a(PlayerConnection.java:840) at net.minecraft.server.v1_5_R3.Packet3Chat.handle(Packet3Chat.java:44) at net.minecraft.server.v1_5_R3.NetworkManager.b(NetworkManager.java:292) at net.minecraft.server.v1_5_R3.PlayerConnection.d(PlayerConnection.java:109) at net.minecraft.server.v1_5_R3.ServerConnection.b(SourceFile:35) at net.minecraft.server.v1_5_R3.DedicatedServerConnection.b(SourceFile:30) at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:581) at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:226) at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:477) at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:410) at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573) Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(Unknown Source) at java.util.ArrayList.get(Unknown Source) at java.util.Collections$UnmodifiableList.get(Unknown Source) at com.github.spy1134.adminsword.AdminSwordMain.getAdminSwordType(AdminSwordMain.java:133) at com.github.spy1134.adminsword.AdminSwordMain.toggleAdminSword(AdminSwordMain.java:83) at com.github.spy1134.adminsword.AdminSwordCommands.toggleCommand(AdminSwordCommands.java:176) at com.github.spy1134.adminsword.AdminSwordCommands.onCommand(AdminSwordCommands.java:16) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ... 15 more
-
View User Profile
-
Send Message
Posted May 12, 2013If you think you could make a better video then go ahead. I'm not the greatest when it comes to making videos so I just went with what I had.
-
View User Profile
-
Send Message
Posted May 12, 2013Please make the video for the plugin for yourself or get someone else to do it or I could make a new one the video currently isn't very good also others agree it has 6 likes and 11 dislikes and probably a few of the likes are the maker of the video and his friends
-
View User Profile
-
Send Message
Posted May 10, 2013@ThomasRaud
I've done some looking into the issue and the error is being caused by attempting to save the player's current sword type when you try to activate it or change it with the /as command.
At first I thought the NullPointerException was because you were loading a null defaultAction from your config but there is a fallback to prevent that from happening in my code.
So I looked a little closer and the exception is being thrown by PluginBase.getName() which is called when you attempt to set a metadata value on a player.
Either getDescription() or getName() is throwing the exception, which is strange because the plugin description file (plugin.yml) is present in the build and has the name value set.
In other words, I think the dev team just broke stuff with the later builds. These functions worked fine in previous versions...
-
View User Profile
-
Send Message
Posted May 5, 2013-
View User Profile
-
Send Message
Posted Apr 24, 2013Sorry for the slow response, I've been busy with some other projects.
I took a quick look at the plugin yesterday with the latest beta build of the CB server and everything appeared to be working normally. If you guys are still having issues then I need you to post the errors you're getting in the server console (if any) and give me a more detailed explanation.
-
View User Profile
-
Send Message
Posted Apr 16, 2013Update to 1.5 please, it's broken :(
-
View User Profile
-
Send Message
Posted Mar 22, 2013Is the plugin broken with 1.5? Please update it because I LOVE THIS PLUGIN!
-
View User Profile
-
Send Message
Posted Dec 18, 2012@reno911unlocred
Or you could offer new ideas for how I could make this plugin better rather than sending all of my users elsewhere...
-
View User Profile
-
Send Message
Posted Dec 18, 2012Or you can just use the power tool command as /pt lightning and boom, lightning assigned to the item in hand.... fireballs? no problem! /pt fireball...
-
View User Profile
-
Send Message
Posted Dec 10, 2012@fanboyfan1234
I'll take a look at the plugin later tonight and see if the updates broke it.
EDIT: I took a look at the plugin and it looks fine. It didn't get broken with the latest versions of Bukkit. I did patch it up a little bit though. I'll upload the latest build in a couple of minutes.
-
View User Profile
-
Send Message
Posted Dec 10, 2012are you gonna update the plugin to 1.4?
-
View User Profile
-
Send Message
Posted Nov 7, 2012@Javacow
Why not just instantly kill anyone hit with an admin sword of any type? It could be controlled by permissions as well as a master toggle in the configuration.
-
View User Profile
-
Send Message
Posted Nov 7, 2012Can I suggest that you add a sword type that when you hit a player with a sword and the sword type is enabled, it kills them instantly regardless of pvp settings?
Eg /adminsword type killer
-
View User Profile
-
Send Message
Posted Oct 15, 2012@DarkMoon48
Adding a kill command right now as well as the ability to use partial player names in commands.
EDIT: 1.3 is awaiting approval now. Let me know if you have any other requests.
-
View User Profile
-
Send Message
Posted Oct 6, 2012can u add a deature that admin can kill or give a damage out of pvp
-
View User Profile
-
Send Message
Posted Aug 5, 2012Uploaded 1.2. It's awaiting approval now.
I have updated the front page to reflect changes made in 1.2.
Let me know if you see any errors that I missed.
-
View User Profile
-
Send Message
Posted Jul 27, 2012@arjen1991
I'd rather answer here in the open so everyone can see.
I use a Java IDE called Eclipse to write my code. It's feature filled and can even be run from flash drives and other removable storage.
You can get it from here: http:www.eclipse.org/downloads/
You will want the Eclipse IDE for Java Developers.