bukkit

Minecraft (bukkit) plugins, send user a clickable link

蹲街弑〆低调 提交于 2019-12-12 01:39:06
问题 Im developing a bukkit plugin and I need to send a URL to the user, I need to have the link clickable by the user so it can be opened in the users's browser. I tried using HTML and other types of tags but nothing worked. I also searched Bukkit Java library and did not find anything other than colouring the text output. 回答1: To send a clickable link to a client you need to send a raw json message to him, there are different methods to do this: Using the /tellraw command Using Server

Start/Stop Minecraft Server with PHP

浪尽此生 提交于 2019-12-11 22:37:26
问题 For the last 10 hours I have been trying to find a way to start/stop a craftbukkit.jar file that is in the same directory as my php script. I have tried nearly all of the solutions I could find on stackoverflow and none of them worked. I tried both shell_exec("java -Xms1024M -Xmx1024M -jar craftbukkit.jar -o true"); and exec("java -Xms1024M -Xmx1024M -jar craftbukkit.jar -o true"); I also tried putting the java -Xms1024M -Xmx1024M -jar craftbukkit.jar -o true in a external start.sh file and

Returning an extended class

亡梦爱人 提交于 2019-12-11 19:13:05
问题 I'm not sure if this will really make any sense (I've kinda confused my self ) but what I am trying to do is create a mini-game plugin and I'm trying to make it cycle between maps, I create a new class that extends BaseGame I pass in plugin instance, world name and xml file name to the super class BaseGame, The basegame class then parses the information from xml file and setup variables. I have some methods in side the class extending BaseGame because most maps have different game types so I

NoSuchMethodError when the method obviously exists

点点圈 提交于 2019-12-11 17:57:17
问题 20:15:43 [INFO] macintosh264 issued server command: /sell hand 20:15:43 [INFO] [XYZShop] MacCommand sell executed 20:15:43 [SEVERE] null org.bukkit.command.CommandException: Unhandled exception executing command 'sell' in plugin XYZShop v0.1.3 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:186) at org.bukkit.craftbukkit.v1_4_6.CraftServer.dispatchCommand(CraftServer.java:510) at net.minecraft.server.v1_4

Bukkit Delayed Task Inside a For Loop

不想你离开。 提交于 2019-12-11 10:15:18
问题 I've been trying to make gun plugin for Bukkit, and I'm trying to build a burst fire feature. I have a for loop that contains a delayed task, and inside that delayed task is the code to create a bullet and all that. Theoretically, the code would add some bullets, wait one tick, and add some more bullets, wait one tick, etc until the for loop is done. public void fire(final Player p, final Gun g) { for(int i=0; i<shotsPerBurst; i++) { Bukkit.getServer().getScheduler().scheduleAsyncDelayedTask

I want to kill a player if he went higher then 24 blocks

徘徊边缘 提交于 2019-12-11 05:45:38
问题 I want to make a Spigot Plugin that kills a Player if he is over 24 Blocks. I already made a code but it doesn't work Here is the full code, I don't need to register a new class because I wrote the event in the main class import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.plugin.java.JavaPlugin; public class MainFFA extends JavaPlugin implements Listener{ @Override public

Minecraft Bukkit Events

倖福魔咒の 提交于 2019-12-11 02:14:15
问题 I'm trying to get into bukkit programming for minecraft, but for some reason I'm stuck with events. Here's my code: Main class file: package com.plugin1; import java.util.logging.Logger; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.Listener; import org.bukkit.plugin.PluginDescriptionFile; //import org.bukkit.plugin.PluginManager; import org.bukkit

Setting the block underneath any player to glowstone, then setting it back to the original material

≯℡__Kan透↙ 提交于 2019-12-11 01:55:24
问题 I'm making a Bukkit plugin that will change the block underneath any player to glowstone. The scheduler isn't working. The ground will change to glowstone but the glowstone block won't revert back to what it originally was. @EventHandler public void onStep(PlayerMoveEvent pme) { Player player = pme.getPlayer(); Location locUnderPlayer = player.getLocation(); locUnderPlayer.setY(locUnderPlayer.getY() - 1); Location locForScheduler = player.getLocation(); locForScheduler.setY(locForScheduler

Merging two Config.yml Files in Java?

ε祈祈猫儿з 提交于 2019-12-11 01:52:45
问题 While programming my bukkit plugin, i realized that i needed to have my own config file so i can add comments into the file. I also needed to be able to update the config (if it has been created and is old). I had also recently finished a simple jQuery plugin, where I used jQuery.extend and i merged two settings arrays. I wanted to know if this was possible in java with config files. My Question: Is there a way i can merge the new default config with the one the user already has? (Removing

PHP to Java Connection

落花浮王杯 提交于 2019-12-11 00:48:48
问题 I am working on a project where I send supposedly press a button on a webpage and it then executes a command in java. What I'm looking for is something like this. Say if I pressed a button and then it sends a command to the minecraft server to reload plugins. How would I go achieving this? Thanks 回答1: When you have to comunicate between different applications you will problably need a bridge. In your case I'd suggest to use Minecraft's RCON service (must be enabled in the confingiration) or a