#help-development
1 messages · Page 1542 of 1
So java serialization, not Bukkits
yep
Why does your name reminds me "cactus"? đ€
magyar anyad kurtoskalacs
It all depends on what is in yoru class. Every class must implement serializable
Hmm. SzĂłval nem vagy magyar, de tudsz magyarul? đ€
I can't speak magyar that's the only words I know lol
Ezek szerint Te egy Magyarorszåg szomszédos orszågaiban élsz.
I have:
CustomBlock implements Serializable, which does have a readObject
DurableBlock extends CustomBlock, which does not have a readObject
MultiblockBlock extends DurableBlock, which does have a readObject
I tactually means "Hungarian your mother" and can't remember the third word. đ
(the "turtoskalacs" one)
the last one is chimneycakes
an Object which extends a serializable Object will implement its supers readObject
but all fields must be primitives in the extending class
are other Serializables allowed?
yes
and no statics
yep, same as transient
sweet
Is there anyway to speed up the initial build time?
have less code đ
Best awnser of the year
Unfortunately that's not something I have control over
builds for java are pretty fast
but the best option is modularization so you can build multiple modules at once
Can someone tell me why this doesnt work
^([a-z][A-Z]){1,32}$([0-9]){1,4}
a#0001
why $
yeah why $
and [a-zA-Z] is how I see everyone do alphabet check
no reason to make 2 sets of characters
^([a-zA-Z]){1,32}#([0-9]){1,4}
With those 2 changes it works for me
^
can then remove the first grouping of () since you only have 1 character set matching
\d instead of [0-9]
and there has to be 4 lol
@eternal oxide just tested and can confirm you were right đ Do you know if the serial version UID also inherits from the superclass? I don't want it changing whenever I add or remove a field, cause apparently java will handle those automatically as long as it's not a rename or type change
basically its just to make so when you look at a player it does damage, then damage is exponential. Its a bukkit runnable and one of these is running for each player on the server. For some reason, where it says bukkit broadcast, it broadcasts the same variables twice before they change based on time. And yes I know the equation is still messed up, I'm currently trying to fix that aswell, but I dont need help for that
its possible to chaneg the texture of items with custom names, but is it possible to change texture of item with custom lore?
CustomModelData?
ok thats strange , cuz if i export the same code as a maven executable the stuff worked flawlessly
but when i put the same code in a plugin
it keep throwing error
[09:19:30] [Thread-38/WARN]: ai.djl.engine.EngineException: No deep learning engine found.
[09:19:30] [Thread-38/WARN]: Please refer to https://github.com/deepjavalibrary/djl/blob/master/docs/development/troubleshooting.md for more details.
[09:19:30] [Thread-38/WARN]: at ai.djl.engine.Engine.getInstance(Engine.java:114)
[09:19:30] [Thread-38/WARN]: at ai.djl.Model.newInstance(Model.java:71)
[09:19:30] [Thread-38/WARN]: at ai.djl.Model.newInstance(Model.java:60)
[09:19:30] [Thread-38/WARN]: at me.hasunemiku2015.buildingai.DataHandling.MLProcessor.lambda$init$0(MLProcessor.java:27)
[09:19:30] [Thread-38/WARN]: at java.lang.Thread.run(Unknown Source)
the stuff worked fine in a standalone maven executable
i tried all the methods provided in the md , none of them work
do you deal an additional half a heart when you hit someone with a hoe?
answer: you dont
. .
is anyone familiar with custom models
"parent": "item/generated",
"textures": {
"layer0": "item/uncraftable_tipped_arrow"
},
"overrides": [
{"predicate": {"custom_model_data":101938483}, "model": "item/garlic_arrow"}
]
}```
so whats the difference between parent and textures
they define the original texture of the item
that im using a custom model on?
Okay so
Tipped arrows just donât fucking work from what I understand
Iâve done a lot with custom model data, and no configuration Iâve made has been successful
Also, I recommend not having long CustomModelData IDs since itâs floating point and some values do not exist. Just start at 1 or 100 and go from there
floating point???
well
i'm like, 99.9% sure it's an integer
wdym
tipped arrows cant have custom model data?
Any tinted item doesnât seem to support it
tinted item?
Yep
Also about the float thing, I might be holding on to some misinformation from a long time ago lol
different color?
oh yea thats right
does it?
wait no
the uncraftable arrow
is only pink
Itâs all the same thing, any of them can be colored
Theyâre all tinted by default
You can change that tint but it doesnât change the fact that itâs tinted
But to answer your other question, parent determines how the item appears in the hand basically
generated makes it appear like a normal flat item
handheld will make it appear held like a tool
in the hand?
they are all the same?
all items?
Yeah
well then what is it determining
that
tinted arrows?
Item name, PDC, color, anything
with custom models?
I donât know if those use those arrows
what the author is Choco
XD
Mr. Choco, approve my premium resource~~~ Mr Choco, bring me money!!! --Lax
Just tear apart his resource pack lol
I was never able to get tinted items working but then again, I was pretty stupid last I worked with it
Is there a resource pack with that plugin?
It might just have custom model data support but not a sample pack
But Iâm not at my PC so I canât check
Parent stays as generated
category of the original item
Yup
or blocks/generated
Items
okay
item/generated*
okay thx
In fact, you donât really need to mess with the parent there
and for textures i put the category and name of the defualt item texture?
hey guys im new to coding java but i have a question about my code
youâre going to need a garlic_arrow.json in your models/item folder
i do have it
?justask
any idea why this isnt spawning in a slime? everything else works fine:
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.Slime;
import org.bukkit.util.Vector;
public class SpawnGerry implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
Player player = (Player) sender;
Location location = player.getLocation();
if (player.getWorld().getName().equalsIgnoreCase("flat1")) {
player.sendMessage(ChatColor.DARK_GRAY + "" + ChatColor.BOLD + "[" + ChatColor.RED + "" + ChatColor.BOLD + "MCBT" + ChatColor.DARK_GRAY + "" + ChatColor.BOLD + "]" + ChatColor.GRAY + "Gerry is approaching...");
Entity ent = Bukkit.getWorld("world").spawnEntity(location, EntityType.SLIME);
Slime slimeboss = (Slime) ent;
slimeboss.setSize(10);
slimeboss.setVelocity(slimeboss.getLocation().getDirection().getMidpoint(new Vector(0, 1, 0)));
player.setVelocity(player.getLocation().getDirection().getMidpoint(new Vector(0, 1, 0)));
} else {
player.sendMessage(ChatColor.DARK_GRAY + "" + ChatColor.BOLD + "[" + ChatColor.RED + "" + ChatColor.BOLD + "MCBT" + ChatColor.DARK_GRAY + "" + ChatColor.BOLD + "]" + ChatColor.GRAY + "You can't spawn this boss in your current world");
}
return false;
}
}
i also have garlic_arrow.png
so I have iPlayer.setKills(playerData.getInt("kills.amount")); in a class right and im doing iPlayer.getKills() in a different class. How come when I do get a value of 0
heck beat me too it haha
hah?
what is this
is this acommand
yes
I donât quite recall the structure since I kind of copy pasted it over and over again, but that sounds about right. You have your uncraftable_tipped_arrow.json, right?
Thatâs the original json structure you sent I think
its a command just for now haha
yes
wait no
my main.java is ```package com.mcbt.superflat;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
@Override
public void onEnable() {
System.out.println("Poggers loaded");
getCommand("sethp").setExecutor(new SetHpCommand());
getCommand("heal").setExecutor(new HealCommand());
getCommand("spawngerry").setExecutor(new SpawnGerry());
}
{
}
}
everything else works
is it not in the default pack
ok give me a second
@digital plinth I can help you get this set up tomorrow when Iâll have my PC if you donât end up figuring it out tonight
also i dont think any of the code u have here will be called
no it is called
it sends the message to the player
what was your idea?
thank you
im always open to learning new stuff anyways haha
check the difficulty?
no for like this
also slimes spawn in peaceful dont they?
oh i was gonna suggest sout of broadcastmsg
for debug
anyways the difficulty is easy
but since you ahve the .sendmsg
nope
just says i issued server command /spawngerry
launches the player too
im using 1.17 paper
so when you run the command it sends "genry is approaching" and then nothin happens
ahh so its paper's fault atm?
or
spigots?
somewhere along the line its not recognizing that got it
so i should program in 1.16.5
might be
Are you in a worldguard region
nope
okay put a sout like in the code
Or using some other plugin that would block spawning
eg: after creating the entity
aight
Entity ent = Bukkit.getWorld("world").spawnEntity(location, EntityType.SLIME);
after that
see if the code below it runs
oh it does
player.setVelocity(player.getLocation().getDirection().getMidpoint(new Vector(0, 1, 0))); runs
yeah im in that world
And then spawning the slime in a world called world
yea
OH
ohhh
THANK YOU
đ
đ
đ
sorry about that guys! thank you so much for the help
Coll is a genius
coll truly is
update?
setKills
what kind of method is that
custom method?
yml
File playerKiller = new File("plugins/Core/PlayerDatabase", File.separator + uuid + ".yml");
if (!playerKiller.exists()) {
playerKiller.createNewFile();
}
FileConfiguration playerData = YamlConfiguration.loadConfiguration(playerKiller);
if (playerData.get("kills.amount") == null) {
playerData.set("kills.amount", 1);
} else {
int kill = playerData.getInt("kills.amount") + 1;
playerData.set("kills.amount", kill);
}
playerData.save(playerKiller);
if (uuid.toString().equals(playerKiller.getName().replaceAll("\\.[^.]*$", ""))) {
iPlayer.setKills(playerData.getInt("kills.amount"));
}
here this may help
Why would a uuid put through that replace regex equal their name
NOOOOO my custom model data didint work
YYYYY
does anyone know what i should put in the Textures
ITS NOT THEIR NAME
change the getName method to something like getId Or you are going to constantly have this confusion.
then change teh variable name
no I like it
killerFileHandle or anything that is a better representation
ok happy
Why not just save the uuid directly as a string
Anyway
Are you sure you have the same reference in both classes
yea
need it for a script?
in bukkit???
if the server is down the plugin is not enabled lol
or are you asking about bungee
well it won't run if the server is offline, sooooo
are you wanting like a plugin that runs on the hub server that would check if the other servers are running?
Thx
Or use something like HikariCP which will log disconnections as far as I know
Unless you are implementing a pool, there is really no reason for checking if a mysql connection died because the way you would code the connection code would check if the connection is there or not first and then re-establish connection again
Hey quick question: Does anyone know how to query in a gui or an inventory whether there is a certain item in a certain slot?
Get the item in that slot and do a standard comparison
okay but how can i get the item in that slot?
okay thank you very much
Hello i need help in my first plugin make basic, i getting this error
package org.bukkit.configuration does not existïżœ
someone know how to fix that?
You shouldn't need the actual package for it, you just need to add it as a dependency and just import it
Are you using the spigot API? Have you included it in your pom/imported it?
sco = Bukkit.getServer().getScoreboardManager().getNewScoreboard();
obj = sco.registerNewObjective("Stats", "s", "s");
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
obj.setDisplayName(color("&7[&fTribe Wars MyStats&7]"));
Team wins = sco.registerNewTeam("wins");
wins.setPrefix(color("&eWins:&f "+Main.sql.getWins(uuid)));
wins.addEntry(ChatColor.GREEN + "" + ChatColor.WHITE);
obj.getScore(color(ChatColor.GREEN + "" + ChatColor.WHITE)).setScore(6);
Team tkills = sco.registerNewTeam("tkills");
tkills.setPrefix(color("&eTotal Kills:&f "+Main.sql.getTotalKills(uuid)));
tkills.addEntry(ChatColor.GREEN + "" + ChatColor.WHITE);
obj.getScore(color(ChatColor.GREEN + "" + ChatColor.WHITE)).setScore(5);
Team lkills = sco.registerNewTeam("lkills");
lkills.setPrefix(color("&eLast Fight Kills:&f "+Main.sql.getLastFightKills(uuid)));
lkills.addEntry(ChatColor.DARK_AQUA + "" + ChatColor.WHITE);
obj.getScore(color(ChatColor.DARK_AQUA + "" + ChatColor.WHITE)).setScore(4);
Team bkills = sco.registerNewTeam("bkills");
bkills.setPrefix(color("&eBoss Kills:&f "+Main.sql.getBossKills(uuid)));
bkills.addEntry(ChatColor.YELLOW + "" + ChatColor.WHITE);
obj.getScore(color(ChatColor.YELLOW + "" + ChatColor.WHITE)).setScore(3);
Team tdeaths = sco.registerNewTeam("tdeaths");
tdeaths.setPrefix(color("&eTotal Deaths:&f "+Main.sql.getTotalDeaths(uuid)));
tdeaths.addEntry(ChatColor.RED + "" + ChatColor.WHITE);
obj.getScore(color(ChatColor.RED + "" + ChatColor.WHITE)).setScore(2);
Team ldeaths = sco.registerNewTeam("ldeaths");
ldeaths.setPrefix(color("&eLast Fight Deaths:&f "+Main.sql.getLastFightDeaths(uuid)));
ldeaths.addEntry(ChatColor.WHITE + "" + ChatColor.WHITE);
obj.getScore(color(ChatColor.WHITE + "" + ChatColor.WHITE)).setScore(1);
I have this code. When executing it, I see a scoreboard but with only 5 entries instead of 6. (Wins are missing)
Can anyone see my mistake?
Also when I switch the part with Team wins with the Team lwins, everything gets shown instead of the Total Deaths lol?
nvm found my mistake
Hi I need help
Im implementing another plugin as an api, but eclipse doesnât autocomplete anything
Are you using maven?
It used to, when I was a serious plugin maker, but now not even the default spigot methods get completed
Im just using the spigot1.8.8 jar file
Not sure about maven cuz I just got back into plugin making after some time
Oh I use Eclipse
But when I used eclipse in the past it fid autocomplete
Ok
My brother (the server owner) is an old timer and doesnât want 1.17 or anything⊠even if I removed the combat timer
Hey guys I am pretty new to Protocol Lib and I'm running to some issues. I am looking at the documentation for the Team packet https://wiki.vg/Protocol#Teams (spigot PacketPlayOutScoreboardTeam) but I am getting a weird error. The second field in the packet is a byte which determines the structure of the following data. I looked at the spigot source and it is in fact reading a byte after the team name (in 1.17 its PacketPlayOutScoreboardTeam line 52), but when I try to write a byte I get the following error in my console:
com.comphenix.protocol.reflect.FieldAccessException: No field with type byte exists in class PacketPlayOutScoreboardTeam.
This is my code to send the team packet: ```java
PacketContainer packet = pm.createPacket(PacketType.Play.Server.SCOREBOARD_TEAM);
packet.getStrings().write(0, "transparent"); //Set packet's team name
packet.getBytes().write(0, (byte) 3); // Set the packet type (add entry) - CAUSES THE ERROR
packet.getIntegers().write(0, 1); // Number of strings in the following array
packet.getStringArrays().write(0, new String[]{player.getDisplayName()}); // Array of entries
try {
pm.sendServerPacket(player, packet);
} catch (InvocationTargetException e) {
e.printStackTrace();
}```
any help would be much appreciated Please ping me
Yes
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.14.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
if you're typing import org.bukkit.configuration; it's going to throw an error because that's just a package and you aren't including any class/interface, if you want to include all the classes/interface from the package type import org.bukkit.configuration.*; (the wildcard must be there) but it isn't suggested to import everything, if you just want to use the config use import org.bukkit.configuration.Configuration;
when i try use conf.Conf;
it throw the error i sent above i didnt type only conf
conf.Conf; is still wrong, you need to import the whole thing, org.bukkit.configuration.Configuration, do other imports from the API work ?
for (int i = 10; i > 0; i--) {
if (parkourLeaderboard != null) {
if (parkourLeaderboard.size() >= 10 - i) {
new Hologram("" + ChatColor.DARK_GRAY + (10 - i) + ". " + ChatColor.GRAY + parkourLeaderboard.get(10 - i).replace("null", "N/A") + "s",
new Location(world, x, y + (increment * i), z));
continue;
}
}
new Hologram("" + ChatColor.DARK_GRAY + (10 - i + 1) + ". " + ChatColor.GRAY + " N/A - 0.0s",
new Location(world, x, y + (increment * i), z));
}```
why is this saying
Is there a doc about spawning a npc?
exaggeration btw
are you sure it should be 10 and not 9 and be above 0 and not above or equal to ?
i mean i type:
import org.bukkit.configuration.Configuration
do other imports work fine ?
can I see the full stack and trace ? which line throws the error ?
?paste and use this please đ
Does anyone know how to spawn a npc? (I searched on google, didn't work...)
do you mean a custom one or just an NPC ?
Yes
Custom
that's really weird, can you upload your class? or at least part of it? that contains the imports?
.
Ping me
i-
package pvp.pvp;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;
import pvp.pvp.commands.Test;
import java.io.File;
import java.io.IOException;
public final class PVP extends JavaPlugin {
public static PVP plugin;
private File customConfigFile;
private FileConfiguration customConfig;
@Override
public void onEnable() {
plugin = this;
createCustomConfig("derpy.yml");
this.getCommand("test").setExecutor(new Test());
}
@Override
public void onDisable() {
}
public FileConfiguration getCustomConfig() {
return this.customConfig;
}
private void createCustomConfig(String file) {
customConfigFile = new File(getDataFolder(), file);
if (!customConfigFile.exists()) {
customConfigFile.getParentFile().mkdirs();
saveResource(file, false);
}
customConfig = new YamlConfiguration();
try {
customConfig.load(customConfigFile);
} catch (IOException | InvalidConfigurationException e) {
e.printStackTrace();
}
}
}
what is the exception exactly
the full stack trace please
Update: I figured it out. Not at all what I thought would do it, but looking back at the spigot code it kind of makes sense? anyways here is my code: ```java
PacketContainer packet = pm.createPacket(PacketType.Play.Server.SCOREBOARD_TEAM);
packet.getStrings().write(0, "transparent"); //Set packet's team name
packet.getIntegers().write(0, 0x03); // Set Mode to 0x03 (Add entity)
packet.getSpecificModifier(Collection.class).write(0,
Collections.singletonList(player.getDisplayName())
); // Add name strings to a collection
try {
pm.sendServerPacket(player, packet);
} catch (InvocationTargetException e) {
e.printStackTrace();
}``` Apparently this works and I also did not need to include the length of the array because the collection takes care of that for me.
That the main class
the stack trace is the error it's throwing đ
Oh, wait
there is no guarantee that the world named 'world' is located at/world
use server.getworldcontainer or something
also
you can't force unload chunks
also
unloading the chunks doesn't unload the world
also
you can't unload the primary worlds
unload the world itself
for that, you need to create a new world that isn't a primary world
you can not unload the primary world
đ€Ł that was a pain in the ass to deal with
F got a ping :(
iam trying to make a prestiege system , i guess this is the best way
didnt finish it , and didnt test it ..
but before i proceed with it can anyone tell me if its the best lagless way?
i asked for help first so..
oh yeah sure sorry
strauss tutorial for a ban plugin you say, well ideally youâd need to have some sort of set to keep track of banned players
or maybe just load from a file on the async pre login event
If you want to offer some memory for better performance in terms of speed, you could go with a Map there
getting help isn't some sort of queue, if people know how to help you they will help you
Not sure how the whole system works, but for a less laggy way, I would create a gui and have the players click something instead of checking their score every time they kill a player.
Also for the record finish it and test it
So the command would have to put the specified player in a list. When joining, it should then be asked whether this player is in the list?
and if the player is in the list, do you kick him from the server directly when he joins?
When a players gets banned -> save it somewhere (uuid, date and what ever else you want), when a player joins -> check the placed you saved the bans to see if it includes their uuid -> if it's included, kick him
Donât get me wrong but you would use a Set then
Although preferably just skip that part
what do you mean with set?
learn java
A set is a collection of objects where every object in that collection is uniquely distinctive from any other object within the same collection
so it doesnât allow duplicates with other words
Oh ok thanks
a Map with player uuid?
Actually you probably donât need to optimize performance there
iirc long switches get compiled to maps
mysql ..
Dear lord
Have you added the repository ?
F it ,I don't know how those tags works -.-
hey I made an inventory where most of the slots are filled with glass,
so i made an array with the slot numbers , is there something like inv.setItems() or do i need to loop over the slots and put it with inv.setItem()?
np
yes iterate through
okay
or .toList(T[] a).forEach(Consumer b)
uhh seems difficult that last one
consumer is just a functional interface which you can express in a lamba like element -> watever you wanna do with that element
fk that's not a really good explanation
just do for loop lol
xd
guys, let's say i have a chest shop plugin that I want to store sth, like pending transaction messages, into database
do yall prefer:
- retrieve all at plugin enable, storing it in-game, save when server stops/disabling plugin
- retrieve and save in real-time/immediately
maybe pending transaction message is a bad example, say sth that we will need to query from the database and with the result, execute sth in server thread
don't do network IO on the main thread
ofc not
then it doesn't matter
which would you have picked
Guys was the invincible ender crystal bug patched in spiggot 1.17 too or only on paper.
#help-server better for this imo
assuming it is bound to a player, i'd probably preload it during async prelogin
if not, i'd probably have the command or whatever requires the query to complete to wait off the main thread until the query completes
does any1 know what "Qlutch" is xD
hmmmmm
seems like its kinda malware
found someone who injected one of my plugins with it xD
does spigot have a ticket system?
basically I looked through my purchases of my teams plugins and i have linked a purchase, spigot ID and name to a leaker from what it seems
i should start leaking plugins
but must first have money for plugins to leak ;-;
money isn't an issue
i have money
i just don't want to give it to the disgusting capitalist swine who sell plugins
Hope a mod sees this.
can someone help me identify if this is a virus/trojan
https://www.spigotmc.org/resources/pixelonmap-revision.93319/
this guys claims its a imageonmap reborn that works for 1.17 and he have a link to the original github, I installed it its a 1:1 copy of the imageonmap with no improvment, same error same lines of code, than what's the point of this single upload and the fake review? a trojan probably?
I scanned it with antimalware.jar and it says it could be a false positive
I reported it to sipgot
@vagrant stratus that is prob a thing for you
Was just gonna comment it đ€Ł
fishy upload I know for sure optic fusion said it will take a long time to work on the new version cuz of 1.17 changes, than this dude reupload, probably a trojan
or it's actually working, certain plugins update faster than others đ€·ââïž
I'd have to look đ
One of my own resources don't need any changes and can work from 1.17 to a certain old version. If i were to support a specific event it could work on even older versions
didn't work
This plugin contain a backdoor
^ thanks, that's what I though
time for a restart I hope it didn't inject to another jar
You can decompile it
Ah, i just looked at the jar myself :p
I knew it đ
Like the back door
but guys am I safe for just deleting it
or should I replace every single jar
just to be safe
few different malicious commands
Stupidly simple to add a detection method to my Anti-Malware command
Just delete the plugin
I did thanks
but damn I am smart, I knew it was fishy
I reported to spigit but please report again so they can really look into it, they might think I am just trolling
I reported it
thanks man
Some people just want to earn a bit from their hard work that they put into it instead of working at a supermarket or what have you
Who the heck names the backdoor backdoor
You'd be surprised
We got a UUID!
ab044426-bfe4-4347-842b-6fb5e9dda265 -> Meecka
did he at least obfuscate it a bit?
đ what an idiot hahaha
A 0 for effort, that's for sure
Most malicious plugins don't have obfuscation đ€·ââïž
@vagrant stratus do you know what "Qlutch" is?
ye, ran into it a few times already
what does it do?
malware, variety of malicious commands
ah
found someone who injected it to a copy of my plugin and uploaded it somewhere lol
I remember a plugin on spigot that had a force op. Instead of removing the resource staff just put a warning on the resource page saying it has a force op in certain versions xD
Lmaaaao what
x)
I've got no words
not the first time
Yeah it was a kingdom plugin. When I get on PC later I'll see if it's still up
there was what... 73 others i found..
Does any1 know how i could do something like that:
with colors and placeholders
like the stock banners on websites yk what i mean
Do you have any mods?
no need it with plugins or texturepack or a combo
With hidden armor stand whoes are teleport each tick to be placed on the top screen of the targeted player i think @rocky glacier
ew
that would cancel every interaction, block place, hit (...) the player could make
a free plugin?
would use a custom texturepack and modify the bossbar
ya
what the fuck
oh ya thats a good idea ty
googled for my plugin and found it. had to laugh xD
and why would anyone get plugins on shady sites
"literally took under 5 minutes to inject"
for a free plugin
is there any simple way to raycast or do i have to make my own?
what exactly is a raycast
basically shifting a location forward until it hits something
ah nvm
oh
oh
Ray casting is the methodological basis for 3-D CAD/CAM solid modeling and image rendering. It is essentially the same as ray tracing for computer graphics where virtual light rays are "cast" or "traced" on their path from the focal point of a camera through each pixel in the camera sensor to determine what is visible along the ray in the 3-D sc...
uhhh
no there isn't anything like that. you will have to do it yourself
ok
PortalCreateEvent doesnt seem to be called for end portals, is there another way i can achieve the creation being cancelled?
depends on your definition of raycast
There is getSight method
if you mean searching for blocks or entities or shit, there are the World::rayTrace methods and others
semantically not quite the same but practically synonymous
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
can prefix have spaces like this? or no space?
prefix: test 1
Daaam I like this bot, good bot
we know exactly from what prefix you are speaking
plugin.yml
i am editing the fork of unexpected spawn and i wanted to learn coding so
Got tired of discordsrv, made my own https://github.com/Riku32/DiscordLink
What you guys think so far
Based on the screenshots on the git
You want code review or what exactly?
Well based on the screenshots does it look nice
It should?
The design in the screenshots is modifiable (on the minecraft end)
so the formats can be changed actually, those are just the defaults i put
which use the lesser known &x hex thingy
hmm a reimplementation of an enermous plugin by a guy who doesn't know the java naming conventions
I don't primarily do java
dont be mean to the guy :<
i am mean to whomever I deem fit
Riku may I make some points?
I'm not new to programming, I just don't use java often unless its for minecraft and even then its rarely
Yeah sure
Also it was mainly done simply for my needs, I just made it an open project in case I decide to make this a bigger project or if someone else needs exactly what this does (enforces discord integration more tightly)
But yeah I agree i wouldnt trust it if it wasnt mine either đ
- The class constants is weird (with the nested class), I know this is a common practice in other stuff but not in Java.
- For the JDA instance, maybe provide custom executors since a lot of other plugins might be using the common pool.
- frozenPlayers could be a Set<UUID> also remember to follow SOLID (Liskov Substitution Principle) so a
Map map = new HashMapis preferred overHashMap map = new HashMap. - Also pointing out lombok might be trippy to use if others are going to depend on that (without an API?).
There was probably more stuff but this is just some stuff đ
only looked at the first few lines of your main class but your use of Objects.requireNonNull is incorrect as it will throw an exception if it's null, not a check if it's null
Yeah I need to do this more carefully, in alot of cases though things CANNOT be null in those circumstances
I need to look through it more though
If something is wrong i would prefer to throw a simplified error as well as print the exception though in most cases
Hello, i've just moved to 1.17, and, has the way we send packets changed?
cause it gives me some errors
Also yeah I was meaning to give it specific pools, I didn't have the confirmation yet about JDA and if it uses common pool or makes its own tpool, also whats the difference between Set and Hashmap/map, or is Set just an interface that Hashmap implements
if you want it to fail gracefully and give the user a nice error message then you can check if the config options == null before trying to initialise the bot
because the end user won't understand what NullPointerException means
I should also most likely make a config class since some options go hand in hand
I shouldnt be querying YamlConfig in the commands lmao
This was a quick 3 day draft as it stands
Also whats the issue with Lombok or is it one of those super opinionated type things
Set would have constant lookup time as opposed to a List which you use as of now. The map code was an example but usually goes like this,
If S is a subtype of T then S should be substitutable by any other subtype of T.
No I am not talking about using it internally
I mean for interfacing like an API
Imo you shouldnât enforce the Lombok dependency on your api users.
Oh right because lombok uses an intellij plugin to even recognize the fields
đ€Ą
I forgot that
Uh yeah people who donât use lombok will get some source not matching issues and other incompats
bump
I was thinking about moving this plugin over to kotlin(I come from rust, wont be a huge curve)
No
But not sure how people will react to that if it gets popular
Yeah true
Welp id say its ok for a first draft but yeah needs some cleanup for sure
Anyways not too bad (:
can someone reply? It's really important
I said no
In reply to lombok, what about AutoValue which doesnt use plugins and is vanilla?
Or is it simply unconventional to use annotations for that so merge mixups will happen
Havenât looked at that
i see
look at craftserver docs
most people have no idea exactly what changed lmao
thx riku
How can i remove the collison from my custom villager nms entity?
tried setting boundingbox but not workin
the bounding box is reset every tick
entity collisions are two way
if you don't want your entity to collide with another entity, both entities must have collisions set to false
though apparently there is some sort of an exception list now
i've never used it so i don't remember how it works exactly but you could look into it, it might do what you want
dude didn't even check if the very same method they named exists
why
and with what
not a development question
#help-server i guess
Leave Server
what is not a developer question
@EventHandler(ignoreCancelled = true)
public void onBuild(BlockPlaceEvent e) {
if (e.getBlock().getType().equals(Material.MOB_SPAWNER)) {
e.setCancelled(true);
Bukkit.getScheduler().runTaskLater(Main.getPlugin(), () -> {
e.getBlock().setType(Material.MOB_SPAWNER);
e.getBlock().setData((byte) e.getPlayer().getItemInHand().getDurability());
ItemStack i = e.getPlayer().getItemInHand().clone();
i.setAmount(1);
e.getPlayer().getInventory().removeItem(i);
}, 2);
}
}```
I'm trying to make spawners placeable
and it's becoming Pig
that's not how spawners work
\o/
since spawners can spawn any entity, and Item is an Entity. It can spawn any items?
yes
wow
or I believe so
when i place for example Zombie spawner
it becomes Pig if im not OP
im trying to fix this
actually it might only be for certain spawn groups solarrabbit
hmm
i'm fairly sure they can spawn just about anything
back in the day there were contraptions that worked by using spawners that spawned fallingsand entities to build structures and shit
not totally sure about projectiles, though
What im trying to do is make spawners placeable
because for example if i place Skeleton it becomes Pig
Without having OP
that is caused by paper or essentials item filtering
disable it in the settings
which settings?
i don't remember, ask them
im going to #help-server
I think you actually can, imma try it now
the people at help server don't know about paper settings
majority of the people here are bumbling buffoons who couldn't run a server even if their life depended on it
đ
im just going to code
can't restart my server
so basically this is advanced help-server đ
ill do it in code
Hey! So at the moment I am using this as my MOTD class (down there) to set the network's MOTD via a Bungeecord plugin I'm working on, I noticed if I space out the motd text I can get it centred on my screen, but when other screen sizes ping the server, the MOTD is no longer centred.
To fix this, I am looking for a way to set a perfectly centred MOTD every time but I can't seem to find a way to do it. Anyone got any solutions? Thanks đ
Current code:
@EventHandler
public void onPing(ProxyPingEvent e){
ServerPing serverPing = e.getResponse();
serverPing.setDescription("Motd text here");
e.setResponse(serverPing);
}
@SafeVarargs
@SuppressWarnings("varargs")
public static <T> List<T> asList(T... a) {
return new ArrayList<>(a);
}
my life is a lie
asList is just an ArrayList
with capacity set
Im thinking for my plugin i should make a few new classes, PlatformPlayer for example
or PlatformPlugin
Would be cool if I could support both spigot and sponge using those
wat
well worldedit already does this
They need to, I know plot2 does it too
Well, it doesnt implement sponge but has the platform class
Its not, its just not as active
đ€Ą This knowledge might make me entirely move to fabric even for vanilla
I already use fabric in my client
Fabric is a mod API, like FML but entirely server sided in most ways unless you dont want it to be server sided
thats what makes it really good
Forge is pretty much dead
due to its implementations fabric is taking over its popularity
Forge is yeah
i havent used forge since 2017
Forge has LOTS of modpacks on it though
ever since i used rift or fabric
Forge is a lot easier to make big client modpacks for
Stuff with custom models and shaders and stuff like that
Fabric is more client experience tuned
Forge is better if you want modpacks and stuff
Fabric is better if you want client or server side only mods
this is what I've found at least...
Fabric also patches less of vanilla so the experience is closer
surely someone can build this for me, my mvn denies me surely someone can build this for me https://github.com/SelavyXXL/SimplePets
Stop asking in multiple channels
ban
Fabric straight out just replaces a shit ton of bad MC code with close to vanilla results
Which is the good way to do this
someone told me off for asking in general so i asked here
It says how to build it.
then you did something wrong ÂŻ\_(ă)_/ÂŻ
due to its fast maintainability forge will never win the race of releasing first
heck even mods update more quickly on fabric
not because the update taking long on forge side
i did literally everything it says to do
Well it fails to find the PlotSquaredAPI
mvn clean install -f pom.xml -Denv.BUILD_NUMBER=1000 = 5.0-BUILD-1000 -Denv.JOB_NAME=SimplePets_v5
fabric is a bou imo
or not rly
but they piss me off
I'm going to be using Fabric for my lastest gen servers in the next few months
Some would say the other way around
Im gonna make all of my plugins (well... two) have a platform agnostic API so it can be used on multiple platforms including fabric
Well what if I told you Fabric is walking towards what Forge is as of now, for instance all their useless refactors of names with the yarn mappings
That's what I was planning for my private stuff cause I need vers for Spigot, Bungee, and multiple vers
I mean... forge was never meant to be used for regular servers the way bukkit is. Fabric atm is currently still trying to be useful to people who just wanna run a normal server
And its really good for it. Now would i CAN see happening is the same shit that happened to sponge
SpongeForge/SpongeVanilla
Two separate versions that internally functioned differently for different uses
The big reason Bukkit is kind of... outdated right now is the stupid legal shit that happened in 2016 that has left the entire main API in a state of unmoving limbo
đ€Ą
Never change your license lmao
more like just blatant stubbornness to not change anything in fear of causing api breakage and breaking those 1.8 plugins that everybody still totally uses
That is the other reason yes
is this slot 0 or 1?
0
java is zero indexed
okay
all indices start from 0 unless explicitly stated otherwise
tfw some asshat makes skript but with lua instead

