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 556 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: MCPublic -- Free server hosting by Reinert
[November 07, 2017, 06:53:51 AM]


Re: How does onPlayerDeath work? by JD9999
[October 04, 2017, 03:30:31 PM]


Re: How does onPlayerDeath work? by CodeCrafter47
[October 04, 2017, 04:53:08 AM]


How does onPlayerDeath work? by JD9999
[October 03, 2017, 07:58:47 PM]

* Forum Stats

  • stats Total Members: 3682
  • stats Total Posts: 12304
  • stats Total Topics: 1663
  • stats Total Categories: 5
  • stats Total Boards: 16
  • stats Most Online: 568