Building Minecraft Server Modifications
上QQ阅读APP看书,第一时间看更新

Exploring Bukkit API

Now that you are familiar with the Bukkit API documentation, I advise you to look through more of it on your own. You will find interesting methods, many of which will spark ideas for cool plugins that you may want to make. Take note that there may be additional links to view more methods for an object. For example, a player is a type of entity, therefore you can call any entity method on a player object. This inheritance is shown after the following method list:

If you are ever going to try and think up an idea for a plugin, browsing through the following websites is sure to give you some ideas. I suggest reading the class pages listed as follows as they will be classes that you will frequently use in your future plugins:

The following are a few challenges to guide you while exploring the Bukkit API on your own and becoming familiar with it:

  • Which method would you call to check what time it is in a world?
  • Which methods would you call to get the block that is at x:20 y:64 z:14 in the world that is named "world"?
  • Which methods would you call to send a message to the player whose name is Steve?
  • Which methods would you call to check if the material of a block is flammable?
  • Which method would you call to check if a player has any diamonds in their inventory?
  • Which methods would you call to check if a player is holding an item that is edible?