#help-development
1 messages · Page 1899 of 1
Mm
s
I find it weird the event is fired
@EventHandler(priority = EventPriority.LOWEST)
public void onTeleport(PlayerTeleportEvent e){
Bukkit.broadcastMessage("teleport");
}
I listen on lowest priority
and listner class is registered
I think I will need to to whole thing with NMS and PAckets
to many problems
like passenger dismounting in water
not been able to tp
Is there a way to check if there is not enough space for the text in a book page?
@ivory sleet
You will need to make a guess- since the size is the same it shouldn't be a problem
well, what is the minecraft book's page size?
Google your question before asking it:
https://www.google.com/
If a server is in whitelist mode, is a whitelist kick calculated before or after asyncplayerloginevent
yeah, I've found it, ty
Is it okey if I release a plugin as a paid resource that hooks to mcmmo and adds a bunch of features? It will do nothing without mcmmo though.
or is it against TOS?
Pretty sure that’s fine?
@vagrant stratus?
Actually wait
Is McMMO an addon or a requirement
So long as you are not distributing McMMO it would be fine.
Because if it requires McMMO then no
But if having McMMO just adds more functionality then you should be fine
He's talking about his being an expansion for McMMO.
His would not work without McMMO
You can’t do a premium addon for a premium plugin
You can't? Seems odd
People abused it
Then I would need to add further functionality so that the plugin does other stuff besides adding stuff for mcmmo? then it would be okey?
ah
hhhmmm
I wonder how
Hey you wanna buy 500 expansions for &2 each
EA GAMES?
Ability to move $30
Per button
How should i extract milliseconds from 5w3d1h
so that i would get the number of weeks days and hours from that string
By writing a parser
thanks
This one will allow duplications like
5h5h3m33m but idk if thst necessary
that's a lot more cleaner
but slower 🌞
it's for something that executes once, so no need for speed
okok
bump
test it and see for yourself
I can't, im sorta doing psuedocode planning rn, was hoping someone knew off the top of their heads
@gentle oriole @young knoll Well nms work very funny for get the values xd
but not sure how this values its acurance
Oh that’s quite interesting
deprecated?
my brain is also too weak to understand nms, so ill just wait for jira to update
Is there an API that exposes the ratings being given on plugins?
you have to scrape them
i dont think there is
yea, scraping is not gonna work, I did that once but eventually the bot gets banned anyway
spiget
declaration: package: org.bukkit.block, interface: Block
maybe try not to scrape the site like every second?
Scrapping is against the TOS
im confused it says breakSpeed, but returns progress??
yeah i have the same question
i test the method and dont see changes when break the block.. only the change when the block is AIR
can I see ur code?
public class SPIGOT6906 implements Listener {
private static HashMap<UUID, BukkitTask> tasks = new HashMap<>();
@EventHandler
private void onMining(PlayerInteractEvent event) {
final Player player = event.getPlayer();
if (event.getAction().equals(Action.RIGHT_CLICK_BLOCK) && event.getClickedBlock() != null) {
Block block = event.getClickedBlock();
if (tasks.containsKey(player.getUniqueId())) {
tasks.get(player.getUniqueId()).cancel();
}
BukkitTask task = Bukkit.getScheduler().runTaskTimer(Core.instance, () -> {
Block updateBlock = player.getWorld().getBlockAt(block.getLocation());
float v = updateBlock.getBreakSpeed(player);
((CraftPlayer) player).getHandle().b.a(new net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket(CraftChatMessage.fromStringOrNull("Progress in [" + updateBlock.getType() + "]: " + v)));
}, 0L, 1L);
tasks.put(player.getUniqueId(), task);
}
}
}
Why would you use packets for actionbar
this plugin i use when make PR.. then use craftbukkit and not spigot
I didn't do that lol
Yea sure, but without an API then people need to get creative
yo i dont know where to ask this but where can i find support for the CLA response
it said to contact staff after more than 24 hours of waiting
i think i submitted it correctly
the form
not sure how this works.. maybe you can find the contact button in the forum and ask (?
Spiget
how to detect if player clicked space 2 time (double jump)
Kisten for the jump; on jump set the flying to true for 2 ticks
allow players to fly and cancel PlayerToggleFlightEvent
If players starts flyind, do the boost
kisten, that was my turtle's name
hello any one know why I get this Error?
did you define createjail in your plugin.yml
I'm dying reading this
# put this in your plugin.yml
commands:
<commandname>:
description: My Description
show the yml code
its wrong
connamds ???
lmfao
Lmao
LMAO
LMAO
LOL
What is the purpose of putting commands and permissions into your plugin.yml ? Especially when you create commands and require permissions dynamically?
It allows them to be accessible
Luckperms can tab complete perms in the plugin.yml
Commands with a permission attached will automatically be hidden from players that don't have that permission
etc
imagine breaking lmao chain...
Yeah so for me impossible because I make them dynamically. For example I have plugin for custom currencies which allows you to create ... well, custom currencies. And appropriate commands.
For example if you want to create currency "dollar", you can easily put it into config and it will generate commands and permissions for you... for example you can define /dollar top to show leaderboards or you can assign it to /baltop etc...
So for these cases of dynamic commands and dynamic permissions plugin.yml is not important for me. Right?
I don't think, but maybe you should manage all of spigot system for commands
Like tabcompleter etc
can you even create commands dynamically?
Sure
You can listen for commands from chat and then react appropriately. I'm using Aikar Command Framework (ACF) for that.
Many command libs offer this
ok libs
but not meant to
Why does Intelji can not find classes that actually are in my project?
my project is corrupted or what
plural
plural, there are more classes
try public static enum PianoTypes
there is nothing static about the outermost level class tho
this is some kind of bug in Intelji that i can not fix
what does More actions say ?
did you import lol
ye, Restart, Intelji, restart computer, reimport project
import the class, not project
this is also not working, i've tried this
well
i think i found the problem, some fancy plugin i've installed to Intelji throws exception on Intelji open so my project could not be fully loaded
show full code of PianoTypes enum class
i think that was the point, because after removing the plugin everything is working fine
well then
So that plugin broke indexing, right?
i guess
Next time if that happens you should try to import the class manually and compile the project. This way you can find out whether it's just IntelliJ idea bug or whether it's the actual bug in your project configuration / classpath / whatever.
Main.java
package com.santoxgaming.discord;
import com.santoxgaming.discord.commands.DiscordCommand;
import org.bukkit.plugin.java.JavaPlugin;
public final class Main extends JavaPlugin {
@Override
public void onEnable() {
new DiscordCommand(this);
}
}
DiscordCommand.java
package com.santoxgaming.discord.commands;
import com.santoxgaming.discord.Main;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class DiscordCommand implements CommandExecutor {
private Main plugin;
public DiscordCommand(Main plugin) {
this.plugin = plugin;
plugin.getCommand("discord").setExecutor(this);
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!(sender instanceof Player)) {
sender.sendMessage("Only players may execute this command!");
return true;
}
Player p = (Player) sender;
if (p.hasPermission("default")) {
p.sendMessage("https://discord.gg/imnotgonnaadvertisemydiscordserver");
return true;
} else {
p.sendMessage("&cSomething went wrong! Please contact an Admin.");
}
return false;
}
}
My plugin is not working? I can not see it on the server and /discord is not working either
Did you know discord detects invites in code blocks
Pls help
Now you do
lol
Check startup logs
I did. I can't see any erros or anything
I find that suspect
I mean.. Maybe I'm just blind
I don't really know what to look for. This is my first plugin ever. I started learning Java today
Exceptions ^^
Both are pretty much the same, if you don’t shade - include any dependencies
If you have the Maven Shade Plugin in your pom.xml, it's going to produce two jars. One with dependencies, one without
Oh okay.
Though on your first plugin you probably won't need any dependencies in the final jar, you can omit the Maven Shade Plugin entirely
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.santoxgaming</groupId>
<artifactId>discord</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>Discord</name>
<description>Discord link!</description>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
This is my pom.yml
Yeah you can get rid of the maven shade plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>```
All of that can be deleted
Okay, it is deleted now
You'll only ever need that if there's a dependency you have that won't be available at runtime. Something like Hikari, or some other third party library not provided by the server. Though in this case, all you have is the Spigot API which is already there

Missed the reason it was broken. What wasn't working with it?
.
I don't know. I don't get any errors on server restart
The commands just isn't there. And I can't see my plugin in /pl either
Likely something at the start of your server log then. Or it's not actually in your plugins folder ;p
Do you have a plugin.yml, and in that file do you register your command?
Yes and no
Also, p.hasPermission("default") probably isn't doing quite what you want. They're going to need to have the permission node "default". This has no concept of groups from something like LuckPerms
What's your plugin.yml look like atm?
name: Discord
version: '${project.version}'
main: com.santoxgaming.discord.Discord
api-version: 1.18
authors: [ EmilHeinsen ]
description: Discord link!
When creating clickable chat text via BaseComponent[], can I bind some custom code that should run when clicked? Or is it only possible to bind specific commands?
discord.use then?
Usually people name their permissions as pluginname.command.commandname. So in this case, discord.command.discord, though ultimately it's up to you
Yeah so in your plugin.yml you're going to want to add an additional section. 1 sec
Scroll to the bottom there, there's a snippet of the plugin.yml
commands:
kit:
description: Your description
usage: /<command>
permission: yourplugin.yourcommandpermission
This stuff?

(the permission part is optional, but if the player doesn't have the permission set there, the command won't be sent to the client and they won't be able to run it. It's an automatic permission check)
Okay
You have to use a command, though typically what people will do is use some arbitrary command name that doesn't exist, then listen for it in PlayerCommandPreprocessEvent
My plugin still isn't showed on the server? :(
Thanks Choco, yeah some artifical command framework was on my mind as well. Thank you
No attempt to load it at all in the console?
Oh your main isn't correct
main: com.santoxgaming.discord.Discord. Your main class' name is Main, not Discord
No where I can find a solution to finding an itemstacks damage. Im seeing stuff about player.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE) and stuff on itemInHand.getItemMeta().getAttributeModifiers(Attribute.GENERIC_ATTACK_DAMAGE)
Oh, right… I changed that and forgot. Thanks so much!
Wdym
In PlayerInteractEvent I want the damage value of the current item in hand including enchants.
You mean when a player hits entity?
Yes
There's a EntityDamageEvent if youre interested in that
No I need it it PlayerInteractEvent like I say
Because Im basically making an aimbot custom enchant
A solution would be to add an invisible entity infront of the player to calculate the damage
My plugin is working now, thanks so much Choco
On left click I will damage entities in radius with the damage the sword would do including enchants
hm
Though I think it would be hard. Ray tracing and stuffs...
Wait. Can armorstands be hit when its completely inside the player's body?
If not, maybe an entity with a larger hitbox
There must be a way to get it from the itemstack
You need to calculate the crits, the strong attack and the weak attack
An invisible pig would do I think
0.9 hitbox
Player is 0.6
Just tp the pig per tick at the player wh en it equips the sword
What do I search when I want to find answers on my problems? I'm used to making Scripts with the Skript plugin, so I usually search "minecraft skript my problem"
spigot my problem
I usually type my problem spigot
Okay, thanks
Why use skript? Just learn to code.. its not that hard
Ye, that's what I'm doing now lol
That's a bit condescending when they are literally asking how to...
And I mean.. Skript is code
Skript is code. Just english
So is every other high level language
Ive read skript docs and its just like python
There must be a way to get that value
Attributes
what do vanish plugins do when the allow you to access chests? like your velocity is like in spectator and your hands dont show but you cant go thru walls
Please elaborate
Is that two different questions? lol
no
the second part is a description of what is visible and the question was how they do it
I don't really understand how opening chests and velocity of spectator mode & going through walls are related 
How difficult is it, to make a plugin work with multiple version? Just a simple plugin that sends a message on a command (/discord)
Like supporting 1.8 - 1.18.1?
Yes
It's not necessarily that difficult you just have to make sure you're only using API that exists in all versions.
Okay
That one should be really easy. All you have to do is send a player a message. Player#sendMessage(String message);
Those methods have existed since 1.7
Ye, I know that. I was just wondering if it would just work in all version or you had to do something
It would likely work for all versions.
sendMessage will
If it's just a simple discord command.
Cause I mean, I did download the spigot-1.18.1.jar, so maybe that would not work in 1.8.8
I just starting making plugins today, so I don't know much
Yea, most stuff won't, but sending messages will.
Okay, thank you :)
easy solution: don't encourage legacy software users
If you need to add multi version support, you will have to learn a lot about how maven works and setting up multi module projects. Then you have to learn the discrepancies between server versions and what you have to call in what versions. It gets messy, but it's doable.
Color codes are usually handled by a method provided in the api. ChatColor.translateAlternateColorCodes();
Okay, maybe next year... lol
Could you give an example on how I use that to send a message?
Hex codes are also handled by the ChatColor class, but you will have to use the #of(String hex) method to convert them.
Thanks mate
HEX won't work for some legacy versions of Minecraft.
Pretty sure it was added in 1.16
Ye, it was
So sending messages is as simple as getting an instance of the player and calling player.sendMessage("Hello there!");
If you want to send a colored message, you will have to translate the color codes. player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&aHello there!"));
The first parameter is what character you want to use as your translator character. It can be any character, but everyone just uses the & symbol.
Also, if you want to use Hex color codes, they are only supported in 1.16 and above. I believe that the class will convert them to the closest color in older versions, but just keep that in mind.
Okay, thanks! :)
How do I make turtle eggs crack faster / just make every animal become an adult faster?
or would that be just random tick speed ._.
Change their age for being an adult faster
TextComponent message = new TextComponent("https://discord.gg/imnotgonnaadvertisemydiscord");
message.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("Click here to join our Discord server.")));
p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&8[ &9&lDISCORD&r &8]"));
p.spigot().sendMessage(ChatColor.translateAlternateColorCodes('&', message));
incompatible types: net.md_5.bungee.api.chat.TextComponent cannot be converted to java.lang.String
How do I use color codes in text components with HoverEvent
Components have their own way of setting color
I think it's either setColor or color
Would you give an example of how to use it?
bump
new TextComponent("Hello").setColor(ChatColor.RED);
Thanks
TextComponent message = new TextComponent("https://discord.gg/notgonnaadvertisemydiscord").setColor(ChatColor.AQUA);
We agree that this should work, right?
Cuase it's red...
Which import are you using?
Quite a lot
import com.santoxgaming.discord.Main;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.chat.hover.content.Text;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
Wrong ChatColor
You need to use the net.md_5.bungee.api.ChatColor;
You need net.md_5.bungee.api.ChatColor instead of org.bukkit.ChatColor
Import the bungee one for that
oh well.. I did not import it lol
But it should be imported it. I use that too
In a normal message, without a hoverevent
Yeah, have to be careful with auto imports.
I used to use
Bukkit.getServer().getScheduler().runTaskLater(plugin, () -> {
//code here
}, ticks);
But it doesnt seem to be working anymore whats the 1.18 version of this?
I don't think that you will actually ever use the org.bukkit.ChatColor class. Everything relies on the net.md_5.bungee.api.ChatColor
Riiight, that fixed my problem too
Deleting the org.bukkit.ChatColor
Thanks
Well now my entire line is red
TextComponent message = new TextComponent("https://discord.gg/stopadvertising").setColor(ChatColor.AQUA);
@Override
public void run() {
}
}, ticks);```
works
Kinda lame
.
How to do it then?
TextComponent component = new TextComponent("Stuff here");
component.setColor(ChatColor.RED);```
Like that
oh
why does Intellij suggest this?
Because a location can have null as its world
I would just ignore it to be honest
Unless you are specifically constructing a location with null as the world you don't need to worry about it
Every location returned by the bukkit api will have a world
not if its related to Structures ^^
Haven't touched those
hi all i need some math help, i'm trying to make a BlockParty plugin and im not totally sure how to make square patterns?
the idea is that you start with one block, add to its X and Z and that's the square.. like so:
⬇️Starting block
🟥🟥🟥
🟥🟥🟥 (one square)
🟥🟥🟥
The only issue is, i'm not sure how to do this... and i'm also not sure how to do the math, because i have 0 skill at math..
if someone could point me in the right direction, i could probably figure it out
i just dont know where to start
You want to build a square?
yes, i should have added with two corners
i want to make multiple squares out of two corner locations
so loc1 is X, Y, Z
loc2 is -X, Y, -Z (etc)
and from those, an amount of squares is generated, and set to a certain type of material
You just need a 2d for loop
idk how i should use that, should i google? willl i end up finding anything?
when it comes to me trying to find math solutions for java online, i can never seem to find anything
Can someone help me setup Javacord with my plugin, so I can control my Discord bot from Minecraft?
i'm still wondering which one to use lol
i figured it out
Hi there, I'm attempting to port some code from 1.16.5 to 1.17.1.
In doing so, I had to use the Spigot BuildTools for 1.17.1. I ran it with OpenJDK17.
However, when I attempt to extend classes or access enums, the variables are named alphabetically (a, b, cA, cB, etc.) instead of what they are supposed to be named and I do not know the mappings to the original variables.
Did I do something incorrectly with the installation of the buildtools? Many thanks.
I can link some pictures as an example for my problem.
do you use maven ?
I do indeed
or did you just import random stuff from buildtools ?
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
do you want to use the spigot api ?
import net.minecraft.server.level.EntityPlayer; // how I'm importing
If I could help on this, that'd be appreciated
I sounds like university work
I'd probably move to the api afterward
but since the code is solely off of buildtools right now, I'd rather rebuild it from the ground up
because spigot api would be
spigot-api and not just spigot
FreeSoccer what the diff?? Cuz on spigot you have all the things that are included on the spigot-api
import net.minecraft.network.NetworkManager;
import net.minecraft.network.protocol.EnumProtocolDirection;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.PacketPlayOutEntityHeadRotation;
import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;
import net.minecraft.network.protocol.game.PacketPlayOutNamedEntitySpawn;
import net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.EntityPlayer;
import net.minecraft.server.level.PlayerInteractManager;
import net.minecraft.server.level.WorldServer;
import net.minecraft.server.network.PlayerConnection;
switching to api, all of these are not included
Yes
so yeah, can't use api
I explain you
The spigot its the one which include many things
It contains the api, etc
yep
yep
spigot-api is included in spigot
Any advice?
Presumably you want the remapped spigot if you don’t want the obfuscated jar
probably, how would I get it
Add the remapped classifier to your pom
<classifier>remapped-mojang</classifier>
If it says it can't be found, or something to that effect, you need to re-run buildtools with the --remapped arg
I'll just do that, thanks for the help
The names are probably still going to be slightly different, but they'll be named properly instead of cD
this.yaw isn't defined so I'll take what I can get
It’s possible the class no longer includes whatever it is
What are you trying to do
Access an EntityPlayer's yaw
Why are you using NMS for that?
I'm basing this code off of a 1.16.5 plugin, so truth be told I don't really know. 😂
I'm planning to port it to 1.17.1, then rewrite everything with additional functionality
Can I post images here?
if you have verified role yes.
should i save homes in a database?
cant wait for this getting added to api (1.18.2 update):
/usr/lib/jvm/java-17-openjdk-17.0.1.0.12-13.rolling.fc34.x86_64/bin/java -jar BuildTools.jar --rev 1.17.1 --remapped
this is the command I ran to install my version (java17 isn't my default in path)
idk it looks weird
yeah it does
did I install anything incorrectly? (Should I use oracle or something?)
Not that I think it'd affect anything but I've never done this before, so... /shrug
i just added the spigot dependency to my pom
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
why not
You didn't add the classifier
i saved it in yaml first and i didnt need to cache it
I attempted it which then promptly broke
What did it say
well, more homes == more time to load and more memory usage
With database, you can avoid this
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<classifier>remapped-mojang</classifier>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
In remapped it's ServerPlayer
Like I said, they're going to be renamed still.
They'll just be understandable.
Wdym
Don't use remapped and suffer through the obfuscated names.
You have to do that yourself if you're using remapped.
Nono I get that, but is the standard install of 1.17.1 supposed to have weird variable names
Yes
gotcha, thanks
There's more obfuscated names in 1.17.1 than in 1.16.5, everything was converted back into obfuscated and the mojmaps were provided for this reason 😄
waiting for the day mojang releases the game fully unobfuscated 🙏
hmmm what is obfuscated that you need ?
player.getInventory().addItem(new ItemStack(Material.DIAMOND_SWORD, 1).addEnchantment(Enchantment.DAMAGE_ALL, 6);
``` it says i need a bracket in here somewhere
i dont think so i need to tho
Is it possible to make a stack of items, non-spreadable? if that makes sense
i dont think so
hey np
you are adding a void?
new ItemStack(Material.DIAMOND_SWORD, 1).addEnchantment(Enchantment.DAMAGE_ALL, 6) returns a void and you need another )
where!??
on the end
new Itemstack(material).addenchantment() returns nothing
create you itemstack first and apply the enchantment, then add it
breh thats so dumb
thats not dumb, that only works with a builder
you can name it to whatever you want
ofc yeah
(mostly whatever... there are still some exceptions)
but what var
uff
i'd say ?learnjava but i think you know java enough
NamingScheme
ill find the doc for it 1 sec!
turns out im too lazy figured it out but now addEnchantment() dosnt work here is the code
//vars
ItemStack DiaSword = new ItemStack(Material.DIAMOND_SWORD, 1);
player.getInventory().addItem(new ItemStack(Material.ENDER_PEARL, 64));
player.getInventory().addItem(DiaSword).addEnchantment(Enchantment.DAMAGE_ALL, 6));
Errors:
Line 41 being the last line
or anything that returns self
you are adding an enchantment to a void method
ohh...
wait how do i even fix it?
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
i know java thanks, its 12AM
my dude you def dont know java
12:30*
12 am for that isnt an excuse lol
?google minecraft spigot how to create itemstacks
Google your question before asking it:
https://www.google.com/
Not even that this is literal basic java lol
also
like day 1
only if you learned it the proper way >:D
Yeah you should know that it was adding on to a good
hello, im going to make a custom block texture for some blocks
and it uses a trick
i will create a texture for an item
Custom model data?
and place it at a itemframe
so
and as it have an itemframe
when i interact with that
lag
it will remove the texture
but thats not my problem
i would like to have a way
to set the player target block
Hi, I'm trying to make a custom GUI, but I can't seem to get rid of the white squares on hover. What can I do?
#help-server probably better
There's a better, non-laggy alternative: use noteblock, it has over 800 states which texture you can override
what kind of inv is it?
anvil?
The theme of this channel is development.
You can't
itemframe is way more laggy then noteblocks and also very unsafe
I can.
You're doing it the wrong way for them to now show.
should it work with a texturepack?
You're filling it up with items, when you should be using another thing
yes exactly.... resourcepacks are not spigot development
i guess
large chest
Items will always have that effect
Hey,
It's more about math than development, but I need that math to develop something, so I thought it would fit here too...
I have a time when an animation starts.
I also have a duration which can be different for each tool the player uses.
I now want to show an animation which has 10 steps.
What would I need to calculate which step I have to show?
Every step should show up for the same amount of time as the last step.
My first thought was pretty stupid, so I better not show it 😅
Use this. Then you can (Contact me if ya get any questions)
https://www.spigotmc.org/threads/custom-inventory-ui.525744/
if thats a large chest, where the heck do those white lines come from?
how it would be unsafe
inv.remove(slot)
it is just an item with custom texture
wha-
itemframes are entitys ... unless you use nms which makes it even worser to use they will get easy removed with /kill
you have to block many events too
noteblocks are just there
and also 1000 itemframes will lag.
200000000 noteblocks maybe not
so it would display the block border in the block below the itemframe
Hey guys im trying to think of a way to track quest data through events but the only way I can think of it is doing a ton of if statements and increasing when one is met. is there a better way to do something like this?
Is there a way to create an object with its own event checker that way if I assign a quest to a player that object itself can record when needed?
if you're using events, i'd make classes like QuestCompletedEvent and QuestStartedEvent with all the data
Anyone know why when i set customname to " jeb_ " and then make visablecustomname false it doesnt make it rainbow? But mainually setting it to jeb_ with nametag does work?
i have the _ in there but discord thinks its a font
itallic
use \_
i do
\_/ heh
_
Its not like a in order questing system its just players get 5 random quests a day if they complete them they get rewards if not they just get new ones the next day
_hi_
Number one result on google for a spigot quests plugin. It's open source
https://www.spigotmc.org/resources/quests.3711/
Here's what their listener looks like:
https://github.com/PikaMug/Quests/blob/main/api/src/main/java/me/blackvein/quests/listeners/BlockListener.java
lmao every time you break a block that code is triggered
is it possible to modify how many slots a furnace / hopper / anything tileable has?
how would i get started to do that
What are you trying to do?
In vanilla, it is only possible to modify those using resource packs.
how would i get started to do that
Check this out
https://www.spigotmc.org/threads/custom-inventory-ui.525744/
hey i want that
Am i allowed to ask about plugin errors here?
yea
Turns out, it IS possible! there is an InventoryDragEvent
just cancel it if you don't want it to be un-stacked
can you still split it by right clicking on it then?
maybe that can work https://www.youtube.com/watch?v=VEk_l_bosZo
Today I'll show you how to essentially add any new block you want to Minecraft without having to replace any pre-existing, vanilla blocks or textures!
►Subscribe - http://bit.ly/Subscribe_Sarc
►Follow Me On Twitter - http://bit.ly/SarcTweet
───────
Other info:
───────
Commands:
/blockdata ~ ~ ~ {RequiredPlayerRange:0s}
/blockdata ~ ~ ~ {Sp...
Nah, this is one of the most unreliable ways to do it. If you have a ground made completely out of those custom blocks, you basically have hundreds of entities laying around.
i just found it
Trying to unit test my commands, is there a way to add a permission to a Player?
(I'm using MockBukkit if that's relevant)
Do you use MockBukkit?
Yes
I'm using MockBukkit
i wonder
Im just thinking of a way that doesnt require you to implement a whole permission system...
Anarchist
Same because at that point it's not worth the hassle, would just be a nice quick test if simple to do
What are you actually testing
Cause maybe you could create a player mock which would allow you to set its permissions (or just like solely hasPermission)
I have a PlayerMock instance but I don't see any method to set permissions, only hasPermission and isPermissionSet
i'm working on a plugin for custom bans but i have a problem if i got banned i got this message
You are banned from this server! Reason: How can i remove this default message in my plugin?
I think just using addAttachement should work
Conclure, your pf looks like a duck 
^ else make your own mock maybe
quack
quack quac
🦆
i'm working on a plugin for custom bans but i have a problem if i got banned i got this message
You are banned from this server! Reason: How can i remove this default message in my plugin?
Kick em
check the PlayerLoginEvent iirc
Yeah not a bad idea, I'll take a look at mockbukkits source, could always try and pr it in
yeah
(if I can make my own lol)
-
dont ask the same question within the same minute we definitely saw it the first time and wouldve gotten to it
-
make ur own punishment system
So passing something like UnitNamePlayerMock which has a ::setPermission or sth
🐮
thats an async event? 
uhh idk
It says async
idk what the difference with loginevent it
So yes
thought there was only PlayerPreLoginEvent thats y lol
So you can for example make database or web calls in there without freezing the server
Async one happens first
i didnt know the async one existed
the not async one is deprecated
^
AsyncPlayerMoveEvent when
🌝
is there one?
No lol
imagine moving async 🤔
There can’t be, because player movement happens on the main thread
ik
uhu
You’d have to properly split up Minecraft into a concurrent game
theres probably some terrible fork that tried it tho
makes sense
Isn’t the incoming movement packet async
Yes
ew packets
But that’s without the server-side correction
Ah
minecraft but fully serversided movement when
yeah
There’s a reason real time games don’t do that lol
some people just want to watch the world burn... i want to be the one that lights the match 🔥
I can respect that
Did someone say arson
🥵
does preparedstatement automatically sets ' ' when replacing a question mark with a string?
hello i need some help
i need some help too
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
hello, so i want to know if it's possible to transfer a player from a server to another one, without bungeecord, as it links servers and it's not really what i want and it's not easy to set up a bungee server. So maybe there is like a plugin that will send a player to another ip
wtf
i've imported projects from eclipse into intellij w/o problem so im a little baffled
Somehow
IJI detects two of my projects that I started in Eclipse
But when I open 'em
I am unable to edit 'em, since it doesn't shows any folders or packages
so need to say a bye to IJI
sry
nooo
pls?
u sure ur opening them thru intellijs project importer?
Probably possible on Bedrock, but that is not the place for that, I guess.
How the hell could we connect a player to another server without BungeeCord?
IS IF EVEN POSSIBLE?! :wtf:
java edition does not have transport packets which is what youd need iirc
No. You dont have any authority over a players connection.
Once you open IJI (without any projects being open), you can see a recent projects page, and from that.
if you wish to add minigames to your server so you need more servers you will need bungee to link them, but it's not really what i want
But why
Hello, I would like to know if it would be possible for a player's uuid to be the same on bungeecord and spigot?
There is no other easz way
it's not even a way cause bungee doesn't do what i want
The player's UUID is always the same.
A players UUID is the same everywhere
Well what do you want
ur trying to transfer a player to another server no? that is something bungee can do
Simply add the servers into the config.yml, set IP forwarding to true, and voila
bungeecord: true ftw
Different ip
without linking
yes
Won't work
Why 😭
Each servers needs to be linked with Bungee
ah, just straight up not possible in java edition
oka
That's what we said a few times already
thanks
Watch a YT tutorial on how to setup BungeeCord, or download a free BungeeCord premade server, and learn from that
The last one is probably more helpful
even if i use bungee i could not do what i want
(it is actually the method how I learned BungeeCord)
there was one server i saw that sort of? did what youre talking about, but fuck if i know how they pulled that off
probably acted as a literal proxy instead of just bungee
oh
Just mashing at bungee till it works
At first bungeecord concept looked very strange for me
i thought i'll have extra ping xuz you know its a proxy
First when I sat up one, I didn't even know where to set the port. It was like two years ago. xD
This should be available in a command like ?bungeeconnection
Velocity ftw tho
wish i had a network worth bungeeing
lets make like one of those internet web-rings but with mc servers
Would be 234789342978 times slower
Iguess
You can always justify it somehow ^^
For example have every dimension on a different server instance for better performance
i just dont have a network, i got 2 servers that are completely unrelated to each other
and god do i not want them to cross paths
now that is something i wish i had money for
I am new i need help how can hit player with command? Which playerEvent i need? Can anyone write me a code? Plz
Like i want give him kb
If you have 2 servers running already then its probably a good idea to think about getting a root server soon. (Or at least a VServer)
At the 20 bucks/month mark its not worth it going for gaming server anymore
What is kb
Yeah
I see. PvP jargon...
?
interesting
Easy awnser: it is somehow possible on 1.18.1 I guess, and no, we are not really able to write a code for you.
@storm chasm what do you actually want to do that you think bungeecord can’t
Because bungeecord supports multiple IPs
Well we are but I don't support spoon feading
HOW?!
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html
This is the Player class. There are plenty of ways to apply real or artificial knockback to a Player.
declaration: package: org.bukkit.entity, interface: Player
On What occasion do you want to apply knockback?
In the config
ok so the only feature i know about bungee is that it can link servers so for exemple when you want to add minigames
That site i didnot found kb, so i come here to help
In which line? o.o
?
Plz
The forced hosts
(I actually realised that it is inside config.yml)
On What occasion do you want to apply knockback?
Oh, I tough you were saying how to actually use multiple IP-s to reach the network.
What do you think “link servers” means
@brave sparrowand the thing i want to do is like allowing players to move to another server/ip from one
I mean you can do that too, the numerical IPs all need to point to that box, or the domain DNS needs to point to the box
I just want that player get kb if type my command
oh i thought they wanted to connect the player to whatever server they wanted and not just linked
There's modern pvp players here as well!!
That’s literally what bungee does
Certain plugins allow that, like ChestCommands, or DeluxeHub
all my homies play modern pvp
Which playerEvent can do this
servers in the same network
You can register all the servers you want with your bungee server and then re-route each player how you like to
Read the wiki
but my server with a friends server
It will help
Are you intending to connect players to servers you don’t run
player.getVelocity probs
if it is not ####ed up
Cause that you can’t do
i smell cheating 
You and your friend can coordinate to make both servers accessible from each other’s bungees though
jk
Very easy
I
Ok ill try
and how
u dm ur friends go hey wanna link up?
Just like you would with a server you own
I don't like where this is going
know that he hosts in his machine and i use vps so
That doesn’t matter
it's still possible?
Bungeecord servers can be distributed across thousands of machines
u could have bungee linking two servers across the world if u wanted it to
That’s not an issue
servers:
anya:
address: ip.ip2.iplol:portherebutinnumbersorimnotgonnaworkxd
restricted: false
motd: why i am alive
apa:
address: ip.ip2.iplol:anotherportbutnothtesameasanyaxd
restricted: false
motd: why is anya not coming home
This is an example of the servers section
It’s just like setting up any ordinary bungee network
lol
There’s 0 difference
oh also
This isn’t even an unusual use case for bungee
they could do that over a command
didn't know that lol
link or smth pls?
for this specific feature
its like the whole purpose of bungee
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Use the quacking bird
this told me that bungee could not do that
Tell us which part gave you that idea and we can explain how you misunderstood it
Same thing
Linking -> Transfering
You’re misunderstanding what linking means
the same
@brave sparrowthere is the one thing: linking your servers together, and i'm saying yours
the other thing is just transfering players
gotta create a link to start a transfer 
but you're saying that transferring will need to link right? @brave sparrow
Brain hurts
lmao it's hard to explain
i know
i'm reading that
We do be acting
@storm chasm transferring IS linking
You’re putting too much emphasis on the “your” in “your servers”
It just means the servers you want to be connected
What do you want to do? Link your servers all togethers?
Is there a way to center a List of Messages in Spigot based on the longest message?
Clients have different fonts and chat widths
I know, but usually if I base it on the default font it will at least be approximately accurate
print out the json String and see what you get
also there is a surrounding property called "properties"
Leakz
leaking my skin nooo
I'm running into a ConcurrentModificationException with my player data manager and I'm not entirely sure why.
Here's the error: https://pastebin.com/9GZtEmdd
Here's the data manager: https://paste.md-5.net/pigawusowi.java
Here's the class in which it's being called: https://paste.md-5.net/umobezogaq.cs
Does Map#computeIfAbsent() run on another thread or is my issue related to something else?
Looks like properties is a JsonArray
yeah
Without reading the code:
You are probably iterating over a collection and modifying it inside the iterator.
Well if I am, I'm trying to find where. Inside my player data manager is a map that acts as a cache. When I call the loadPlayer method, all I'm running is this:
public void loadPlayer(UUID uuid) {
dataCache.computeIfAbsent(uuid, k -> new YAMLPlayerData(plugin, k));
}
I'm unsure as to why it would throw an CME.
let me read the stack trace real quick...
paper moment
The stacktrace isn't actually from my testing. It's from someone who reported it to me.
But I don't have multiple accounts so I can't really recreate the circumstances.
CME?
Show the constructor of your YAMLPlayerData
ConcurrentModificationException
Ah
Full code?
Send ?paste
or you already send it
Full code is linked in my first question, but here it is again: https://paste.md-5.net/pigawusowi.java
Cool. Now add the YAMLPlayerData pls
what about YAMLPlayerData
One massive paste? Or one message?
i do not recommend all code in 1 paste..
Ah ok
Sorry man, but for me its easy for reading
But no matter
Also, not sure if you actually need it, but the project is on GitLab: https://gitlab.com/Nothixal/hugs
Gitlab has some QOL features that I prefer and I was originally going to use GitHub, but they were acquired by Microsoft some time ago. Not a big fan of them.
Gitlab its more for working in team right?
Also GitLab has always had private repos. I think that you have to pay for those on GitHub
Hm i dont see any calls from the YAMLPlayerData constructor that leads back to the dataCache...
Maybe its an actual async access to the dataCache.
That's what I'm trying to figure out. The person who is having the issue says that the error occurs when a player joins for the first time.
I cannot recreate the issue on my end as the file gets created. However, my suspicion is that #computeIfAbsent() runs async and there is some issue with it.
Unless this new File(plugin.getFileManager().getPlayerDataDirectory(), uuid + ".yml"); accesses the YAMLPlayerDataManager
new configuration lib what u guys think
Try to run it with CompleteFuturable
Does it support comments?
haha
I don't believe it does. The data manager is what creates the instances of that class.
Even spigot supports comments now
all it does is set a field's value from a specified key in a FileConfiguration
it would be pog to actually hook in to FileConfiguration#set
but then i need super duper hacker code
Just throw a class into Jackson and save it as yml... Thats what i do at this point
Does that support comments
Spares me all the serializing/deserializing
Do you recommend github or gitlab?
i prefer github

I recommend GitLab. You can host your own instance of it.
I believe gitlab has another focus than github
No. Users dont deserve comments. They will ask anyways in a one start review.
github best
really descriptive
I need to create a continuous integration branch. Where more than 2 developers can work at the same time knowing that the code will always be up to date and in case something breaks on the part of a developer, you can go back
GitHub super pog cause GitHub give student licenses
But with github/ the code its never auto updated. You hvae do it manually
Lol
wat
??
no code is updated until u git push
ew
god no
Isn’t that what the spigot stash is
Cuz i need something that when you change code it create a unique hash for that (so then you can go back with that hash) and automatically push to server and download it on all other devs
That what i exactly need
so you need... source control management?
^
Dont use it. The webhooks are abyssmal
github and gitlab are effectively just web git 
That my problem
facts
I thinking doing something with C# + Github. To automize the process
This
creating a unique hash of the changes made is literally what git does
Every commit has a unique id. What you describe is just what git does.
or mercurial, if ur a madman
Git does this, just not automatically. Once you commit your changes, it has a hash that you can use. Once you push your changes, your devs will have to pull them in order to get the updated code.
But i have doing with another man and the changes are not push/cloned from/to repo
you really dont need it auto done tho?
just edit seperaly and then merge into a branch
then thats not gits problem that ur not pushing?
^
No cuz i thought it was automatically
You really don't want to push every change you make cause undoing would be impossible
^
Everyone works on their own branch. Then you can merge it at the end
Ahh
Isn't that the point of branches though?
Yeah but even within a branch you want the ability to undo