Oh actually I thought of something a little stupid but what if someone makes an agnostic API for plugins that uses Graal
Literally write plugins in any language, would be a cool project with a bit of a... skewed practicality
Mr Skull head it still returns 0 even if its set and the file is saved
Lmao
when you forget to to put slot 1 smh
That's interesting
can make an indoor snow with this
What is that glass pane texture holy
idk I thought it was the default one
maybe barebones
ok so far except fishing hook, and player
kinda weird i made a gui and it uses the same clickevents as the previous one
ah its using the same event
hi guys one question, i have a luckyblock plugin and it executes commands in a list, tho i would like for it not to spam in the console, is there a way so i can hide the executed commands by the plugin?
https://www.spigotmc.org/threads/check-if-item-is-smeltable-and-get-resulting-smelted-item.326508 working answer
Woops didn't mean to tag you
Doesn't work
Weird
The above method is exactly the same but like I said... only shows DARK_OAK_LOG
And that method checks the result item for recipes... I want to check if the item is smeltable.
Hi there, anyone know if it's possible to change the mining speed of a block through a plugin?
if anyone knows let me know!
no? or maybe the plugin itself supports it
Yes, there's a few ways but the one I always see the most is a custom system for breaking blocks but it's not the easiest. Not sure if there is an easier way though.
I've a question: is there a way to get the name or something of the inventory in the InventoryClickEvent
bcs i have multiple custom inventories and they all have the same functionality
get the Inventory instance and compare it to yours
and wdyml compare it to yours? they're all the same class the custom ones
when you create an inventory you create an instance
how to get main class's things (that are possibly private) to listener? (using listener registration + without getInstance)
You then make the player open that inventory
dependency injection?
yes
when he clicks inside the inventory the event passes back an Inventory reference
so compare the Inventory to the instance you told him to open
i tried to change the f in false to t to make it true lmao đ€Ł
make Listener Constructor have parameters of main class's things
i am a dumbass
public boolean isSmeltable(ItemStack item) {
Iterator<Recipe> recipes = Bukkit.recipeIterator();
while(recipes.hasNext()) {
Recipe r = recipes.next();
if(r instanceof CookingRecipe) {
CookingRecipe<?> cooking = (CookingRecipe<?>) r;
if(cooking.getInputChoice().test(item)) {
return true;
}
}
if(r instanceof FurnaceRecipe) {
FurnaceRecipe fr = (FurnaceRecipe) r;
if(fr.getInput().getType() == item.getType()) {
return true;
}
}
}
return false;
}
``` Had to add `if(cooking.getInputChoice().test(item)) {`
Is there a list of all spigot server versions somewhere?
wiki page
đ
Player.Spigot spigot = new Spigot();
BaseComponent message = new TextComponent("String");
spigot.sendMessage(ChatMessageType.ACTION_BAR, p.getUniqueId(), message);
console says Not Supported yet
anything wrong in my code?
hi sir or ma'am, can i know if you can have spaces in prefix in plugin.yml ?
Im using spigot 1.17
prefix is a string so i assume thats a yes
thx!!
why...
if you know lua you know programming enough to use java
...
lua is a garbagio language that shouldn't exist
Lua does have oo and is multi paradigm
object orientation
Lua's indexing starts from 1 lmao
deserves to die
^
true
no
Justify
it makes sense for stoopids who dont know computers
This is not spigot-related, but does anyone know how to detect when the mouse has stopped moving in java swing?
however if you are a computer intellectual then you would know that counting starts at 0 because the byte is:
00000000
Can you use KeyListeners for it?
You need to use MouseInputAdapter
so starting from one just is a waste
Yeah either that or temp cache it
Yeah
stuck inside my code tutututut
Anyone have a good resource on patching plugins into a spigot jar?
why would you do that
does that makes sense
to what event should i listen to detect an ender eye placement? blockPlaceEvent doesnt work..
interactevent
Although itâs the first element not the zero element in for instance an array
i thought this was something from @queen dragon
For an easily scalable network server of one game type
True
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html
getItem() != null && getItem().getType() == Material.EYE_OF_ENDER
getClickedBlock() != null && getClickedBlock().getType() == Material.END_PORTAL_FRAME
declaration: package: org.bukkit.event.player, class: PlayerInteractEvent
Nah i wouldn't do that. Just have a buildtools that runs every day and then also download the plugins to the plugins folder with desired config.
I donât want to have to drag plugins into the folder when I deploy a new server, I could write a script to do it, but itâs more about the principle
so you want to have everything in your spigot jar?
yeah he wants his plugins patched into the jar
Well I would only be using one plugin and Itâs one Iâm writing now
Because I can easily deploy a new network server with pterodactyl to scale, but I want to patch it into one jar to be able to not have to use the plugins folder, just patch, build, restart, and it takes effect across all restarted servers
so for the protocol. you want to turn the server software, which contains the public api, into a giant unnecressary plugin to.. just don't have any plugins?
yep
Nobody does this lmao
They just download the plugins from some either local or remote repo
Preferably local for speed
maintaining such a resource is a huge timewaste
Why? Iâd just be maintaining my code and just updating to the latest build of spigot when it comes out
?paste
you imagine it to be easier than it is.
Well-meant advice: don't do it.
throw your idea away and dig it into the ground
put some lava on it
and let it become obsidian
minecraft joke 
If you open a new inventory while a player already has one open does it call an inventorycloseevent ?
most likely, but i am not sure
should
i imagine
its not the PlayerClosesInventoryEvent after all
I got an idea for a plugin.
Player opens inventory -> Close inventory again
Player Close Inventory -> Open Inventory again
(not a greifing plugin)
this would be a huge recursion
can someone please take a look at this, I made two classes: GUI and an eventlistener
The gui class makes specific ingame menus
it has a trail menu and a trade menu
the classs has a method register() that checks a string given at the constructor that looks for its function and binds the correct gui to it
and the listener gives an execution for it
but i need to check which gui is the user wanting in his command so i use gui.getID() which returns it function but i can only have 1 function so i always has the same slots where can be clicked on etc and i want to make it supports different actions so the problem is it when i make an object of gui it always has the same slots that can be used
https://paste.md-5.net/oqocijikad.cs
please tag me in response
What would be a good way to distinguish between whether the player is actually closing the inventory or a new one is being opened
ok ty
đ
Itâs fine until someone opens their inventory
since both is called i would store the first inventory
and compare the inventories
Could i use player.getopeninventory in the close event handler to get the new inventory and check for null or something
if you want to have it exactly maybe compare the miliseconds between the closing and opening
since they should be pretty low
idk if there is a more efficient and better way, never did something like that
getOpenInventory is never null
I like this one
What would be returned for no inventory open then
What is "internal crafting view"
So if they have none open it returns their inventory?
yup
hey peoples
how would i get the keys from this: plugin.getConfig().getConfigurationSection("ShowSettings").getKeys(false).forEach(key ->{ });
and then put them into a list?
early return and tell the plugin manager to disable your plugin
how does one get pluginmanager
Bukkit
try {
database = new Database(getDataFolder());
} catch (SQLException e) {
getLogger().severe("Unable to create database");
e.printStackTrace();
Bukkit.getPluginManager().disablePlugin(this);
return;
}
good?
myes
if you have any logic in your onDisable, make sure that it knows that the plugin didn't enable fully
would anyone be able to help me here?
If it is in your onEnable it is better to throw an exception like throw new RuntimeException(e);
you for example don't want to try closing connections that don't exist to begin with, or save data that wasn't initialized at all
@twilit nexus no helping is forbidden
Why not new ArrayList<>(plugin.getConfig().getConfigurationSection("ShowSettings").getKeys(false))?
getKeys returns a Set<String> use that
Otherwise you could do
List<String> list = new ArrayList<>();
plugin.getConfig().getConfigurationSection("ShowSettings").getKeys(false).foreach(list::add);
if you need to have the foreach, but it is a bit inefficent
it's better to use the constructor with a collection as it avoids needless resizing
List<String> keys = new ArrayList<>(blah.getKeys(false));```
will this work with tab completion?
if you make it work with it, yes
package corePack;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
public class EventCore implements Listener{
@Override
public void onEntityDamageByEntity(EntityDamageByEntityEvent e) {
}
}
Then I get the error "The method onEntityDamageByEntity(EntityDamageByEntityEvent) of type EventCore must override or implement a supertype method"
just wanted to have the foreach alternative known since that is what the user asked, even if it is not ideal
dammit i might be drunk
override is for when you are overriding a method, which you are not
thanks
How to check if a player can interact with a block (IE open, mine etc?)? I'm using the PlayerInteractEvent, is that the right one?
^ referring to line of sight
@Override is always optional
WHO USES CAMELCASE FOR PACKAGE NAMES
i like all lowercase
oh sweet, I didn't even know what forEach did really
thanks
org.gstudiosx.core
I just had it there because I thought I needed it
Don't use foreach if you have no idea what it does
It is more or less an oversimplified for (var a : iterable) { /* code */}
not great for performance too
is it a big problem
YES IT IS
yeah
What we tryna do here?
it is
I might help while watching cringe intros
oh lol, I am going for the best performance I can get, so thanks for that geol
forEach performance wise you should just use for (var a : iterable) { /* code */}
ok so what does it impact
my eyes
shut your mouth. a few days ago you said the same about classnames
yeah but who the fuck uses camelcase for package names
for each and forEach have the same performance
there is just the method call
which isn't performance abusive at all
no
no
yep
its much different
that is wrong
its not
IT IS
proof me wrong
Bytecode
Ah... I see? Thank you, wise one, for enlightening me, a beginner.
Fine, I'll compile it myself
that doesn't really say anything about this case
Iterator and for-each loop are faster than simple for loop for collections with no random access, while in collections which allows random access there is no performance change with for-each loop/for loop/iterator.
yeah
searched google
you can still use it but you wouldnt want to if you want to have better before
no performance change
no
maybe a few nano seconds
nah

