1
Hey everyone, I've been attempting to make a cellphone mod for the past few days for my friends server, and got all the achievements recipes values etc all finished, but I need help with a command. I'm using mcreator to make this mod, and I'm trying to make a GUI that opens when you use the phone (which I've already done) but I'm trying to add a button that basically, when you input the player name in this GUI of the person you want to send a message to, it will run the /msg {player} or /whisper {player} along with the message to what ever name is put for the {player} value. Thing is I can a button that can run the msg or whisper command, but I can't figure out how to add a text box that when you put the name of the player and message text, will send that with the command. Is there maybe a mod or plug in with a, for example, /set bestfriend playername command, so when you do let's say /set bestfriend jalen1563, will allow you to do /msg bestfriend and will send the message to whoever you have set as "bestfriend" so there wouldn't have to be aNY input needed, the button in the cellphone GUI would simply run /msg bestfriend. But than you would still need a box to put the message text in. Anyone know the string of code that could be put on as a button, how to add text boxes to the GUI (not necessarily in mcreator, I still have some degree of coding knowledge) or a plug in that can do a command like the best friend command, but you would still need the text box. A fast reply would be helpful, thanks
6
Thank you! But some how the command block GUI allows typing doesn't? So there must be some way to do this. But could you tell me more about the chat switching? That sounds like it would work. Then there could be a second button that switches you back to normal chat when your done.
I don't know much about mods but you could use a vanilla anvil/renaming...
So I did a little bit of research and found out that you can't have a GUI that you can type in. I think the only way you could do is just by talking normally or whenever you hit the "text" button so to speak, it turns your chat into a PhoneNumber1 - PhoneNumber2 chat which only you two can see. Other than that I don't believe you can do what you are requesting to do.
Could you tell me more about that? You can Skype me at jalen1562
It's really just if's and for loops. Such as
HashMap<UUID, UUID> phoneCallers = new HashMap<UUID, UUID>();
Then to add them it'd be like
phoneCallers.put(player.getUniqueId(), target.getUniqueId());
Then player chat events. Check if the player is in the phoneCallers and if they are then get the value of the key and send them a message.
If you aren't really looking to code and just want a plugin give this a look:
http://dev.bukkit.org/bukkit-plugins/playerchat/
HashMap<UUID, UUID> phoneCallers = new HashMap<UUID, UUID>();
Then to add them it'd be like
phoneCallers.put(player.getUniqueId(), target.getUniqueId());
Then player chat events. Check if the player is in the phoneCallers and if they are then get the value of the key and send them a message.
If you aren't really looking to code and just want a plugin give this a look:
http://dev.bukkit.org/bukkit-plugins/playerchat/
Would you be able to send me a full finished code string for it? I don't want to use a plugin because I want to make it exclusive to the phones, not something you can also do in game
