mirror of
https://github.com/Ne0nx3r0/BetterAlias.git
synced 2025-02-10 00:31:19 +01:00
Added !handItemName and !handItemID
This commit is contained in:
parent
4245aa115e
commit
7749201ef1
10
aliases.yml
10
aliases.yml
@ -26,4 +26,12 @@ gm:
|
||||
0: /gamemode !name !oppositeGameMode
|
||||
# hand all parameters in order
|
||||
s:
|
||||
"*": /say I want to say "!*", there I said it!
|
||||
"*": /say I want to say "!*", there I said it!
|
||||
|
||||
# replaced with the item name in the player's hand
|
||||
hand:
|
||||
0: I have a !handItemName in my hand right now!
|
||||
|
||||
# replace with the item ID in the player's hand
|
||||
handid:
|
||||
0: /give !name !handItemID
|
@ -38,11 +38,15 @@ class BetterAliasPlayerListener implements Listener{
|
||||
|
||||
while(m.find()){
|
||||
String text = m.group(0).substring(1);
|
||||
|
||||
|
||||
if(text.equalsIgnoreCase("*")){
|
||||
text = e.getMessage().replace("/"+cmd[0]+" ","");
|
||||
}else if(text.equalsIgnoreCase("name")){
|
||||
text = player.getName();
|
||||
}else if(text.equalsIgnoreCase("handItemName")){
|
||||
text = player.getItemOnCursor().getType().name();
|
||||
}else if(text.equalsIgnoreCase("handItemID")){
|
||||
text = new Integer(player.getItemInHand().getTypeId()).toString();
|
||||
}else if(text.equalsIgnoreCase("oppositeGameMode")){
|
||||
text = (player.getGameMode() == GameMode.SURVIVAL ? "1" : "0");
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: BetterAlias
|
||||
main: com.gmail.Ne0nx3r0.BetterAlias
|
||||
version: '0.2.1'
|
||||
version: '0.3'
|
||||
database: false
|
||||
description: Command alias system
|
Loading…
Reference in New Issue
Block a user