Member
Level 1
New Explorer
0

Forum Posts

1 - 5 of 5

    RedFocus
    06/29/2015 7:17 am
    Level 1 : New Explorer
    www.planetdatecraft.com

    where do i sign up?
    1
    RedFocus
    06/28/2015 11:10 pm
    Level 1 : New Explorer
    Hey so I don't make too many plugins but I know java and I've done a couple of plugins so hopefully I can help. To do what you want, you basically have to make a event handler(my terminology might not be exact) so the plugin listens for what the player is saying and executes something on that event. I'll give you an example of a test program I made when trying to understand this stuff. Basically I wanted to make a plugin that played a donkey noise anytime someone in the chat said the word "jerk" so here's the example:

    This is so it'll enable itself which you've probably seen:
    public class DonkeySounds extends JavaPlugin{

    @Override
    public void onEnable(){

    new DonkeyListener(this);

    }

    }


    And this is the event handler:
    public class DonkeyListener implements Listener{


    public DonkeyListener(DonkeySounds donkeySounds)
    {
    donkeySounds.getServer().getPluginManager().registerEvents(this, donkeySounds);
    }

    @EventHandler
    public void blank(AsyncPlayerChatEvent event)
    {

    String message = event.getMessage();
    for(int x = 0; x < message.length()-3; x++)
    {
    if(message.charAt(x) == 'j' && message.charAt(x+1) == 'e' && message.charAt(x+2) == 'r' && message.charAt(x+3) == 'k')
    {
    for(Player players : Bukkit.getOnlinePlayers())
    Bukkit.getWorld("world").playSound(players.getLocation(), Sound.DONKEY_IDLE, 10, 1);
    }
    }
    }

    }

    if(message.charAt(x) == 'j' && message.charAt(x+1) == 'e' && message.charAt(x+2) == 'r' && message.charAt(x+3) == 'k')
    ^ That line right there makes it happen for me but there's probably a simpler way, but at the time I just made it like that. You could probably do if(message.equals("your message")) because it seems you just want to say something specific. As for the healing part my plugin doesn't do that but if you look through some things you can figure out how to find the sender of the message and heal that player. If you have any more issues or you're not fantastic at java you can message me or something and I can try my best to help out(not saying I can 100% solve the your problem but I can push you in the direction of a better source maybe).
    1
    RedFocus
    10/12/2014 9:40 am
    Level 1 : New Explorer
    Planes are pretty cool but flying elephants are cooler.
    2
    RedFocus
    05/01/2014 11:00 pm
    Level 1 : New Explorer
    When you say a simulator where you can do anything the possibilities are endless, that's like saying you're gonna recreate all of earth and life in a game, which isn't exactly possible and would require so much information your computer couldn't even hold it. You need to be sort of specific you can't just make a vague game which doesn't have a direction. Every simulator has a direction, like you're a surgeon in surgeon simulator or your a goat in goat simulator but you can't be a surgeon and then switch to being a goat the next day in the same game, that would mean you need to program everything for a surgeon and then you need to program everything for the goat so your game just keeps getting larger until it's too large. Those billions of possibilities you say require alot of programming. Though not to discourage you, it's a great idea it just needs more of a direction.
    1
    RedFocus
    11/01/2012 4:23 pm
    Level 1 : New Explorer
    im getting this too i just found out a few minutes ago this is strange i never got this, guys try to delete your history and cookies ive done that befor and then it didnt show up again one time (and it is happening on chrome).
    1

1 - 5 of 5

Welcome