MyCommand
MyCommand
Donations
If you like this plugin, and want to offer me a coffee, consider to click the button on the top right corner of the navbar to donate! Thank you :D
Make your own, customized Minecraft commands
Features:
- Make new commands!. (Also registered command)
- Run others command in new one
- Perform several commands in one
- Delayed commands with custom pause, warmups and cooldowns
- Make Shortcut/alias commands or override commands.
- Run commands with any item , block, signs or even (villager) NPC's.
- Various functions for costumize commands, like placeholders, scripts (if-else) and more.
- Console support
- Economy support (Require Vault)
- All features are highly customizable
- No command limits with multiple file support
- Customizable IconMenu (ChestGUI), ActionBar, BossBar, Hover/ClickableText, Title and Scoreboard commands.
- Allow the execution of commands in various circumstances (per world, by worldguard regions and more.
- Custom players database where you can store anything you want to personalize even more your commands. SQL database supported.
- BungeeCord feature, Scheduler, Join/Quit/Death events, PHP/GET request ...
- ... And much, much more..!
Configuration and examples (Documentation)
Commands & permissions
Video Tutorial :
(French) Getting Started (TEXT and ALIAS commands) by Texier (MyCommand 5.5.0)
(English) by Koz4Christ. (MyCommand 5.1.8)
If you have to report an error in the chat, or just a command section, use pastebin or a similar website. Help with YML code error : http://yaml-online-parser.appspot.com/
This plugin uses bStats Metrics - MyCommand stats page
Hello,
Would you like to tell me how to run command if playerdata 'EXAMPLEPLAYERDATA' not exist? Is there script for this?
In reply to Forge_User_49644732:
If something doesn't exist it should return with "NoData" by default. So, just make an if condition to check if "EXAMPLEPLAYERDATA==NoData", then: ...
In reply to ivanfromitaly:
command: /foo.start.stats.command
type: RUN_COMMAND
execute_mode: EVENT_ONLY
runcmd:
- '$Script$%if%$PlayerData%money%==NoData'
- '$log$NO DATA!'
- '$Script$%PlayerData%money=0'
- '$Script$%if%$PlayerData%money%==0'
- '$log$0!'
- '$Script$%if%$PlayerData%money%>0'
- '$log$0+!'
permission-required: false
If 'money' in playerdata.yml = 0 (read. money: 0) then I see '0' in console.
That mean command is correct but first condition not.
In reply to Forge_User_49644732:
If money isn't in playerdata, it returns NoData as i said. Your script works, you just need to use elseif on the other condition, otherwise they run aswell. If you set money to 0, and then there is the condition "if money == 0" the plugin run that aswell. with elseif instead, only one condition get executed.
I have a problem with SCOREBOARD on mycommand version 5.5.1 which is where SCOREBOARD is not running at all even though I have copied the example on this Page
This My Custom Command SCOREBOARD .yml
ERROR MESSAGE ( CONSOLE )
Sorry For My Bad speaking , I'm From Indonesia
Hi there.
mycmd-itemset Placeholders: $targetentity
use it, the command will be executed twice. why?
itemset:
testlist:
STONE_SWORD:
on_rightclick: $targetentitye
→ <playername>
<playername>
In reply to k_clock:
Fixed in the next release.
Is there a way to simply get another player variables? (like $player, $locX , $locY , $locZ, $world, $level and everything else)
I want to create a command to calculate how far the player is from another.
So I want to get $locX from the guy who executes the command and the $locX from the target
Cheers
In reply to Forge_User_80075269:
If the other player is online, you can use this one :
$GetPlayerByName%playername%
Otherwise with MyCommand built-in placeholder you can't do that on offline one's. There is Parse Other addon for PAPI for that.
Anyway, $GetPlayerByName%playername% :
But yeah, i've read better now what you want to do, and i can't confirm you if $GetPlayerByName%playername% works also on rucmd Script without problems. "$GetPlayerByName%playername%" needs to be before anything, maybe even before the $Script$ placeholder. I have to test for myself first lol.
Hi ivan
I have an issue with this code https://pastebin.com/Bkaq2TuT
I'm trying to execute this specific command on player logout/quit.
But it seems HasPermission doesn't work on quit
I use Authme to handle events, I have another command on login which works fine ( https://pastebin.com/EuYj3Ntg ). This one works on /logout command (player is still online), but doesn't work when player quit the game
FYI, the goal of my scripts is to enable a bonus command, once a day when user has played 30 minutes (Also, if you have a better way to do what I want, please tell me :) )
So I add a permission during 30 min after first login of the day to deny to use another command. After this time, permission is unset and player is able to use the command. Except if player logout during the 30 min, in this case everything is canceled and need to be executed again on the next login.
I'm not sure if it's HasPermission or if I made something wrong.
I tried with Mycmd playerevents itself, but nothing happens when player quits :o (extra listener is enable)
Thanks in advance for your precious help
EDIT: I have also some ideas about time variables, i will do another comment
In reply to Forge_User_80075269:
Don't know what to say, for what i've tested, your commands works. with permission-required: true and permission-required: false. And also with HasPermission==mycommand.cmd.bonus.locked and without the permission (in order of what i have the result's are ok). Tested with PEX and the playerevents.yml. PS playerevents needs a server restart. If you done that, Authme probably override everything. Maybe it's something related to authme who remove all the player permissions before the time? I can't do much, even so, if authme can handle those events before he close everything, it should works.
In reply to ivanfromitaly:
I think there is an issue from Authme side, i will report it.
Also, I didn't restarted after edited playerevents file, so I tried again and it works now.
However, an error occured when command is typed (just after logout) https://pastebin.com/8q86fahE
Then, command is executed.
Is an issue from my config, from your side or from VentureChat side?
I use VentureChat 2.16.0, PAPI 2.10.3 and MyCommand 5.5.1 (Spigot 1.13.2 b2148)
In reply to Forge_User_80075269:
Also, could you confirm to me this code is able to work? I want to allow player only if he doesn't have the perm
Because, I think that doesn't work in my code (player is able to bypass, even if he has a temporary permission)
But the == works fine
In reply to Forge_User_80075269:
the != line doesn't exist in my plugin, that's why. If something is wrong it returns always false. Anyway, invert the 2 condition if you need that, put in the else what is inside the if and viceversa. Anyway, != is not equals, and with permissions i can't see how it can work, what you need is a "!HasPermission==p", but isn't there.
In reply to ivanfromitaly:
That's why! Thanks for these informations. Could you add the !HasPermission ?
Also I think you missed it, I have an error, I write it again:
Also, I didn't restarted after edited playerevents file, so I tried again and it works now.
However, an error occured when command is typed (just after logout) https://pastebin.com/8q86fahE
Then, command is executed.
Is an issue from my config, from your side or from VentureChat side?
I use VentureChat 2.16.0, PAPI 2.10.3 and MyCommand 5.5.1 (Spigot 1.13.2 b2148
In reply to Forge_User_80075269:
I can't tell what's the problem there. VentureChat want to access to something who isn't here anymore i guess, and if this happen on the logout, it's because the player isn't here anymore. Probably, Authme is the cause, because it locks out everything when someone get out from the server. You can try locally if without authme the error is still here, or just pur the server in online mode just for the test, and disable temporarily authme. If it's authme i can't help you anyway lol.
In reply to ivanfromitaly:
I switch to Mycmd itself for the logout/quit, so I don't think Authme is the cause. But I could try without authme
In reply to ivanfromitaly:
I can confirm, Authme isn't the problem here
Tried without Authme: https://pastebin.com/TTubbMij
It's my config (https://pastebin.com/SkUxZrWf), VentureChat or MyCmd side :)
In reply to Forge_User_80075269:
When i have time i will try to replicate the error, anyway, i repeat, he error start from VentureChat, i can see if i can do something, probably not. I'll see.
In reply to Forge_User_80075269:
I've tested it, and the error seems to happen always after mycommand performed the command. There is something going on with the chat system who cause that. MyCommand execute commands as chat message in various place to make it working also non registered commands. In this case, when the player quit something happen to VentureChat side, i can't tell what.
A solution i found is to make my plugin run only registered command from the event, in that way VentureChat seems to be ok.
To do so, place "$PERFORM_COMMAND$" before the command and you'll be fine.
download the latest dev version to test it, if you want.