Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

collapse

Author Topic: As I change a player 's gamemode ?  (Read 486 times)

xXlMisticXx

  • Member

  • Offline
  • *

  • 10
  • Reputation:
    +2/-0
  • Personal Text
    Hi :D !
    • View Profile
    • STAGG PROYECT
As I change a player 's gamemode ?
« on: November 21, 2014, 10:03:34 PM »
Hi, I 'm working on a plugin (obviously :) ) and I was wondering how to change the game mode of a player without having to resort to using ExecuteCommand ();

Thanks in advance.  :D :D :D

BillyGalbreath

  • Plug-in Maker
  • Hero Member

  • Offline
  • ****

  • 854
  • Reputation:
    +136/-8
  • Personal Text
    Plugin Developer
    • View Profile
    • Pl3x
Re: As I change a player 's gamemode ?
« Reply #1 on: November 21, 2014, 10:18:11 PM »
MC_Player.setGameMode(MC_GameMode);

Would have answered this in IRC if you would have stayed on longer than 2 minutes...
-Billy

I have moved over to the Spigot 1.8 project. \o/

xXlMisticXx

  • Member

  • Offline
  • *

  • 10
  • Reputation:
    +2/-0
  • Personal Text
    Hi :D !
    • View Profile
    • STAGG PROYECT
Re: As I change a player 's gamemode ?
« Reply #2 on: November 21, 2014, 10:24:43 PM »
But MC_GameMode it's a integer or something like that ?

BillyGalbreath

  • Plug-in Maker
  • Hero Member

  • Offline
  • ****

  • 854
  • Reputation:
    +136/-8
  • Personal Text
    Plugin Developer
    • View Profile
    • Pl3x
Re: As I change a player 's gamemode ?
« Reply #3 on: November 21, 2014, 10:27:04 PM »
MC_GameMode is an enumeration.

example:

Code: [Select]
player.setGameMode(MC_GameMode.SURVIVAL);
-Billy

I have moved over to the Spigot 1.8 project. \o/

 

* Notifications

* Member Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Recent Topics

Re: Shared Packages - A tool for new plugin developers by JD9999
[May 20, 2017, 05:08:08 PM]


Re: Shared Packages - A tool for new plugin developers by JD9999
[May 16, 2017, 01:51:08 AM]


Re: Is anyone else still here? by Fredashay
[May 14, 2017, 06:46:02 PM]


Re: Is anyone else still here? by BlackScorpion
[May 14, 2017, 01:31:03 PM]


Re: Is anyone else still here? by JD9999
[May 14, 2017, 12:21:09 AM]

* Forum Stats

  • stats Total Members: 3566
  • stats Total Posts: 12246
  • stats Total Topics: 1649
  • stats Total Categories: 5
  • stats Total Boards: 16
  • stats Most Online: 568