#help-development
1 messages · Page 565 of 1
this guy gives me static abuse vibes
this guy gives me static thoughts
Hmm
You guys are static variables behind the computer screen
💀


oh god we have a mutual server other than spigot
HOW
ARE YOu
Shout out lucid
I am everywhere
this dudes in my gregtech server what the fuck
that shits private xD
i dont remember you huh
tf is a gregtech
I am the reason you guys extend JavaPlugin
what was your ign?
the best modpack ever made
Idk
I bought europe last night
I don’t play minecraft
I love to extend JavaPlugin
You’re on a list
JavaPlugin my beloved 💚
peronally, I extend PavaJlugin
This server is on a list
On which?
You’ll find out soon enough
I only played it like one time
Question, if I want to make a arena template that would contain various "instances" (arenas) how could I do it without creating a new world every single time? Maybe using structures, but then I'd not know how could I get the cuboids locations as it'd be pasted differently each time.
Or maybe I make a match-only server and setup a bungee network, that's a solution too (but I really don't want to get into networks before I learn spigot propely)
Lmk if I didn't explain myself propely.
oh yes i remember now you were the one asking this 
Yeah I’m not even I dev I was going to exit scam 30 cents
i would of too ngl
if you like packets you can hide every other player except the two battling
And I’m not even Spanish
and handle interactions
Wtf is that even me
then you only ever need 1 arena
makes sense, but Imagine another minigame like skywars.
Would it be able to be done packet-wide too?
(Registering block changes,events, deaths for group X of players)
this is what hypixel uses, it's suepr efficient
alright ill take a look
I was thinking you'd say to use smth like protocol lib (i never used it on my life) but I'll look at that (I never used that il my life too)
always ready to learn
if it were a simple duel but if its block changes etc etc it would be a mega pain in the ass
Would’ve never happened if you didn’t extend JavaPlugin
show the full error
and the remmaped jar should contain that interface
this is the whole error
unless you want the line where it happens as well
there will be a maven log
click"compile 1 error"
on the left here
should bring it up
one of those 3 red circles should bring up a seperate error msg if its not that specific one
it's already clicked
ah
i got it
weird
region accessor should be part of this
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.18.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>
i'll try to import the spigot api dependency as well
https://github.com/crackma/PVPCore/blob/master/src/main/java/me/crackma/pvpcore/shop/ShopDatabase.java when i fetch the categories resultset 5 doesnt return anything
does sql index start at 1?
executeQuery -> ResultSet
So in order to add async world loading I have to downgrade my server to 1.13
🤕 🔫
getResultSet is useless if you didnt tell it you need one
aswm is a thing
oh slime world
also try catch in cf is useless, as the cf already catches and sets its error state, just use ::exectionally
Slime worlds themselves are just a protocol, you should be able to use them regardless of version.
Is there a method to get text cantered in the middle of chat, or are we on our own, if you wrote this before please send me it
bet
one sec
sometimes java yells at you
Ok
i stole one off the internet from 2015 the other day
On your own
Ight send
SWM fucks with the nms world manager
so you gotta like
nah its ass trust
play it out
Send?
Ive done it multiple times lol
i just stole one off the internet and use that 
https://paste.md-5.net/vivaqutive.cpp
https://paste.md-5.net/osurehebuk.java
your better using MiniMessage or similar tbf but this is alright
I think I stole the same one :D
but i cba to use minimessage so it works 
Can you eat bones in Minecraft
I swear you could before, why is it not working
Did they remove that
use NMS and change its properties
This guy is on something I swear.
I remember something with ghast tears
No in survival
client-sided
but I've retextured golden apples to give that effect before
had this plugin that you could eat anything
yeah i remember, eating bedrock 
String#repeat hmm
i didnt bother to even review the code
someone online said it sent centered text, copied it and pasted, it works
Put it in my core lib and have used it since
What’s wrong with this method
its mid
What
Real (I’m ending it all soon)
jesus fuck its rubbing off on me i gotta go
Stay, we will both be superior
A string does all but extend JavaPlugin
17
its 1.13.2
I can't use java 17
it was java 17
and I can't upgrade either because SWM async worlds are only supported in 1.13.2-
Java 8 - 1.8-1.15
Java 16 - 1.16
Java 17 - 1.17+
As long as you aren't using Java 12 features in your plugin, it'll be fine.
Java 17 is 1.18 higher, java 16 is 1.17 and java 8 is lower
Yea, but that version the game was still made using java 8 at the time.
How to make an event BlockBreakEvent cancelled but still drop the items?
fuck java versions >:)
giant mess
Plus, Java 12 isn't LTS. (At least I don't think)
java 16 is intermediate
is there an event for when a command runs that returns command object?
or is about to run*
Blocked#getDrops (ill get javadocs link sec) and you can either fake your own BlockDropsItemEvent, or just directly drop them in the world
Theres a few methods, there is one with just raw drops (no argument provideed) and another where you can provide an ItemStack as the braking tool
not quite
Mostly because the command map is gae
there's no way to detect console commands other than to do some funky injection
bentobox has CommandEvent but it doesnt work with all commands lol (just /bentobox)
i scraped theyre module loader a few years back, and ngl looking back i think that entire class loader was just a waste of time over maven modules 
Yeah you can inject a command map with unsafe
doing this sadly breaks shit from what I remember
however, if you use command pre process and use reflection to get from the CommandMap you can get the command object that way i would assume
because spigot does hard casting to craftserver in its internals
how do i get the full command map?
i used to inject commands into the command map all the time
and CraftServer is final and so is its command map
yeah but I want to inject a whole map
i see
best class
it works
best but goofiest
and I won't ask
it has a hard requirement of knowing reflection to use it
which is goofy
anyone who uses unsafe just googles it that one time and never touches it again
I used it quite a bit when I was doing entire client-sided chunks
had to do deep clones n shit
commands are a mess as a whole
and shallow copies of some mutable stuff without side effects
Though how to drop an item thats according to player's location when I try to do it I use getWorld().dropItem() but that comes with some issues that when you mine a block thats on top of the player the dropped item just drops somewhere pretty pointless
nah
you just use the blocks location as the location for dropping the item instead of players
World#dropItemNaturally()?
oh that too
Have to ensure to add 1 to y if you do this
Otherwise it may spawn inside the block instead and die
using unsafe to create an unitialized object is nice
oh yeh hes cancelling the event too huh forgot
no need for those default constructors
no way you actually use unsafe more than once every 4 months
maybe 2 if your a bentobox dev
depends on what you call once, is 4 times in a week once?
menace
If its up to interpretation sure
switched to c++ now cuz that gives you more control over the memory
Yeah works pretty well thanks!
so does java
its called
HashMap#clear() 😄
The gc is the only thing that can clear out objects from memory. While programmatically you can reduce the size of the hashmap this doesnt mean the memory is instantly available after doing so
what is bukkit adapter ?
Hi guys, I'm trying to learn how to compile a open source plugin that uses gradlew and I'm watching this video from yt https://www.youtube.com/watch?v=Voi1HOOZQTk&t=32s
What does this things in the begging of the video related to %JAVA_HOME% does?
Path variable that points to your java installation folder.
got it, but like 1 question. I need to "download" gradlew to compile a plugin that uses it?
I believe gradlew is like the thing that gets all of the dependencies and puts them in your java project.
I personally only used maven, never used gradlew so I can't help you there.
Gradlew is the portable version. Run it and it will gather everything it needs to include additional gradle stuff
what is BukkitAdapter ?
world edit stuff
To be cross-platform, they have their own types for e.g. Location etc
BukkitAdapter is responsible for converting a org.bukkit.Location to a world edit location type
or whatever they use
Got it! But like how I compile the plugin using gradlew? I tried the same comand that the dude used in the video and did not worked 😦
That's the command
It's building
Not entirely sure. I dont use gradle and typically just add maven to use
If I go to Build - Artifacts will use gradew maybe?
Maven and gradle can coexist in the same project
you don't build using intellij artefacts
You're already building it
^
hummm I wanted to just change a line in a Open Source Plugin made from a friend but alone
And he used gradlew
It ain't gonna be done in an instant, just wait a bit
humm confusing, got it. I'll try to figure it out.
Well, how did the rest of the command look
like, has it finished ? what is your console saying
it didn't built the gradew
PS C:\Users\BREEZE\Programming\discord-connectivity> .\.gradlew build
I just followed the video 😦 Im noob
the video has a forward slash
so Every time that I want to compile it, I need to use this command lynx?
Well you can just make a run configuration in intellij
to run it for you when you click run
but yea
👍
if i cant create an entity without spawning it with bukkit api, is there any other api or do i need to do it with nms or sth?
i wanna store it in variable and spawn it later
Ah
Yea you'd serialise the entity via NMS
and spawn it back in later
|| paper has API for that
||
wait fr?
fr what ? xD
maven > gradlew?
pretty subjective question
humm got it, so it depends
i may do it with nms, but thanks for da help
Yea, you basically want to save the entity to a CompoundTag
with its id
and then EntityType.create later
bro am i do wrong something ?

