Make a player execute a Command

Discussion in 'Plugin Development' started by twinflyer, Oct 16, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    twinflyer

    Hey guys,
    I'm quite new to Java and Bukkit-Plugins.
    Untill now I have programmed a little Plugin to use "/gm 1" or "/gm 0" to change your gamemode.
    I want to programm Plugins, which are special designed for our server. To make things easyer.

    For that I need a solution to make a user use a Command.
    For example:

    player.executeCmd("/gm 1");

    Is it that easy, or what do I have to do?

    twinflyer
     
  2. Offline

    coldandtired

    You can just do player.chat("/gm 1");
     
  3. Offline

    twinflyer

    thaks :D
    hoped that it is that easy :D
     
  4. You should rather use player.performCommand("gm 1").
    I've no idea what the actual difference is, but when there is a special method for something, why not use it?
     
  5. Offline

    twinflyer

    didn't know that this funktion exists :p
    but you're right. I'll use player.performCommand :D
     
Thread Status:
Not open for further replies.

Share This Page