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 541 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: Rainbow 1.12 by CodeCrafter47
[September 23, 2017, 06:25:33 PM]


hi guys by DallasHeddY
[September 21, 2017, 06:56:35 PM]


Re: built in SnakeYAML by Fredashay
[September 21, 2017, 06:50:28 PM]


Re: built in SnakeYAML by FabioZumbi12
[September 21, 2017, 03:00:27 PM]


Re: Rainbow 1.12 by CodeCrafter47
[September 21, 2017, 05:12:35 AM]

* Forum Stats

  • stats Total Members: 3606
  • stats Total Posts: 12299
  • stats Total Topics: 1662
  • stats Total Categories: 5
  • stats Total Boards: 16
  • stats Most Online: 568