#help-development
1 messages · Page 630 of 1
yeah it's great
@nimble oxide please send your whole main class, and your COmmandHelp class, then we can explain to you how to pass the databse object to the help command class
idk we talked in DMs and I sent them back here
Hey there, I'm new to java and mc plugins what should my spigot plugin be?
?learnjava first
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.
Join/leave message plugin
I've already learned java
ok thanks
async deluxe?
Fun fact: the first plugin I ever helped work on was called "Welcome/Welcome-Back". Wasn't even mine. Just offered to help someone else
It was really bad
i think my "first plugin" was a modification of one for the server i was on at that time, i don't remember what it did, i don't remember what i did, but i do remember that at one point it was throwing a NPE and so my butter brain immediately went "well i guess i'll stick @NotNull in here?" :kek:
Well duh. @NotNull just dispells any and all null-related exceptions
I'm pretty sure mine was copy-pasted almost straight from a Java book I had gotten that had a single chapter for making plugins. Pretty sure I spawned a pig.
what is a "W-coordinate" ?
how do 4 dimensions work with respect to noise generation?
the 4th dimension is just an extra parameter
but what it do
Whatever you want. It's another degree of noise
The x, y, and z components of noise do absolutely nothing on their own either, you just happen to use them for x, y, and z block placement
(sort of mangling the definition of noise generation here but you get the idea lol)
Ima go against the grain here.
What do you enjoy the most about minecraftm
i know
"I've learned java".
I've been doing it years and only learned Points were a thing a 3 weeks back
im not saying im an expert
What u enjoy in MC the most
Points?
playing with my friends
Like, from Swing? lol
Class that just has an x and y coordinate
Good for quick and memory cheap checks
Yeah, that's part of awt. It's more of a class for GUIs and I'd recommend avoiding it because it may not be available in all distributions
You could always make your own though
Tis true.
I have my own like point class thats decoupled from worlds
usually use it for mini games
Look at the player class. Look at its methods and come up with an idea from there
Anyways, your point is that you're always learning. lol. You're right. I'm 8 years into Java and I'm still learning new things. Syntax-wise I think I know everything there is to know, but there are always libraries and features you've never used
E.g: learned about javafx and scene buildervsfter 3 months learning swimg
Dang nearly cried
Oh shit choco we discovered something neat last night
Mojang bodge job as much as we do.
Ghastly fire balls constantly reset their velocity and that's how they "ignore gravity" 🤣
Right but they also aren't affected by air friction right? So it's probably just to keep a perpetual motion
Otherwise the delta movement gets reduced to 0 eventually
do you know about int func() [] { } ?
or receiver parameters too, those are fun
and by fun I mean meh
are you sure thats java wtf
yes
💀 ive never seen that before
The declaration of a method that returns an array is allowed to place some or all of the bracket pairs that denote the array type after the formal parameter list. This syntax is supported for compatibility with early versions of the Java programming language. It is very strongly recommended that this syntax is not used in new code.
lol
lmao
🤔
also the fact that constructors can have generic type parameters, that might not seem like anything new, but then you have stuff like this
class Whatever<T> {
<U> Whatever() {}
}
new <String> Whatever<Integer>();
where do you even find this stuff
or if the super ctor is generic <String> super(...)
class Whatever {
Whatever() {
<String> this(0);
}
<U> Whatever(int dummy) {}
}
idk I just know stuff
lol
this is what hours of reading the language spec does to a mf
Never seen this, but I have seen everything else you showed/mentioned
Receiver parameters are interesting. I kind of wish they were more useful
what is the mechanism of a container's inventory that being synced to all players who have open the inventory gui
i want to apply it to my custom inventory to prevent dupe.
Hi, how do you guys remove the "==: serialization.class" from the yaml file while saving to it? (for example, Location doesn't print that anymore in the yaml file)
holy moly emily in spigot 😳
you don't and if you do it prevents it being detected it is serialized data
What's the result of such alias?
something like "==: alias"?
yes
If I add fake players on my server with nms, can I use them for testing, like making them using a command, or triggering an event listener?
no way its md_5
wtf is this
A better idea would be to write an actual external client that connects to your server in offline mode.
One decent template for that is PrismarineJS-mineflayer
https://github.com/PrismarineJS
that's nothing special he's quite active here 😉
can I find a premade one?
oh cool
This is as premade as it gets
const mineflayer = require('mineflayer')
const bot = mineflayer.createBot({
host: 'localhost', // minecraft server ip
username: 'Bob', // minecraft username
auth: 'offline'
})
bot.on('chat', (username, message) => {
if (username === bot.username) return
bot.chat(message)
})
// Log errors and kick reasons:
bot.on('kicked', console.log)
bot.on('error', console.log)
This is how you create a bot, let it join your server and repeat every message they see in chat.
I think there is a barritone module where you can let them run around and mine ores, fight mobs etc
I just need for them to use commands
Well then this should suffice
and maybe if I damage them, events needs to trigger
so would: Bukkit.dispatchCommand(Bukkit.getPlayer("Bob"), "test"); work?
What is your goal?
Spawning NPCs via a plugin might not be what you want. I would probably use mineflayer.
I need fake players to join and use "/arenajoin", and then I would like to interact with them, idk if that the best method
const mineflayer = require('mineflayer')
const bot = mineflayer.createBot({
host: 'localhost',
username: 'Bob', // Generate a random name here
auth: 'offline'
})
// Submit command 1s after joining
bot.once('spawn', () => {
wait(1000)
bot.chat("/minigame join")
})

runs on nodejs sadly
could be worse, at least you get arrow functions rather than pythons monstrosities
lambda x: Some atrocity here
true
true lmao
As a certified nodejs developer, fuck nodejs, go with java
Some people be like "Yeah javascript is such a nice frontend language nobody likes. How about we use it in our backend as well."
Hell nah js backend
use java for backend
And then the project gets bigger, someone new joins and is unable to identify what anything does because dynamically typed
Except that the location added is not 0.5 but 0.4999999999999998. But I want the location to be equal to 0.5 and not 0.499... once the location is reached I stop advancing it. Here the location will never be reached as 0.5 is not added.
my code :
allStands.forEach(armorStand -> {
double z = center.getZ() - armorStand.getLocation().getZ();
double x = center.getX() - armorStand.getLocation().getX();
if(x > 0){
armorStand.teleport(armorStand.getLocation().add(0.05, 0, 0));
}else if(x < 0){
armorStand.teleport(armorStand.getLocation().subtract(0.05, 0, 0));
}else if(z > 0){
armorStand.teleport(armorStand.getLocation().add(0, 0, 0.05));
}else if(z < 0){
armorStand.teleport(armorStand.getLocation().subtract(0, 0, 0.05));
}
});```
Is it possible to save an image from an image in MySQL and then upload it custom on other servers?
yo can someone help me out it's something stupid i know
BigDecimal
base 64 dissassemble and reassemble
Never compare floating point numbers by equality. Always us an epsilon.
private static final double epsilon = 1E-6;
public void something(double x, double y) {
if(Math.abs(x - y) < epsilon) {
// Do something
}
}
how to render an image on a map?
google it
what is your problem?
is this like a tolerance?
sql just stores its data in a file on disk. You can simply migrate other SQL instances by using this file.
Or do you mean "image" in a more literal sense?
I mean, I have a bunch of servers (for example, velocity), and synchronize maps between them.
i thought image in the literal sense
like this ?
return location1.getWorld().equals(location2.getWorld()) && Math.abs(location1.getX() - location2.getX()) < epsilon && Math.abs(location1.getY() - location2.getY()) < epsilon && Math.abs(location1.getZ() - location2.getZ()) < epsilon;
}```
Ah well in that case simply base64 encode it or use a binary blob
What are you trying to do? Maybe lets start there.
?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!
I'm making animations with my armorstands.
At the end of my animation I move my armorstands to their final location. To do this I move them from 0.05 to 0.05.
As I know my final location, I check that my final location is equal to the location of my armorstand in order to stop my animation.
I would simply snap the ArmorStand in place when the target is close enough
private static double movementSpeed = 0.05;
private boolean isClose(ArmorStand stand, Location target) {
return stand.getLocation().distanceSquared(target) < movementSpeed;
}
private void snap(ArmorStand stand, Location target) {
stand.teleport(target);
}
private void moveTowards(ArmorStand stand, Location target) {
// Vector that points from ArmorStand to target. Length = 1.0 because its normalized
Vector direction = target.toVector().subtract(stand.getLocation().toVector()).normalize();
direction = direction.multiply(movementSpeed);
Location tpLocation = stand.getLocation().add(direction);
stand.teleport(tpLocation);
}
// Returns true if AS reached target. Call every tick until it returns true
public boolean moveStep(ArmorStand stand, Location target) {
if(isClose(stand, target) {
snap(stand, target);
return true;
} else {
moveTowards(stand, target);
return false;
}
}
why epsilon is equal to 1E-3?
Thats just an arbitrary value.
If you want to be exact then you have to follow the Nyquist-Shannon sampling theorem.
But now that you ask... you should probably choose your movement distance as epsilon in this case.
I updated the code above.
how can I make plugin folder be marked as minecraft plugin
is there a way to have when you mine an ore you get a chance to have double the drop?
I can't find anything on it
It will be when you set it up as a maven module depending on Spigot
Listen to the block break event and do a random check then add the extra ore?
oh thanks im still a noob
i have it
It's not loaded
oh, thanks, i am stupid
?conventions btw
(that is not my plugin, it from git)
Yeha don’t make packages with a capital letter..
Hey im getting :
Dependency 'org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT' not found```
Here is my pom.xml
```xml
<?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>org.dimensions</groupId>
<artifactId>DimensionsCore</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>20</maven.compiler.source>
<maven.compiler.target>20</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Did you run BuildTools?
wdym
Everything spigot related is pulled from your local .m2 directory. You need to run BuildTools with the version you want in order to use it.
i didn't want to build, i mean i just did like here :
https://www.spigotmc.org/wiki/creating-a-plugin-with-maven-using-intellij-idea/
you posted a message saying it can't find the api
did you press the update button top right, as it shows in the tutorial?
can't find it
look harder 🙂
The one in the class view doesn't always show up.
I can;t help beyond that as I don;t use IJ
np
what does it mean?
the data is too large for the constraint on the sql table
ArtMap plugin is getting some invalid data
why?
"artist" data is too long for your sql
atrist can only have 32 characters
you need to sanatize inputs before just assuming anything as well
that is, ensuring the data is appropriate as well as not above a certain size
remember that a name of max 16 characters in UTF-8 could be 32 or upto 96 bytes long
sql types, good point
which brings up the question of
why is their artist name exceeding 32 characters?
XD
unless they messed up or got confused in what data is supposed to go where
also empty characters count against the limit as well
so, if there for some reason a ton of spaces after the string, it still counts lol
or they are creating custom profiles with colours
why am i need database ?
my website, discordbot, and server will be same cloud server
i can't get any data from json file ?
if i do db it will also be on the same server
well DB software tends to be more optimal in its abilities of retrieving and storing data
but you don't need to have a DB however, just makes future things and backups more easily done
even if its on the same host, a DB software still has benefits but no one is forcing you to use one
how can I remove map info? There is no Flag "HIDE_MAP"
this should be in minecraft, but why is it not in spigot?
ah yes
does every location have a yaw and pitch?
oh okko
just, not the value you might need
thanks😘
it's good thx bro
how to make player smoothly teleport UHMM
what is smooth teleport
probably a relative teleport ?
teleport a short distance and the client will extrapolate movement
smoothly teleport
i mean this is kinda trouble and u can just move anytime u wanted sooo its not really good :/
Does a player quit event fire if someone is sent to another server by bungee
How can I realize point of applicaton for command? Do I need to use something like Mongodb for this? And how can I implement dropping points once a month, for example?
anyone knows the repo & dep for bungee 1.8.8?
please do not harm me, i'm working on an unusually extensive commission that is in 1.8.8
@Override
public void onEnable() {
// Plugin startup logic
getConfig().options().copyDefaults();
saveDefaultConfig();
getServer().getPluginManager().registerEvents(new PlayerDeath(this) ,this);
getCommand("reward").setExecutor(new KillRewardCommand(this));
``` the getcommand isnt excuting the command class ;-;
Does nothing, delete it getConfig().options().copyDefaults();
but i have a config file
;-;
i have config file
Points are a variable that indicates how many times a player can still use the team. Each time they are used, they decrease and if they are less than one, the command cannot be used.
so you want a system where players can use a command a certain amount of times
you'd just need to store a number for each player which would say how many times this player can still use the command
you could just mongodb for that. or any other storage solution really
Okay, thanks. But how do I make my data in the database (points) take a given value once in a certain period of time?
Is this suitable if the time period is long? A month, let's say.
hm that probably would not work
then you would be better off scheduling a task in your plugin that checks if that amount of time has passed
for example it would check once every 10 minutes if a month has passed
yep, you can store a timestamp of when the month countdown has started, and then check every 10 minutes if the current timestamp is a month away
one way of implementing it
save it in a file if it's user-configurative, hard code it if you can determine it
long valToSave = System.currentTimeMillis() + 3600 * 24 * 30; //a month from now on
Modify to do what you want```java
/**
* Schedule every Monday.
*
*/
public void schedule() {
LocalDate nextDate = LocalDate.now().with(TemporalAdjusters.next(DayOfWeek.MONDAY));
Long midnight = LocalDateTime.now().until(nextDate.atStartOfDay(), ChronoUnit.MINUTES);
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
scheduler.scheduleAtFixedRate(()-> { /* Code here */ }, midnight, TimeUnit.DAYS.toMinutes(7), TimeUnit.MINUTES);
}```
ok this took a long time of scouting old bungee plugins' source code, but in case anyone needs it:
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
</repository>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.8-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
Thank you all
pretty sure that bungeecord isn't version-dependent as it's a proxy
So bungee 1.12 should work across all versions
yeah i think so too, but i'm better safe than sorry with my compile times lmao
Bungee isn't version dependent please use the latest version.
Yes, I know this is the SpigotMC server, not PaperMC, but this sort of involves both. Paper doesn’t have any supported way to use Mojang’s NMS remappings with Maven (although there is a 3rd party plugin, which I don’t want to rely on) To get around this, would it be a bad idea to make a spigot plugin api that handles packets using Mojang’s remappings, then send packets in a Paper plugin through this api?
Yes it does
Use paperweight
"maven"
paperweight is a gradle plugin
you missed that part there ^
specialsource is a maven plugin
Oh then you'll have to use some spigot for nms
Specialsource is spigot's official, paperweight is paper's official
And not use paper api
honestly, marvins plugin is fine for maven and paper nms on maven
or just do what I do and use paperweight and avoid the paper API entirely
^ that's what I do as well
Except that paperweight takes fuckin 19 years to compile
and makes a 300mb cache
per project
I didn't realize that wtf 💀
paperweight.experimental.sharedCaches=true
can't bother
I'd have to clean caches across like 19 different projects
can't bother ssds are cheap
in settings.gradle I assume
no, youd add it in a gradle.properties
either the projects one or your systems one
might jsut set it on my systems one
yea
except I still use paperweight 1.3 or whatever
Bet time to save my storage space
I only have 3 terabytes between everything I need my space:<
100%
meh
3 TB obviously is nothing and instantly gone
I only have 750gb
what are you storing?
Well one of them is windows drive the other is my Linux drive then I have a shared storage drive
i don't need that much space
I usually use my shared storage drive for games and coding stuff
no
absolutely not
.
Uhmm what
wait 15 gb?
My coding stuff takes about the same space as ImIllusion
what?
for ideaprojects
do you fork projects a lot or?
my m2
you might be right
the more you do stuff the bigger it grows
so yeah if I sum it all I'm using ~30gb for coding stuff

hey, does anyone know how I could get an ItemStack from a placed block's material and data?
don't forget the weight on your shoulders that's accumulated every time a nerve died while fixing a bug
I don't really have stupid bugs anymore
except that one time I spent 6 hours debugging stuff because I had a static object that shouldn't be static
based
no clue why it was even static
Location respawn;
if (inSession) {
respawn = session.getArena().getArenaLobby(session.getWorld());
System.out.println("RESPAWN SET AT " + respawn);
} else {
respawn = ArenaProcessor.getCurrentArena().getArenaLobby();
}
event.setRespawnLocation(respawn);
[17:48:10 INFO]: [FFA] [STDOUT] RESPAWN SET AT Location{world=CraftWorld{name=private-22174257},x=1.0367338735542182,y=62.0,z=0.17358291354874272,pitch=8.699996,yaw=-179.25021}
i get spawned in the overworld
what does /= do in Java?
(I tried Google, it seemed unable to read those characters and kept returning "What is Java")
divides and assigns
a = a / b;
a /= b;
I hate this kind of arena management system
Thanks
same
but i gotta fix this then i will rewrite it
(give tips pls)
Wait one tick, then tp?
I should really just write a video tutorial on how to write a proper minigame engine
and post on youtube
with loud ass keyboard sounds
do you have a github project on it
don't forget Indian accent
then the player will experience 2 teleports
and huge fps drop
and win 98
sure
do i properly understand how to send bungeecord messages to plugins?
the bungee debug says that the message is being sent:
19:26:05 [INFO] Sending message...
19:26:05 [INFO] Sent 7 bytes
however there's no debug in my lobby console, whereas i expect it to appear immediately:
override fun onPluginMessageReceived(channel: String?, player: Player?, message: ByteArray?) {
println("Identifying a message. Channel: $channel")
...
}
bungeecord plugin code: https://paste.md-5.net/esototahos.cs
listener code: https://paste.md-5.net/ayoyiroyuv.bash
you need to have a player online to actually receive plugin messages
i do
@echo basalt what should i do here
I dont have time to rewrite the entire shit
I got no clue what that event is
I just know you can teleport peopel on PlayerRespawnEvent
playerrespawnevent
Trying to do map management on my minigame lib then I might actually post it
but I am really considering just making a tutorial from scratch
oh btw yes i have registered it
private fun initChannels() {
this.server.messenger.registerOutgoingPluginChannel(this, "BungeeCord")
this.server.messenger.registerIncomingPluginChannel(this, "BungeeCord", this)
}
quick question, lowest priority would happen first or last
first
my laptop cant handle to open chrome
something to do about high priority being treated last as it defines the outcome of the event
it's "lowest" because it happens first, but thus everything that the event changes can be overridden by higher-priority listeners
middle-clicking shows comments for me
Where you send?
here
I'm not even sure if releasing a video is the right move because i'd be going over the theory and got nothing to show for it
Why is java so complicated 😭
takes forever to write a minigame guide
yea
I might just do a huge .md gist
or a spigot post but my engine is mostly based off minikloon's
with a load of changes
ez
I'd start by reading this
public void initTasks() {
System.out.println("Initiailzed task");
getProxy().getScheduler().schedule(this, () -> {
System.out.println("Sending message...");
final ByteArrayDataOutput outStream = ByteStreams.newDataOutput();
outStream.writeUTF("Forward");
outStream.writeUTF("ALL");
outStream.writeUTF("KitPVP");
final ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
final DataOutputStream out = new DataOutputStream(outBytes);
try {
out.writeUTF("Event");
} catch (final IOException ex) {
ex.printStackTrace();
}
outStream.writeShort(outBytes.toByteArray().length);
outStream.write(outBytes.toByteArray());
System.out.println("Sent " + outBytes.toByteArray().length + " bytes: " + Arrays.toString(outBytes.toByteArray()));
}, 1, 30, TimeUnit.SECONDS);
}
There no sending method.
shouldn't "write" do the thing?
i just got into bungee please
maybe i missed a line or two in the tut
How can i know when you release it
Send your channel so i can sub
I'll just write a wall of text in notepad++ and release it as a gist eventually
maybe post it on spigot
Aight
public void sendCustomData(ProxiedPlayer player, String data1, int data2)
{
Collection<ProxiedPlayer> networkPlayers = ProxyServer.getInstance().getPlayers();
// perform a check to see if globally are no players
if ( networkPlayers == null || networkPlayers.isEmpty() )
{
return;
}
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF( "MySubChannel" ); // the channel could be whatever you want
out.writeUTF( data1 ); // this data could be whatever you want
out.writeInt( data2 ); // this data could be whatever you want
// we send the data to the server
// using ServerInfo the packet is being queued if there are no players in the server
// using only the server to send data the packet will be lost if no players are in it
player.getServer().getInfo().sendData( "my:channel", out.toByteArray() );
}
Source: https://www.spigotmc.org/wiki/sending-a-custom-plugin-message-from-bungeecord/
should this do the trick?
getProxy().getPlayers().stream().findFirst().ifPresent(
target -> target.getServer().getInfo().sendData("BungeeCord", outBytes.toByteArray())
);
i'll go test it
that will send to one server in teh bungee channel (which you should not really use)
so what should be the channel then?
i thought using "BungeeCord" was the traditional way
your own channel
alrighty
Bungee is for Bungees own use for pre-defined things, nothing you should be intercepting
working properly now. thanks nazarbek & elgar 🙂
Is there a way to synchronize an immediate task with the main thread without using the bukkit scheduler?
callSyncMethod
but for runnables
also there must be a way to avoid this unnecessary CraftTask wrapping
no, not unless you want to use Futures
I mean
Hey, I'm getting an error every time I write a command. I'm using ACF for the command and it basically opens an inventory for the player: console [11:45:53 ERROR]: [SlimeFrame] [ACF] Exception in command: slimeframe relics [11:45:53 ERROR]: [SlimeFrame] [ACF] net.minecraft.server.CancelledPacketHandleException
CancelledPacketHandleException is common
whenever something with a packed is fucked up
I dunno what acf is, but in the traditional channel duplex handler you can override the exceptionCaught method and leave it empty
e
public class commands implements CommandExecutor {
private final Kill plugin;
public commands(Kill plugin) {
this.plugin = plugin;}
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
if(commandSender instanceof Player){
Player player =(Player) commandSender;
ItemStack itemreward = player.getItemInHand();
if(!(itemreward == null)){
plugin.getConfig().set("reward" , itemreward);
player.sendMessage(ChatColor.GREEN + "The Reward has been set!");
}else{
player.sendMessage(ChatColor.RED + "Your slot is empty");
}
its not chaning the value in the config
oh god this is starting to get big
with this
no
wow
pain
and suffering
: (
how do I get the imports for CraftWorld ?
but pls go look at naming coventions
what in the world are you trying to do
dw about it ; )
wait till you learn about !=
ye iam gona change that xD
Bros did biggest java crime ever
plugin.saveConfig();
i did
thanks to epic : )
its working now
public class commands implements CommandExecutor {
private final Kill plugin;
public commands(Kill plugin) {
this.plugin = plugin;}
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
if(commandSender instanceof Player){
Player player =(Player) commandSender;
ItemStack itemreward = player.getItemInHand();
ItemStack air = new ItemStack(Material.AIR);
if(itemreward == air){
player.sendMessage(ChatColor.RED + "Your Slot is Empty!");
}else{
plugin.getConfig().set("reward" , itemreward);
plugin.saveConfig();
player.sendMessage(ChatColor.GREEN + "The Reward has been set");
}
``` wtf is this i set so if the item is Air send the msg but
Bros prob uses more js
if (itemreward.getType().isAir())
eat pant
@small current
indentation looks like ass because notepad++ does 4 spaces or something
new command for the bot ? 🤔
I don't think I can make commands
I'm not telling you to add it
but @ Choco on the other hand
y'all can bother him
it'd make me happy but this is really basic at the moment
there's a lot of code still being perfected that'll go here
I should probably migrate this to the wiki
It doesn't makes sense to me why scoreboard update is a phase
It makes the end code look nicer
Everything should be a phase so that it follows your order
You can still call Game#setScoreboard and it applies the scoreboard instantly
there you go
IS THAT A API ??????????

An*
does anyone here know anything about minecraft mappings
I have heard of them
north is upwards generally
and i only recently learnt that you can change the scale of maps :(
how come hurtResistantTime also gets called when the player is regening
that doesn’t have anything to do with mappings does it? lol
anyone wann explain how this field isn't "Guarenteed" to be initialized I stg this is how it works in later java versions wtf is wrong with java 8
public static final List<String> EXPERIMENTAL_WARNING;
public static final List<String> LATEST_WARNING;
static {
final List<String> experimentalWarning = new ArrayList<>();
experimentalWarning.add("/!\\ WARNING // WARNING \\\\ WARNING /!\\");
experimentalWarning.add("Experimental builds should not be run in production unless you know what you are doing!");
experimentalWarning.add("");
experimentalWarning.add("These builds are meant for developers to test out potential upcoming changes and are EXTREMELY likely to break plugins!");
experimentalWarning.add("You will NOT receive support if you use an experimental jar to run your server.");
experimentalWarning.add("YOU HAVE BEEN WARNED!!!");
EXPERIMENTAL_WARNING = Collections.unmodifiableList(experimentalWarning);
final List<String> latestWarning = new ArrayList<>();
latestWarning.add("NOTE: 'latest' refers to the latest stable version and may not necessarily correlate to the absolute newest version available!");
latestWarning.add("");
latestWarning.add("A buffer window is given to recent releases, giving time for any critical issues to be resolved and any new features to be finalized.");
latestWarning.add("");
latestWarning.add("If you selected latest and did not receive the version you were expecting, select the correct version from the dropdown menu and try again.");`
LATEST_WARNING = Collections.unmodifiableList(latestWarning);
}```
That's MCP mappings from what I can find

Sounds like you need to show us more code
How do you know that it's not initialized
static block initializes it
It gets initialized in the static block.
That doesn't answer my question
yes it is
same for the second one
final there is wrong
couldn't you set arbitrary values if its not final
How's it wrong?
I thought you could do final static and use the static block
I've done it in the past
so why is now any different
You can do that
Now what is the actual problem
How do you know they aren't initialized
that's the problem
intellij is telling me there's no guarentee they are initialized
and its pissing me off because it is guarenteed unless the program crashes are fails during the static block
wait
in the entity Class
Just ignore or do a try catch finally 🤷♂️
the obf entity class is called "Pk"
I guess I'll try invalidating caches, do the static blocks not work like this in java 8?
get cold then
You know you haven't specified version
1.8.9
but yea, List#add may throw
I had a feeling it was that since you appear to use MCP mappings
yes
so you'd have to try catch finally
really that's crazy alr
just use List.of
BuildTools 😭
does that produce an unmodifiable list
yeee
!verify
Usage: !verify <forums username>
bruh just give me pic perms#
Just make a spigot account or upload it to an image page
@chrome beacon hurtResistantTime the field
?img
Not verified? Upload screenshots here: https://prnt.sc/
happens when i regen health too
So why are you here asking about MCP
where do i ask
forge discords?
can i get an invite
at least I think forge are those that mainly used those mappings
I hope you're not about to break MC Copyright by redistributing Minecrafts code
of course not
What exactly are you doing?
why does that matter
Where you should ask for help depends on what you're trying to do
ahh ahh notice how I'm working on BuildTools
I'll just assume you're trying to make hacks and not help you
i am not
how would u make hacks
if i were to make hacks i would just use fabric or forge
you are creating a JNI application for the server using MCP mappings ? 
I am confused
for the server?
Then yea,head to forge or fabric I guess
tho honestly, you are pretty on your own
if you are just making something new lol
well its just a simple question..
Well no idea what that field is called in mojang mappings
just look at the remapped client ?
and figure out why it is changing I guess
where can i find the remapped client
Start MCP?
ye lol
but also like
why the fuck are you using MCP
unless you are on some ancient version
They are on 1.8.9
ah
I mean the question of "why does this client code, released 8 year ago modify this variable" is pretty rough
wher
Update spigot
In your MCP project?
it is not a mcp project
Then create one
i'm on paper
i'll try to download latest
yea works fine
thanks
lmao
@EventHandler public void test(InventoryCloseEvent event) { Player player = (Player) event.getPlayer(); if(event.getReason() != InventoryCloseEvent.Reason.OPEN_NEW) { if(SocialPlugin.getInstance().hashMap.get(player) == "socialEditorInv") { SocialPlugin.getInstance().hashMap.remove(player, "socialEditorInv"); } } }
Why does it throw the Error NoSuchMethod?
Provide the stacktrace
beyond that, comparing strings is done via .equals
not ==
Anyone know what events / mechanics influence XP orbs "tracking" / following the player on drop?
Trying to make a small class that can drop a custom xp orb that wont track anyone but the player who caused the drop
what the heck is InventoryCloseEvent.Reason.OPEN_NEW
I mean... it may just be me but it says it on the tin lol
it gets if the player closes an inventory but it does not count changing it for example in a gui
what is that?
The error
Caused by: java.lang.NoSuchMethodError: 'org.bukkit.event.inventory.InventoryCloseEvent$Reason org.bukkit.event.inventory.InventoryCloseEvent.getReason()'
I am talking about me looking at InventoryCloseEvent and that thing not existing
Which is proved true
could it be that you are running spigot
Yeah I realised it as i wrote it lmao
yes
you are developing against the paper-api
given that that is paper specific API, I'd say yes
You need to run paper if you are going to use the paper-api
This is starting to sound like you need to go back to learning java concepts and the context of the bukkit vs spiggot vs paper. such as the difference between APIs
idk all of my other plugins are working fine, how is that possible even tho im apprently using 2 different apis
👍
So long story short Bukkit came first.
Then Spigot is a fork of bukkit.
Then Paper is a fork of spigot.
because of this
They share a SHIT TONNE of methods
But there are subtle differences here and there
isnt paper the best one then, it got some cool methods?
i heard that it is better perfomance wise as well
can i get banned for saying paper is better?
if you code for paper it won't run on Spigot and you eliminate over 30% your possible clients.
no
yea, the general argument for spigot-api at least is, well paper supports it
so if you code against spigot-api you can run on spigot and paper
guys i think im using spigot and paper plugins, could this be harmful in the long run?
where coding against paper-api means you can only run on paper and its fork
i did not find this discord, i didnt even knew i was coding paper
Respectfully, this tells me you are still quite new to either Java or the concept of minecraft apis. I would humbly suggest you read up on the areas you are not as confident in
all the spigot tutorials i watched worked for paper too
ok, so its not harmful in the long run to use paper and spigot plugins on one server?
well, paper plugins do not run on spigot
if you are running paper, then yea
you can use plugins developed against paper and spigot
Paper is a fork of spigot.
My Playstation 2 could run playstation 1 games.
Doesnt mean im gonna be able to wack FurFigthers into a PS1 and have it work lmao
ok
wdym by "against"
Your plugin uses an/is developed against a server API
in your case, from the looks of it paper
but you could also code against spigot
It likely will in the future. Considering paper's recent actions, it's likely that they will hard fork sometime within the next two years.
For the time being though, if you write plugins using the Spigot API, your plugins will run just fine on Paper.
However if you write plugins using the Paper API, your plugins will only work on Paper.
that all happen at compile time
God thats gonna be a mad time
its the opposite, i write on paper, use spigot on the server
yea that doens#T work tho
Makes me wonder how we as developers will react to it. As I imagine that if it does end up being harder than we assume rn, I imagine one community would likely end up winning out over the other :S
Probably
for the last 3 plugins i created, it worked until i discovered inventoryclosevent
Yea, if you use paper-api but only use methods that also exist in spigot-api
you wont notice it
ok
You are trying to run Crash Bandicoot Warped on a Ps1 my guy
so now the question is, which one is better paper or spigot, which side should i go on with?
They both have their pros and cons
Try both, pick the one you like more
^
spigot server is going to tell you, pick spigot
i mean the inventorycloseevent from paper is pretty charming
paper server is going to tell you, pick paper
Speak for yourself we should all code in bukkit lynx smh
Then grab paper and run with it until you hit something that you don't like
¯_(ツ)_/¯
i still couldnt find the paper discord
damn
Yay shadowmaster is bae
shadow with the balls
delete it shadow, i got it
Welp, I'll be heading out.
*Nah we are actually pretty chill round here
bungeecord
Bungeecord fork
forked
End of the day im still in the spock camp of "we can all be friends, lets just join forces and compromise guuyyyyyys lmao
what paper is to spigot, waterfall is to bungeecord
ok
paper will happily accept contributions from all spigot contributors 
Oh man bungeecord! I loved their game about the aliens and the rings n stuff
God no, other discord is majorly toxic
guys you think i should stay here?
i really hope spigot will remain
I mean ngl I do agree there. But it usually isnt the devs themselves. There are a few select folk who are sketchy as hell
True I tend to send kekw and dogekek
And 99% of em are just randows
by far i think spigot is better than paper
Yeah, i get better performance with spigot. ||/s||
the tone is generally set by the devs/mods
I mean ive not really had that. Like say the utter MEME that was my get holder stuff. When I went to paper with it they did a whole "let sget a ticket open and discuss this" sorta deal that ended up with a pretty productive convo imo.
I think both communities have their... ahem... interesting members... but overall both sides are just nerds who wanna make cool stuff in MC ❤️
True, paper is full of fucking nerds
terrible to work with
Anyway @river oracle is your build tools GUI going to be a separate project or are you working on build tools. I'd love to sugges a few other things taht could go into build tools
Ive never had much of a problem with em tbh.
I think leigitimatly it comes down to the fact the stuff they do is god tier in terms of functionality. But the reason they probably forked off in the first place was due to how they approached adressing legitimate issues.
Ive had a fair brunt of "i am right and you cant convince me otherwise" but... tbh.. ive expreienced that in paper and spigot lol
how could you credit the wrong person
oh
anti nerd
are you working on it xD
ah
What is it?
do you know if it targets the buildtools project itself
it does
What is it exactly?
If people touch build tools, I'd really would not mind like, an in built runDev
GUI frontend for the noobs.
Oh thats pretty neat
Im still on the edge of doing my "inventory menus app that works like scene builder for javafx" idea lmao
You can find the dev builds in https://discord.com/channels/690411863766466590/1117702470139904020 if you want to use it early. We are pretty much just cleaning up the code before we create the PR.
Wouldn't be opposed. :3
Javadocs for buildtools?

It probably wouldn't hurt considering that it's now going to be something that has to be maintined.
All that GUI code go brrr
:L might have a gander after this weekend. Currently waiting for our final PR on my teams library project
where is the branch for it ?
Im here like
for the BT interfacce
It's on the stash. My fork has the GUI changes, Y2K's branch has the code cleanup.
You not got a development branch?
lmao
We have this funny thing.
BuildTools > Coll's Fork > My Fork > Y2K's Fork
collins
@young knoll hi collin
fuck off
no
blame him
Man you guys are right, paper is much more toxic
dont tell me velocity is a fork of paper
younger coll couldnt spell cool so its coll
they are in their own little corner
why
I thought they were a fork of waterfall. ¯_(ツ)_/¯
*it was a joek
jeok
l
y
n
toxic
I thought they were a spoon of roblox

❤️
fuck
who
So back to dev help....
What are the events / general classes that cause exp orbs to track so differently to other items
me 
owo
what about choco
oh trueee
poor tableless man
So many people without tables 😭
hm ?
exp orbs are not items whatsoever
Sorry mb entities then :L
Though it does explain my queston haha
Well, they have logic to merge themselves
drop your suggestoins in #1117702470139904020 I'm reimplementing everything rn as form builder really makes the code not maintainable at all
What about the tracking to players?
I can probably just add your features as I go
I doubt it makes a lot of sense in the GUI PR
I was just wondering if we now have people that know BT code
we might see some improvements to the tool
Yes. 💀
I know more about it than I should.
like spigotclip
Yeah I was thinking of cleaning up the rest of it but its out of scope
i would love spigotclip
spigotclip 
maybe later
Why are you guys not just PRing into a universal development branch and then PR the whole thing in one go so you have full traceability and can test all ur bits n bobs together beforehand?
managed internally
Noooooo! xD
Yea, its part of the exp orbs tick logic
God damn it.
Oh shit it does? Perfecto
Yea
Gotta Love Java
gotta go back to school
Idk, this is like the second time I have ever used git on a project with other people. Idk how any of it works. Plus, I commit too much. I'd be pissing everyone off if they are working off of my changes. :p
GO TO THE CHURCH! AND ASK GOD TO FORGIVE YOU!
My brother in christ you need to learn github work flow
were all going to hell
yes
We just did it for our library and it came in clutch! Plus gives that super mega dopamine rush when you see all of em merge into development ❤️
I have serious doubts about all those needing to be public haha
why should they not be public?
Well i mean, how are they utilised? Its a rare day to see a class like that with no internal logic
I'd need someone to explain it to me because the tutorials don't do anything for me. No one explains the nuances. Like, when do you need to create a branch? How many should your branches be used to structure your project? How do you deal with multiple people working on the same branch? How does one get updates from a specific branch instead of the master?
No one covers these for some fucking reason. Aren't these the things you should be teaching in a tutorial?
First of all, they logic is folded in so you cant see any, but this class is the way for me to check the status of an arena, in what stage it is, push it to the next stage, get the next stage etc.
Basically every feature should have its own branch, no branch should have cross over. Usually its one person per branch in smaller projects, you dont get updates from branches. Once you know you cant proceed without functionality from another branch, youve already goofed up some of your develppment plan. But in those cases you get everything that can be completed in that branch done, merge with development, wait till the other branch is also done with everything possible on its own, merge with development, then make a new branch from that point.
E.g: If you are in branch A but need a feature from branch B, then you get Branch A merged with Dev branch moment everything possible is done (with TODOs set up), wait for Branch B to do the same, then you re branch for the new features.
To make Branch C
If you are grabbing shit from branch B and sticking it in Branch A, youve sorta missed the point of having seperate branches
There are rare occasions where two people work on same branch
E.g:
Out branches for our library:
TCCL-12 rework was a separate approach the dev wanted to take with TCCL-12 but didnt wanna screw with the already near complete TCCL-12.
So he branched off of TCCL-12
And then remerged back into it when done with the rework
*TCCL-14 was commands
We originally named the branches after our you track task IDs but went for a more obvs approach in the end
ALso as a side note: Branches saved my ass when I had a 1am oopsie:
Lmao.
If I hadnt done the branches using proper workflow, i'd of likely accidentally bricked the project hard
Ok, I get branching off of each other for changes, but instead of trying to merge back into the branch you originally branched off of, you want to merge into master?
The idea is if you do it into a development branch, the master is ONLY changed (hence deployed) when all the features have been tested when integrated together
Imagine you merge changes straight into the master and it fucks it up
bad bad ju ju
Just cause a merge succeeds, dont mean it wont cause ungodly errors
how can i add TabCompletions depending on the command? is it TabCompleteEvent#getBuffer for getting the command inputted?
Yea, I get that. I've seen the memes and heard that you shouldn't be working on the master branch directly.
How could the workflow be improved with our setup?
If you refer to the chain I said earlier, we have just been branching off of each other, but merging back into the original branch.
Meaning that, Person 1 commits their changes, Person 2 takes over and makes their changes, then Person 3 takes over and makes their changes. Once person 3 is finished, they merge back with person 2, person 2 merges back to person 1, and person 1 merges to master.
Argument length.
wdym?
The same way you'd check argument length in your command.
if (args.length == 1) {
// Fill completions for when the command is ready for the first argument.
}
@livid dove ^
no i mean by using TabCompleteEvent
not on the CommandExecutor
TabCompleteEvent#setCompletions()
yes but i want to do it after the user has entered the command
if that was the case, then when they press "/" they are gonna get "LAVA_DRIP, WATER_DRIP, FLAME, NOTE, CRIT"
public class TabCompleteListener implements Listener {
@EventHandler
public void tabListener(TabCompleteEvent e){
}
}```
this is the class i have
and then i can add this class i made inside the setTabCompleter(...)?
Yes
ok alr thx
Would it be appropriate to ask a question about an implementation detail regarding the biome format in 1.15 (which i assume is also relevant for the biome format in 1.19)?
Specifically, the wiki mentions the 4x4x4 biome blobs are laid out in the integer array as follows:
These 4×4×4 volumes are arranged by Z, then X, then Y. That is, the first 4×4 values in the array are for the 16×16 chunk, at Y levels 0–3, the next 4×4 is for Y levels 4–7, etc.
Does that mean to get the position of a blob in the array i need to calculateindex = z + 4 * (x + 4 * y)? The thing is, i am reasonably certain the blocks are laid out x first, then z then y, so for blocks the calculation would beindex = x + 16 * (z + 16 * y). I don't see why there should be two different approaches to calculate this. So am i misunderstanding the wiki or is it actually different (or did the method to calculate the index for the blocks change, too?)
what item could i use in a GUI to indicate account sharing? boosting? ban evasion?
is there a way to convert an enum list into a string list
and by list i mean ArrayList
take Enum#values() and collect them into a list
no i dont want all of them
stream and filter
elgar, any creative ideas on this?
i've worked for 11 hours today my mind is drained lol
i have a list in my main class that says which particles are allowed as trails
and i want to put those allowed trails in the setCompletions
uhh show your code
map(foo -> foo.toString())
Call that on enum list stream
my code is ugly and i will probably get banned for it but anyways
public final class IranSkyTrails extends JavaPlugin {
ArrayList<Particle> trailsList = new ArrayList<>();
HashMap<UUID, Particle> trailedPlayers = new HashMap<>();
private static IranSkyTrails plugin;
@Override
public void onEnable() {
// Plugin startup logic
plugin = this;
trailsList.add(Particle.FLAME);
trailsList.add(Particle.NOTE);
trailsList.add(Particle.CRIT);
trailsList.add(Particle.DRIP_LAVA);
trailsList.add(Particle.DRIP_WATER);
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
public ArrayList<Particle> getTrailsList() {
return trailsList;
}
public HashMap<UUID, Particle> getTrailedPlayers() {
return trailedPlayers;
}
public static IranSkyTrails getPlugin() {
return plugin;
}
}
public class TabCompleteListener implements Listener {
@EventHandler
public void tabListener(TabCompleteEvent e){
e.setCompletions(IranSkyTrails.getPlugin().getTrailsList());
}
}
dont mind the plugin name. its a private plugin for my server
in the future for text walls please use ?paste
that pastebin doesnt work for me
?paste this doesnt work for me
then use pastebin
sam
Hey, I asked it earlier but I still have the problem and idk how to solve it. The following error is thrown when I run a command I set up using ACF (a framework for commands). Here's the command that throws the error java @Subcommand("%inventory") @CommandPermission("slimeframe.anyone.inventory") @Description("Show your relic inventory") public void showRelicInventory(CommandSender sender) { if (!(sender instanceof Player p)) return; RelicInventory relicInventory = relicMan.getRelicInventory(p); Bukkit.getScheduler().runTask(plugin, relicInventory::open); } and here is the error thrown: ```console
[11:45:53 ERROR]: [SlimeFrame] [ACF] Exception in command: slimeframe relics
[11:45:53 ERROR]: [SlimeFrame] [ACF] net.minecraft.server.CancelledPacketHandleException
e
bin.bloom.host
huh
use it then
if nothing works for you
but don't resort to filling the entirety of the visible channel with a snippet of code
lemme try this
what item could i use in a GUI to indicate account sharing? boosting? ban evasion?
theres no such thing as MAP
map is a function of stream
Boosting: EXP Bottle/Netherite Smithing Template
Account Sharing: Prismarine Crystals/Nether Quartz/Sweet Berries
Ban Evading: Iron Bars/Chain/Axe
seems good, ty
stream is an interface
List#stream
?
looks good to me
wdym by foo? what should i replace it with
oh alr
it gave me a Stream instead of a ArrayList<Particle>. should i cast it to ArrayList?
idk if thats possible
Just call toList at the end
nope
.toList()
oh ok
^
So ur using old java version, call collect(Collectors.toList()) instead
Oh, change project sdk in project settings
CancelledPacketHandleException
That tag doesn't do anything unless you use it in the build section.
You likely want these instead.
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
where do i put them?
Under the <properties> tag.