?
Lynx, I've got a problem when I tried to turn on the plugin.
Is it something related to Dependencies?
Error occurred while enabling BreezeDiscordConnectivity v1.0.1 (Is it up to date?) java.lang.NoClassDefFoundError: me/saiintbrisson/bukkit/command/BukkitFrame at com.github.eokasta.discordconnectivity.DiscordConnectivityPlugin.onEnable(DiscordConnectivityPlugin.java:45) ~[BreezeDiscordConnectivity-1.0.1.jar:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20-R0.1-SNAPSHOT.jar:?] at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[paper-1.20.jar:git-Paper-4] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.jar:git-Paper-4] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:563) ~[paper-1.20.jar:git-Paper-4] at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:474) ~[paper-1.20.jar:git-Paper-4] at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:638) ~[paper-1.20.jar:git-Paper-4] at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:437) ~[paper-1.20.jar:git-Paper-4] at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.20.jar:git-Paper-4] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1103) ~[paper-1.20.jar:git-Paper-4] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[paper-1.20.jar:git-Paper-4] at java.lang.Thread.run(Thread.java:833) ~[?:?] Caused by: java.lang.ClassNotFoundException: me.saiintbrisson.bukkit.command.BukkitFrame at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:183) ~[paper-api-1.20-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:150) ~[paper-api-1.20-R0.1-SNAPSHOT.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?] ... 13 more
Yea
can you share the build.gradle.kts @craggy steeple
yessss just paste it here?
?paste
heh 🥷
okay ?
oh they didn't make the build depend on shadowJar
?
build it and you should get a BreezeDiscordConnectivity.jar in your build/libs
which is the correct plugin jar
yea 👍
K
lemme just ask u this question, why I dont need to add anything here?
I was watching some pl tutorials
and they always paste a jar file
with gradle you don't really want to touch that
Thx, got it!
how u managed to undestand that just this command was missing lynx?
✨ experience ✨
shadowJar is responsible for including the dependencies in the jar file
if i dont catch then it errors
Worked! Managed to change the .setAuthor(guild.getName(), null, guild.getIconUrl()) to .setAuthor("Breeze Survival", null, guild.getIconUrl())
First time that I modify a plugin, thx guys 🙂
nice
not boosting
😫
fair
Is there any way to determine which slot a player interacted with on a chiseled bookshelf? I did not see a new event for it, and you can't really get that from PlayerInteractEvent.
can you maybe get the past state and the new state and then check what slot changed ?
I don't remember what info the event gives you
probably would have to do the same thing the internals do
Hmm.. didn't think about comparing states. I'll check that out, thank you!
Sadly, the event does not give you access to the new blockstate
Does somebody know a good Tutorial or Documentation für a multiple version Plugin with maven?
You'd use maven modules
one per version
as for a tutorial I'm aware of a good one
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
That's not a good one
send good one please
Guys, there is this famous hub open source plugin called DeluxeHub and the new items of the 1.20 version are not working on the GUI's, any tips on what I need to find on IntelliJ to change to make them work?
The erro: https://paste.md-5.net/ogosixokep.sql
someone seems to already have a PR open to udpate that to 1.20
might want to just build that
yeah, i even printed the results
would you say that the newest version is 3.5.4? Because if it is, they didn't changed it
They made the plugin usable for 1.20 these days, but the new items, when added to a GUI, the pl crash 😦
items: infobook: material: CHERRY_SAPLING
They changed the plugin to gradle, nice I know how to compile it 😎
#trusttheprocess
So you have one?
I meant to say that I wasn't aware of one 💀
seems like I missed not in my sentence 👀
Hello, I'm making a custom npc using EntityPlayer and I am wondering how to chage the npc's display name?
This is my code:
EntityPlayer npc = getNPC(index); //get NPC from a arraylist
npc.getBukkitEntity().setDisplayName(message.split(" ")[0]);
But it only change the name in chat, not the name in tablist.
hi , im really new to spigot development and i used the minecraft development to create a basic project , but right from the start after setting everyting up in intelij like plugin.yml and pom.xml i instantly get a warning in the main class "Class {mainclassname} is never used"
does it affect anything? and if so how do i get rid of that
you can safely ignore that warning
at worst - your mental state
is there a way to hide ti lol
You should be able to ignore that warning
but ty
Are you using any NPC API ?
Like Citizens ?
the name on tab is icky
No. I coded it all by myself.
try updating the name on the gameprofile
iirc you have to respawn the entity to change that
I think I didn't respawn the npc.
Do you know the function's name for setting an entityplayer's gameprofile?
no
how do I customize every players tab username?
in what way ?
Do you just want to add prefix/postfix or change the name entirely
like “playernsme Money: 0 - Level: 1”
teams and postfix
suffix
use TAB
am i able to update a suffix with teams similar to scoreboard
ye that one
thank you, though
or no ?
yes, that's why I am suggesting this
how do I assign data to the suffix with teams?
team option suffix
or something
Hi guys, could someone just orient me on what I need to start looking on DeluxeHub code to fix this erros on crashing the plugin when 1.20 items get added on the guis?
someone already told you to build the PR for 1.20
oh really? thx! I think I missed the message
PR stands for what steve?
the project?
Pull Request
Oh got it
Pull request. A code change request on the GitHub repository
The first thing you do is read through teh stacktrace to see what the error is
I'm already using this one, they just enabled the plugin on the 1.20 version, but still the erro with the items in the GUI
Humm got it!
I've not read up to see your issue explained, but is it crashing the client or the server? and is ther a readable error?
will send ya rn!
items:
infobook:
material: CHERRY_SAPLING
The erro occurs when I change to new items of the 1.20
ah ok
yeah probably not a difficult fix. It just doesn;t know what to do with new Materials
odd they'd hard code something like that
Humm, I don't know things about it, but I really needed this new items in the gui 😦
name: 'DeluxeHub' author: ItsLewizzz version: '${project.version}' api-version: 1.13 its like that
Set it to "1.20"
K
api version won;t fix it
oh wait they're using XMaterial
thats a hard coded error trying to match a material name from the config
You need to update XMaterial
the hell those are some fancy package icons
how do I get those
they dont reply anymore :/
dude I got from a yt video ahahahahah
I don't even know how to share with u
Ok thx!
just share the vid then
It's my first day on IntelliJ hahahahah
I'll search here the vid
I'll send ya later
ty 💚
iirc its atom material icons
K! U know where I change it?
this one @smoky anchor
oooh ty
Change what?
like what folder I can find this https://github.com/ItsLewizzz/DeluxeHub/tree/master/src/main/java/fun/lewisdev/deluxehub/utility/universal
pretty sure you just needed to modify the classes
resultset 1-4 returns the right values
You used \. again
./gradlew build
I'm a little bit lost
dude ahhahahaha
in that folder 3 files exist, you probably only needed to update those
the plugin is hosted using maven, why are you trying to use gradle to build?
XMaterial
XPotion
XSound
That too
you can literally import the source, update XMaterial and compile using maven
Too much for a dude that just downloaded IntelliJ, but I'm trying my best right here 😆
I didn;t look that deep but it seems it only uses XMaterial
I wonder why they didn't use maven to shade xmaterial
I also wonder why they copied XMaterial into their project instead of keeping it as a dependency
same
what does SlimePlugin#getLoader do? I can't seem to find anything on the docs yet it shows on getting started
wow that's nice!
But I tried here and found this erro on the console (I removed all the old files)
06:15:48] [Server thread/ERROR]: Error occurred while enabling DeluxeHub v3.5.3 (Is it up to date?)
java.lang.IllegalStateException: zip file closed
at java.util.zip.ZipFile.ensureOpen(ZipFile.java:838) ~[?:?]
at java.util.zip.ZipFile.getEntry(ZipFile.java:330) ~[?:?]
at java.util.jar.JarFile.getEntry(JarFile.java:511) ~[?:?]
at java.util.jar.JarFile.getJarEntry(JarFile.java:466) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:159) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:588) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:104) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:99) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
at fun.lewisdev.deluxehub.DeluxeHubPlugin.onEnable(DeluxeHubPlugin.java:98) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:540) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3801-Spigot-bed8c61-66c5ce4]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:454) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3801-Spigot-bed8c61-66c5ce4]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:589) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3801-Spigot-bed8c61-66c5ce4]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:414) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3801-Spigot-bed8c61-66c5ce4]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:250) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3801-Spigot-bed8c61-66c5ce4]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:973) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3801-Spigot-bed8c61-66c5ce4]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3801-Spigot-bed8c61-66c5ce4]
at java.lang.Thread.run(Thread.java:1623) ~[?:?]
It's funny, because this plugin for hub/wise for noncoders that just want to have a plugin for it, its the best one nowadays
there's one called SuperLobby, nice plugin as well
what's in your onEnable lol
make sure you fully restarted your server
its deluxe hub, for some reason it doesnt shade xmaterial just copies the classes
I deleted the plugin, added again to the server and got the red color on /pl
idk If I'm doing something wrong
console errors
CraftBukkit version 3801-Spigot-bed8c61-66c5ce4 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT)
running this version
I'll send rn
bruh what
nbt-api isnt updated
i just read the stacktrace
[06:22:06] [Server thread/INFO]: [NBTAPI] Found Spigot: v1_20_R1! Trying to find NMS support
[06:22:06] [Server thread/WARN]: [NBTAPI] This Server-Version(v1_20_R1) is not supported by this NBT-API Version(2.10.0-SNAPSHOT) located at fun.lewisdev.deluxehub.libs.nbt.utils.MinecraftVersion. The NBT-API will try to work as good as it can! Some functions may not work!
[06:22:06] [Server thread/INFO]: [NBTAPI] Found Gson: class com.google.gson.Gson
right at the top
this?
ill check if its updated
Oh got it, so there's no way to get around it because its a API thing?
nbt api updated just needs to update dthe version
if i buy a plugin and i put in network all me devs can see me license?
what version?
2.11.3
this should work
K
it shades it so the plugin version wouldnt help
there we fucking go
Epic could you show me where u updated this api?
I really wanted to know how to update a api
just change the version in pom.xml
and for xmaterial i just copied the classes, changed the package and fixed any errors
maven handles the downloadin
Hummm got it! Now I need to learn how to use this maven that you guys talk about
I just know gradlew in the moment
dude I just download intellij today 😦
Epic, those api things that need to update, is there a way to make this automatic for plugins? Like a plugin detects if there is a new version of the api?
no
intellij has supoprt for both built in
on the right side bar
Does anyone know if theres a way to change the chances for an ore to spawn? For example set the iron ore spawn rate to 20%
custom worldgen
youcan use worldpainter
how exactly would i do that
worldpainter
i dislike worldpainter
ok
Google how to make custom world generation algorithm
here is the void gen
Just replace the block populator?
declaration: package: org.bukkit.generator, class: BlockPopulator
Assuming ores use that
I have no idea
oh
(in older versions of Spigot)
do you really mean you want to load a chunk, or do you want to prevent it unloading?
i want to set a custom join message , but when i try using event.setjoinmessage intelij idea says that it has been depricated. Whats the correct way to change the join message? 1.19.2
You are not using Spigot
wdym
you’re using paper or another variant of it
oh ye
Its deprecated in paper not spigot
forgot about that
😑
so i should go to paper discord right
yes
or use Spigot
use spigot on paper server 🧌
We'll welcome you back to Spigot after you get reamed over there
tyy
Not in the Spigot discord please
This would be the replacement for setjoinmessage
But you should go to paper discord for further help, I would be more than happy to assist you there

