官术网_书友最值得收藏!

Navigating through the Bukkit API documentation

We can go through the Bukkit API documentation to get a general idea of what we can modify on a Spigot server. Server-side plugins are different from client-side mods in that we are limited with what we are able to modify in the game using server-side plugins. For example, we cannot create a new type of block, but we can make lava blocks rain from the sky. We cannot make zombies look and sound like dinosaurs, but we can put a zombie on a leash, change its name to Fido, and have it not burn in the daylight. For the most part, you cannot change the visual aspect of the game, but you can change how it functions. This ensures that everyone who connects to the server with a standard Minecraft client will have the same experience.

For some more examples on what we can do, let's have a look at the various pages of the API's documentation:

You will see that the classes and interfaces within the API are selectable in the lower left section of the Javadoc. Selecting a package in the upper left narrows the choices in the section below it. Each type, such as a class or interface, is organized into a package. These packages help group similar classes together. For example, Cow, Player, and Zombie are all types of entities and thus can be found in the org.bukkit.entity package. So, if I were to say that the World interface can be found at org.bukkit.World, then you will know that you can find World within the org.bukkit package. Knowing this will help you find the classes or interfaces that you are looking for. You can always use Ctrl + F to search for a specific word on the webpage. This can help in finding a specific class in a long list.

Let's look at the World class and see what it has to offer. The classes are listed in alphabetical order. So, we will find World near the end of the list within the org.bukkit package. When you click on the World class link, all of its methods will be displayed in the main column of the site under the Method Summary header, as shown in the following screenshot:

A World object is an entire world on your server. By default, a Minecraft server has multiple worlds, including the main world, nether world, and end world. Spigot even allows you to add additional worlds. The methods that are listed in the World class can be applied to the specific world object. For example, the Bukkit.getWorlds method will give you a list of all the worlds that are on the server; each one is unique. Therefore, if you call the getName method on the first world, it may return world while, calling the same method on the second world may return world_nether.

主站蜘蛛池模板: 连城县| 缙云县| 修武县| 青神县| 开鲁县| 柘荣县| 眉山市| 克拉玛依市| 谢通门县| 东丽区| 兰西县| 漳平市| 囊谦县| 桦甸市| 菏泽市| 湘潭市| 陕西省| 鹰潭市| 建德市| 鄯善县| 灵武市| 黔江区| 乌什县| 通渭县| 高阳县| 兴安盟| 乌拉特后旗| 滨州市| 手游| 元谋县| 布拖县| 内乡县| 甘南县| 台东县| 巴塘县| 三门县| 祥云县| 电白县| 廉江市| 河北区| 水富县|