Skip to content
Advertisement

Tag: bukkit

Trying to get getView().getTitle() to work

I was first using only getTitle() for this but then found you need to use getView() as well. So i did but I stil can’t get it to work. FYI This is the error : Cannot resolve method ‘getView’ in ‘Inventory’ I tried changing getInventory() for InventoryView() but still the same error but also the Cannot resolve method ‘InventoryView’ in

Letter appears in console output, but shouldn’t. problem with Bukkit.getConsoleSender().sendMessage();

I’m trying to split code in classes. This code is sending to console text with B letter in start of line, but shouldn’t. Code: in ConsoleWrapper.java but if console.sendMessage((“§c[” + pluginName + “]” + msg)); executing in main class, letter B doesn’t appeat in console. output with cw.notify output with console.sendMessage() Answer It’s not recommended to write your own §

Spigot API playSound

So I’m trying to create a minecraft plugin using the spigot api and i’m having lots of fun! I’m trying to make a /play command that plays a music disc to the player. I’ve come across a problem with trying to play the music to the player. I’m using this: player.playSound(player.getLocation(), Sound.MUSIC_DISC_PIGSTEP, 500.0f, 1.0f); this works great, but for some

Bukkit Chat Clickable Buttons

I’m actually coding a plugin, in a command it prompts a confirmation message and I want to click a button (on the chat text) for confirming and cancellating. I don’t like to copying and pasting code from others, and I don’t want to use classes from others too. I am trying to use TextComponents but I can’t make it work.

PlayerChatTabCompleteEvent deprecated in Spigot 1.16.1

I could not find a replacement for the deprecated PlayerChatTabCompleteEvent that is deprecated in the newest Spigot 1.16.1 Version. I already checked the docs, but could not find anything related to that. And no, I don’t want to use a @SuppressWarnings(“deprecation”) at the beginning of my event. Answer There is no replacement. Since 1.13 the client does not tell the

Repeating Task In Java

I need to repeat a task every 5 seconds in java, I’m creating a minecraft bukkit / spigot Plugin, so doing it with Java or using the bukkit api would both work great. Code: Thanks for the help! Answer You can do what is called scheduling a repeating task, this example was pulled from the Bukkit forums. Simply edit the

Check how many people are within a certain distance from the center

I’m making a Spleef plugin. I need to count the amount of people in a lobby. I thought that I could count how many people are within a certain distance from the center of the lobby. I think that this may work better than recording when someone types the command. Main.java: playerJoinedGame.java: I have not called the onPlayerJoin method from

Advertisement