yeah nope im moving from paper to spigot whatthefuck is happening on paper i dont understand
If it actually is a player
@eternal oxide Just wanna say thank you, my worlds are working perfectly. There are no performance hickups, or anything. Turning off the keepSpawnInMemory helped a huge amount.
np
public BlockType[] getBlocksInRadius(Location center, double radius) {
World world = center.getWorld();
int radiusSquared = (int) (radius * radius);
int minX = (int) (center.getX() - radius);
int maxX = (int) (center.getX() + radius);
int minY = (int) (center.getY() - radius);
int maxY = (int) (center.getY() + radius);
int minZ = (int) (center.getZ() - radius);
int maxZ = (int) (center.getZ() + radius);
// create array
BlockType[] blockTypes = new BlockType[(maxX - minX + 1) * (maxY - minY + 1) * (maxZ - minZ + 1)];
int index = 0;
for (int x = minX; x <= maxX; x++) {
for (int y = minY; y <= maxY; y++) {
for (int z = minZ; z <= maxZ; z++) {
Location currentLocation = new Location(world, x, y, z);
Block currentBlock = world.getBlockAt(currentLocation);
BlockType blockType = currentBlock.getType();
// store
blockTypes[index] = blockType;
index++;
}
}
}
return blockTypes;
}
ew wtf
This code looks good aside from set thingy and little bit of refactoring , what exactly doesn't work
public Set<Material> getUniqueTypesInRadius(Location center, int radius) {
Set<Material> types = new HashSet<>();
for(int xOffset = -radius; xOffset <= radius; xOffset++) {
for(int yOffset = -radius; yOffset <= radius; yOffset++) {
for(int zOffset = -radius; zOffset <= radius; zOffset++) {
Location target = center.clone().add(xOffset, yOffset, zOffset);
Block targetBlock = target.getBlock();
types.add(targetBlock.getType();
}
}
}
return types;
}
easy enough
true
but in reality no
because location mutable
if you don't clone it, it'll modify the center and cause all sorts of weird issues
Does anyone know something changed in itemStack.serialize()? I get java.io.NotSerializableException error now in CraftMetaColorableArmor when i want to serialize enchanted itemstack....
Itemstack is = new ItemStack(Material.IRON_CHESTPLATE);
is.getItemMeta().addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 4, true);
HashMap<String,Object> isSerializd = is.serialize(); // CRASH if Item is enchanted
Why don't you use gsit?
Try dismounting the player
then teleport on the spawn on your own
How to fix the illegal access to ChachedRowSetImpl of com.sun packages?
I added some flags on the server start but still doesn't work
send code
Why do you need it
If you are using impl, you are 100% doing smth wrong
You shouldn't touch internal code
they gave me a src code of a spigot plugin and I haven't touch any pecies of the code yet
Hi, how do i change the API of my plugin? i started it as 1.19 and i want it to be 1.14 i changed the <version> in the pom.xml under the spigot api dependency to 1.14.4-R0.1-SNAPSHOT but it still says unsupported api version 1.19 in the console when loading
It doesn't even compile now for this reason, moreover is a big plugin so I'm not sure but it should be fine using it
Show us your plugin.yml
Change the version in your plugin.yml
ah ok ty
I call an event in PlayerMoveEvent, but it keeps causing stack overflows every time its called what should I do?
What event are you calling
my own custom event
Does it involve moving
You are making an infinite event loop
ahhhh
Use a boolean to disable your player move listener while your custom event is being called
wait so why is it causing a infinite loop
I feel like it shouldn't
it should just trigger my event once every time the player moves given the conditions are satisified
Yes but does your even move the player in some way
https://paste.md-5.net/ramezayaxi.cs
@EventHandler
public void onPlayerDomainMove(DomainMoveEvent event) {
event.getPlayer().sendMessage(event.getAction().toString());
}
Show the player move listener as well
Well I don't see anything that could move the player
Other than cancelling the move event
yeah I haven't the slightest clue why I'm getting stack overflows I feel like the logic is pretty linear
add debug messages 😉
I did
its giving me a stack overflow on event call
there is no where its inherently going wrong,
does it not give you a stack overflow if you arent calling your event?
event call is the location of the stack overflow error so I'd assume its definitely that
does it have to do with the event bus?
yeah no I think I know the issue one second
what does this mean?
[18:17:14 ERROR]: Fatal error trying to convert EliteSpawn v1.2:nl/mnrkaas/elitespawn/EliteSpawn.class
java.lang.IllegalArgumentException: Unsupported class file major version 60
its a much longer error but its too big for discord
lmk if you need the whole err
wrong java version
@young knoll as I figured lol stupid mistake, my DomainMoveEvent was a subclass of PlayerMoveEvent calling PlayerMoveEvent subclass within PlayerMoveEvent caused an event loop that the event system didn't like
nerd
but 60 is java version 16 and i have it set to 16
EliteSpawn isn't Java 16 or doesn't support it
it likely uses Java 17 or something
your plugin java version is wrong or your system java version is wrong
its one of the two
but it worked before
ok
What can I do to clean up my main class? it's getting pretty big and hard to follow. Most of it is just recipes with the if statements from the config.
if you want you can get all of your code reviewed in #1100941063058894868
just put a github link in and people will send tips and things you could improve
Ah I would do that, but hears the thing...
I cant install git at the moment.
its kind of broken. lol
how
I am on the macos 14 beta. for sonoma, I cant install HomeBrew, git, or anything really. I cant even install git from xcode.
what IDE do you use? if you use something like IntelliJ you shouldn't need it
i use intellij ultimate.
dont need git ?
hm. I'll go see if its available for download.
IntelliJ uses git as well of course
Yeah that's what i'd normally use. but git broken 😢
it works! 😄
but like it added a bunch of files called .DS_Store
I have no clue what that is.
Those are macos files I believe
well i guess they are in there lol
thanks for the github desktop i didnt even know it was a thing lmao.
I can now update my github with 3 of my other projects.
id advise to make a gitignore with the .DS_STORE in
this should not upload stuff you dont want there https://paste.md-5.net/kehowiceyo.shell
How do I decide a good pool size for a new ExecutorService
ask illusion
anyone know how i can fix this?
ye somebody told me that but i dunno how to fix it, as it worked before
You need to use Java 17
like system java or in the pom.xml?
I wonder why YamlConfiguration#getKeys() gives me a random order of keys. How can I get keys that order as in the YML file?
pom and IDE
try changing it in your maven configuration. in the Java options tab
uncheck inherit from settings and you can set it manually.
Does anyone know this?
how can i go to the java options?
kind confused, setDamage doesn't work with blaze's fireball projectile?
blazes deal 0 dmg atm
This looks like it's setting the melee damage.
You need to update maven
3.9.2 is the latest
mvn install?
That installs your project not maven
does 3.9.2 have the special source bug fixed
What bug?
there was some bug maven 3.9 had
🤷♂️ I'm using 3.8.5
was about to say wtf there is no 13th month than realized british
Can anyone please help me with this?
https://pastebin.com/t3MH58z4
mmddyyyy 💀
1.14.4 does not support jars written in Java 17
Well the version of ASM that commodore uses
Which I assume is the bundled one
your running the server on a too high java version
Well no the jar is too high java version
We don't actually know if they're running Java 17 on the server or not
oh now java 17 is NOT supported
before you said i needed to use 17
1.14 should be using java 8
i am
Yeah that was because I didn't look at the stacktrace
and only saw that it tried to load a Java 17 class
im trying to add compatibility to my plugin, but when i try it in 1.19 it says its not the correct api
Hello, how can I make an entity with a custom texture ?
resourcepack + custommodeldata
no one runs versions that low. I'd stop support at 1.18.2 at lowest
you'd be losing like 2% of the market share or something around that
okay thanks
(any way for an entity @fluid river ?)
Display entity with item
?
Or force players to use Optifine
?????
DisplayEntity is a new feature
Minecraft does not support custom entity models so you need to work around that
of 1.19.4 or 1.20 snapshot i don't remember
ah yes I see
Armor stands or Display Entities is how it's usually done
There could be possible to find a mate to practice coding?
1.19.4
i mean just ask for mates
I NEED ONE RIGHT FREAKING NOOW
Okay thanks
except one guy...
🤷♂️ I have some time
Is display entities fightable ?
hehe
no iirc
You'd usually use a slime for the hitbox
It does depend on what mob you're making though
and how large it is
I want to make a zombie with a custom texture
well...
iirc ?
If I recall correctly
okay thanks
with optifine ?
Yeah Optifine can do that
can't you just change the model of zombie or smth
Not without Optifine
and force players to use resoursepack
Is there any tutorial ?
I want my custom zombie and the natural zombie
Don't forget you're forcing every player to use Optifine
well, I'm already on it x)
thanks !
Fireball fireball = (Fireball) event.getDamager();
ProjectileSource shooter = fireball.getShooter();
if (shooter instanceof Blaze) {
Blaze blaze = (Blaze) shooter;
if (blaze.getCustomName() != null && blaze.getCustomName().equals(ChatColor.GRAY + "Blaze (Level 1)")) {
event.setDamage(blazeDamage1);
}
if (blaze.getCustomName() != null && blaze.getCustomName().equals(ChatColor.BLUE + "Blaze (Level 2)")) {
event.setDamage(blazeDamage2);
}
if (blaze.getCustomName() != null && blaze.getCustomName().equals(ChatColor.GOLD + "Blaze (Level 3)")) {
event.setDamage(blazeDamage3);
}
}
}
}```
Can anyone help me a bit? Fireballs from blazes deal 0 dmg still.
lmao
💀 Detecting entities by their name
Then, I can make a zombie and give it a custom model data and then use the texture pack @chrome beacon ?
Read the docs
It tells you what to do
okay thanks
Its neccesery since theres many of the same mobs with diferent names
its an easy way
put spoilers
Anybody knows whats wrong?
and if someone rename it 💀
Attatch PDC or NBT tag. Never use names to identify things
lmao
?codeblock
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Damn, that's a good anti copy paste method right there.
opens developer tools

zombie.getPersistentDataContainer().set(new NamespacedKey(yourPluginInstance, "zombieLevel"), PersistentDataType.INTEGER, 1)
break;``` something like this?
Yeah but don't create new key every time
You can make that a static final constant
Anyone know where I can get a 1.19 sound like
[17:44:48 WARN]: [AdvancedModreq] Looks like the sound BLOCK_NOTE_BASEDRUM is not supported in Minecraft version #git-Paper-550 (MC: 1.19.4)
private void sounds(Player player, String soundStr) {
try {
if (!(soundStr.equals("null") || soundStr.equals(""))) {
Sound sound = Sound.valueOf(soundStr);
player.playSound(player.getLocation(), sound, 1F, 1F);
}
} catch (IllegalArgumentException e) {
// Nothing if soundStr = null
if (!(soundStr.equals("null") || soundStr.equals("")))
getPl().getLogger().warning("Looks like the sound `" + soundStr + "` is " +
"not supported in Minecraft version #" + Bukkit.getVersion());
}
}
cpu usage
It's more about not wasting resources
but mate its the same thing, question can be answered the same
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
Why spend CPU and RAM making a new object when you don't have to
the answer would be the same
hey. do i need to place this on enable instance = this; for it to work?
Not sure what to do here, want's me to install something but I don't know where, https://paste.md-5.net/oyitebojeh.sql
I prefer di
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
as for the answer it depends on the rest of the code
did you run buildtools remapped
wouldn't it be simpler to add zombie.addScoreboardTag("ZombieLevel" + level);, scoreboard tags?
no
java -Xmx2G -jar BuildTools.jar --rev 1.19.3
this was my comand
why ram limit, and add --remapped
Actually probably wouldnt work upon on renaming hte mob
pretty sure
Use PDC
kk
Hello, how can I set custom model data from Entity ?
You can't
I mean you can but then all entities of that type will look like it
you can't have a blue and a normal creeper. What you can do is let a mob wear armor with a custom model
with a Zombie type ?
(in a listener)
@EventHandler
public void customZombieEvent(EntitySpawnEvent event){
Entity entity = event.getEntity();
if(entity instanceof Zombie){
main.getLogger().info("Zombie");
//Do custom model data
}
}```
You will have to use a resource pack and can't do it dynamically
unless you wanna do the gear part
let's do it x)
can you change the textures of entities with certain names in a texture pack?
like if a creeper was named 10 could that creeper have a different texture?
no
well, how can I get the custom model data of a Zombie ?
hum okay
What he was saying you do, is you make textures for armor and apply that armor to the entity
then they will have their texture
https://www.spigotmc.org/threads/advanced-resourcepack-mechanics-how-to-create-custom-items-blocks-guis-and-more.520187/
here's a guide on it
thanks 😄
is this project still going on?
yes
This is actually very interesting.
Nova is the closest thing to a modded experience, i used it for like 3 years and was always on fire every big update
That's what I was looking for. a modded experience without the hastle of mods. because setting up servers with mods is such a pain especially when it comes to updating to later versions.
we should move on #help-server to talk about this, the channel is not appropriate for what we are talking about. (im don't want to do that guy lol)
modded experience without mods?
an experience unlike vanilla without mods
can I somehow make Player interact with Interactive entity manually?
or trigger the event somehow in some other way
you can't force a player to interact with something persay but you could fire an event yourself
just a reminder though firing an event wouldn't make the player do that action on their screen
y2k, you told me a bit earlier today that using getPlugin(class) is bad, but why is that?
is it slow?
@river oracle
so i want to get a players current potion effect, but someone can have multiple ones so i want to filter it by only getting the one with infinite duration. this is what i have so far but its a Collection when it should be a PotionEffect:
(please ping me for responce)
loop
yes
it uses reflection under the hood
I see
right now I have just done an ugly private static MyPlugin instance and in onEnable start with instance = this; is that better do you think?
di
wdym
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
fuck
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
youll never see singletons in enterprise code
well not that type (not really a singleton technically)
static getter thing
I mean what is enterprise code even
code written in an enterprise
i mean you are right though, I have never seen enterprise java code
atleast where i heard of, they were embracing dependency injection
depends on the company
you just hope you get one who loves DI
well for some things its just gonna get awkward to keep passing in your plugin instance
like utils?
i found TreeType in structuregrowevent can i get this tree types and spawn on custom event ?
i mean can i spawn structures with spigotapi ?
example i do command when player write this command spawn desert pyramid
or for example I have multiple places where I want to use data from config files
right now thats mostly DI
but not all
programming for the general use case is not hard
the exceptions are annoying as fuck
im sure you know that
when are we getting not null types
yeah, when we get that many random lines, which beginners dont even understand lol
valhalla when
what is valhalla
sounds uselessto me
like the only times i have relied on my plugin instance is when creating objects from bukkit that require a plugin instance
and in most cases DI suffices but it doesnt for everything
I always inject the loader into most of my classes... -.-
I probably should manage the config in some other ways lmao
like shuffle them? yikes
siegeInfo.getStartTime().minus(Instant.now().getEpochSecond(), ChronoUnit.SECONDS).getEpochSecond()
Does this work for getting the start time and subtracting the current time to get the time left between these two periods in seconds?
Period.between
mmmo kay
maybe useful
yeah thats my point, this is the best way to generate italian spaghetti
nani
though how would I convert an instant to LocalDateTime
so I would say some static uses are fine, but like very sparingly and only for specific purposes
like reading your files and stuff
something at some point needs to be static
mmmm wait no that wouldn't work because Period.between takes LocalDate not LocalDateTime
ok that only works for dates 💀
so I won't need a fucking reference for a different class
stupid datetime api
Duration
but why are you converting epoch time to seconds
epoch is millis