I’m just wondering if gamemode implementation has been added yet. I searched the github issues for gamemode related issues, and there appears to be none. I believe the following should work, however when I run it in game on a valid player, nothing happens. Does this mean it’s just not implemented, or am I doing something wrong?
If you programmed with Bukkit you should have encountered it with setting metadata: item.setItemMeta(metaYouJustGotThenModifiedAndNowAreSetting);
(Although I’ve never confirmed that the retrieved meta is actually a copy so I may be wrong, although then the setter would be redundant so It’s not as bad to assume it was similar to the above concept).
The Data API can have a pretty steep learning curve, since it’s quite different (and much more powerful) than how Bukkit worekd.
It’s currently undergoing a rewrite. Once the changes land, the docs will be updated for the new changes. It’ll become much easier to get started using it.
Now that the DataAPI has been updated, what would changing a gamemode look like? I don’t really understand how it works now. Can anyone clear up some confusion? @Aaron1011@wingz@zml
I’ve been looking for a while, but the only routes I see require something along the lines of Keys.GameMode, which doesn’t exist…
It’s either or. You can still retrieve the GameModeData and offer it back to the player.
Please don’t necro old threads in the future Otherwise, the docs have some good documentation on how to do this and the comparison of using the manipulator versus using keys. It’s frequent to just use keys these days as setting simple things, but when complex things need to be processed, can use a manipulator (especially if for example you’re transforming like a schematic).