#help-development
1 messages · Page 1111 of 1
sounds like a design flaw
Ahh yeah thanks
I'm not sure if you could do without cancelling the event, otherwise iirc there are some methods to set the durability of an item but this also sounds tedious
may somebody please explain why:
chests.add(new Location(Bukkit.getWorld("world"), 1000, 40, 998));
works in one class but not another?
more context
with the error:
- Syntax error on token ";", @ expected
- Syntax error on token ".", @ expected after this token```
?paste your code
In one class it works fine, then I made a new one and no ArrayLists work. They all give that error
on second thought maybe here isnt the best plac eto ask :/
it is
Is this the full error?
yes
post your actual code not the bits you think we want to see
post teh code that doesn't work
thats the working one
post teh full code of the not working one
Why not just pass this list to the class you need it in, rather than rehardcoding it
^
that is very true what am I doing :/
my fault 😉
Also this btw
Really redundant to do this the way you are
brah I picked up java like 2 days ago ;-;
thanks :P
?di take a look at dependency injection, should give you a general idea of what I mean by passing
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
i got this error while spawning the npc: Caused by: java.lang.NoSuchMethodError: 'net.minecraft.server.level.ServerLevel org.bukkit.craftbukkit.v1_21_R1.CraftWorld.getHandle()' at eu.sabermc.manager.NPCManager.createNPC(NPCManager.java:28) ~[?:?] at eu.sabermc.listener.PlayerJoinListener.onJoin(PlayerJoinListener.java:14) ~[?:?] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?] at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?] ... 22 more
Did you use the special source maven plugin?
Yea
Did you verify that the right version is set?
running Spigot or Paper?
They are using spigot
k, just paper no longer has versions in CB
yep that was the error i saw it in a compile error
Alright kinda working now but i dont get this:
The code: ``` public static void createNPC(Player player, String name) {
MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
ServerLevel world = ((ServerLevel) player.getServer()).getLevel();
GameProfile gameProfile = new GameProfile(UUID.randomUUID(), name);
ServerPlayer npc = new ServerPlayer(server, world, gameProfile, ClientInformation.createDefault());
npc.setPos(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ());
npcs.put(npc.getUUID(), npc);
ServerPlayerConnection connection = ((CraftPlayer) player).getHandle().connection;
connection.send(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, npc));
}```
hmm i dont get it tbh
You can just use the Citizens plugin API
doesnt EntitySpawnEvent prevent custom mobs from spawning or is my code bugged
Hello, how can I do a multi-module gradle project, to use NMS with mojmaps ?
?nms
Google is your best friend
?multi-module
thanks
yeah find the multi module teh same place nms is
show us what you tried
i dont want to use any apis that its not my own
But well, I get this error :```
22:43:51: Executing 'build'...
FAILURE: Build failed with an exception.
- What went wrong:
Circular dependency between the following tasks:
:classes
--- :compileJava
--- :jar
+--- :classes ()
--- :compileJava ()
(*) - details omitted (listed previously)
- Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.
BUILD FAILED in 78ms
22:43:51: Execution finished 'build'.
why should i use it?
how can I spawn a Zombie after giving him meta data / how can I prevent the zombie from being affected by canceling spawnEvent
because you seem to not understand what you're doing
and it saves a lot of time
your just making your life harder that way
but if you like that you do you ig
Don't try to stop it from being affected
You should instead look in to what's stopping it and why
and hook that api if possible
otherwise your plugin will become a compatability nightmare
as for how to spawn your entity with your metadata use the spawn method that accepts a consumer
? I want to cancel normal spawn but still allow my custom zombie to be spawned
you'll certainly learn more if you figure out how to do everything on your own though it's up to you if that is worth the time you will have to spend that you normally wouldn't (I'm talking a lot of time)
why jeff's website is not loading...
then just check if it's your zombie
idk
works for me
@EventHandler
public void onSpawn(EntitySpawnEvent event) {
if(!(event.getEntity() instanceof Zombie)) {
event.setCancelled(true);
return;
}
if(!plugin.getGameHandler().getDeadBodies().contains((Zombie) event.getEntity()))
event.setCancelled(true);
}
``` thats my code and still it gets canceled
show us how you're adding it to dead bodies*
also don't keep a reference to an entity like that
use a uuid
is there a website I can use a sandbox to copy paste things into the spigot resource page?
@EventHandler
public void onDeath(PlayerDeathEvent event) {
Player player = event.getEntity();
event.setKeepInventory(true);
player.getInventory().clear();
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
onlinePlayer.hidePlayer(plugin, player);
}
event.setDeathMessage(Message.DEATH.getMessage().replace("%player%", player.getName()));
Zombie zombie = (Zombie) player.getWorld().spawnEntity(player.getLocation(), EntityType.ZOMBIE);
zombie.setCustomName("§7" + player.getName());
zombie.setCustomNameVisible(true);
zombie.setAI(false);
zombie.setInvulnerable(true);
if(player.getKiller() != null)
zombie.setMetadata("killer", new FixedMetadataValue(plugin, player.getKiller().getName()));
else
zombie.setMetadata("killer", new FixedMetadataValue(plugin, "none"));
zombie.setMetadata("deathTime", new FixedMetadataValue(plugin, System.currentTimeMillis()));
plugin.getGameHandler().getDeadBodies().add(zombie);
}
You're spawning it before adding it to dead bodies
also don't use the metadata api
It's very prone to memory leaks
yeah that was what I was asking how to add before spawning
yeah I told you how
Well, here it is :
https://paste.md-5.net/qisaxemavi.gradle.kts
But I still get this error :```
22:54:22: Executing 'build'...
FAILURE: Build failed with an exception.
- What went wrong:
Circular dependency between the following tasks:
:classes
--- :compileJava
--- :jar
+--- :classes ()
--- :compileJava ()
(*) - details omitted (listed previously)
- Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.
BUILD FAILED in 126ms
22:54:23: Execution finished 'build'.```
you told me to not use the metadata api and to keep UUID and not entity but thats not telling me how to add it before spawning
implementation(project(path = "::"))
this would probably be the problem
what should I put instead ?
@peak depot
nvm
this will run code before spawning it
mb
hmhm I'm sure this code will never ever ever backfire
public ItemSpec(@NotNull final ItemSpec other) {
checkArgument(other != null, "The provided spec must not be null");
final Class<?> specClass = this.getClass();
for (final Field field : specClass.getDeclaredFields()) {
field.setAccessible(true);
try {
if (Modifier.isStatic(field.getModifiers())) {
continue;
}
if (Modifier.isFinal(field.getModifiers())) {
final Object otherObject = field.get(other);
final Object thisObject = field.get(this);
final Method findPutOrAddAll = Arrays.stream(thisObject.getClass().getMethods()).filter(method -> (method.getName().equals("putAll") || method.getName().equals("addAll") && method.getParameterCount() == 1)).findFirst().orElseThrow();
findPutOrAddAll.setAccessible(true);
findPutOrAddAll.invoke(thisObject, otherObject);
findPutOrAddAll.setAccessible(false);
} else {
field.set(this, field.get(other));
}
field.setAccessible(false);
} catch (IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException(e);
}
}
@chrome beacon I've got something working, but not like it would
If I add another NMS version, it will not be the good remapping ?
why setting everything accessible
What on earth is happening in there
not much of a gradle user
so 🤷♂️
can a player move and be tapped in the same tick?
Tapped?
french ? x)
yes^^
np
I would think so then
The spawning of mobs is active in the multiverse-core worlds config, in the gamerule, in the server-proprieties spawn-animals true and there is no plugin blocking it. What else can block the spawning of mobs?
spawn-monsters=
didn't Mojang delete that in the 1.21.2 snapshots? lol
to fix some old bug they just removed the setting that made that bug possible
I guess my properties is very old 🙂
very big brained
Can i submit prs of me just elaborating in the javadocs?
Some of the javadocs are trash
Hello, is there a way to remove the particles from the TOTEM_RESURRECT entity effect ? Is there any specific packets sent only for the animation?
Hello
how can I increase the strength of the armor so that it is for example as strong as netherite armor i use itemsadder and mcmobs armor
yes, very welcome
Hello, how can I get entities in a specific area ?
does anyone know why server remapped spigot 1.20.6 doesnt have net\minecraft\world\level\Level but the dependencie in the build gradle does?
Remapped
You're not remapping your plugin if you're not getting a ClassDefNotFound exceptipn
how do i do that
i cant find anything in the internet
Use the Patrick remapper plugon
okay ty
private final HashMap<UUID, HashSet<Home>> homesMap = new HashMap<>();```
whys this bad?
Anyone know how to make a solid block that warps the player when touched?
Yeah PlayerInteractEvent
i made a nether portal out of obsidian and purple glass and I want them to be teleported by running into the glass.
yk how some servers got those like "custom portals" and when u touch the water or glass it tps you? basically that hes saying
I overengineered the fuck out of those at work
In short you want to have some sort of 3d shape / bounding box that the player can intersect
When they intersect, you get the destination for that given player and send the player there
These destinations can be as simple as just teleporting a player to a location, all the way to sending the player to a different server entirely
And you can perform "teleport attempts" either every tick or when the player moves, it's whatever
As long as you make the bounding box slightly bigger than the block it should count any "touches" to it
hey guys is there any way to detect attack charged creeper?
I tried this :
if (!(event.getDamager() instanceof Player player)) return;
ItemStack itemStack = player.getInventory().getItemInMainHand();
if (itemStack.getType() == Material.AIR) return;
if (hasEnchantedItem(player)) return;
if (!(event.getEntity() instanceof LivingEntity victim)) return;
EntityType entityType = victim.getType();
if (entityType == EntityType.CREEPER || entityType == EntityType.CHARGED_CREEPER || entityType == EntityType.SLIME) {
System.out.println("Hello World");
}
but the CHARGED_CREEPER CANNOT FOUND in EntityType
creeper.isCharged maybe-?
They're still regular creepers, they just have slightly different data
How much do you get paid at work
bit more
SkyblockCore is paused because I have a lot of other stuff going on
🤔 why is %player_name% returning ...
Have you considered Flyway for database migrations
Not really and it isn't something I'm uh
actively thinking about
Last thing I was doing on SkyblockCore was:
- Platform-agnostic menu API
- Runtime library downloader
Ah
after that I was gonna do large-scale testing of every possible environment
thanks
spigot with worldedit, spigot with SWM, spigot+bungee, spigot+velocity, 2spigot + bungee, 2spigot + velocity
2spigot + bungee + velocity
and that shit just takes time that I don't have
if (victim instanceof Creeper creeper) {
creeper.isPowered();
}
I fixed it thank you 🙂
💪
Is bungee hard to secure properly?
Velocity basically encripts your traffic with async encryption
I remember I was reading the documentation early in the morning, and I had no idea what it was talking about
(public & private keys)
Bungee doesn't give a fuck about that and a common exploit is that you can make your own proxy that connects to some exposed backend and spoof shit
proper solution is to just.. not expose it to begin with
close any backend ports and firewall them to your proxy
What do you mean backend
backend = spigot
because the backend has to be offline mode nothing stops you from creating a bungee proxy that's also offline mode
and connecting it to some random backend
and connecting with a cracked account under the owner's name
Is bungee cord just a proxy manager?
no it's just a proxy with no encryption
Velocity fixes this by encrypting the data in the proxy and decrypting it in the backend
If it isn't encrypted properly it ain't your proxy
Ok I am confused
What does the layout look like with bungee cord
Client -> proxy(bungee) -> spigot
Exactly
That's how it looks with any proxy
Client connects to a proxy, proxy redirects traffic to backend
Client <-> proxy <-> (unsecure) backends
Oh I understand now
Were you talking about how people could directly connect to spigot instead of the proxy then spigot
Bungee exploit:
Client -> client's proxy -> your unsecure backend
I don't understand what the "client's proxy" is
Let's say you run a bungeecord network
Yes
The bungee service runs on 25565 and your backend spigot server runs on 30000
And they're both open ports
Yes
If I connect straight to 30000 it will kick me because bungeecord is set to true therefor spigot recognizes a handshake instead of just a straight login or wtv
And if I try to connect with a cracked account to your proxy it won't let me, because your proxy is running on online-mode
(backends are always offline-mode for any proxy to work)
I understand the idea
Now, I can run my own proxy
Set it to offline-mode and login with the cracked account that has your name and uuid
and bomb the backend server
To prevent that, I should whitelist IPs connecting from my proxy, correct?
You should close port 30000 so it's only accessible internally
Your proxy can connect to it but the port is closed to the "outside world"
would look like this
Client -> Client's proxy -X> backend
I understand the attack, but now I don't understand bungee cord
Proxies are just a middle man between the client and the server, right?
Correct
The point of proxies is to basically simulate the concept of switching servers
By making the client think it's just switching worlds and stuff
So if the proxy is hosted in Europe, how would it connect to a backend in North America, which has a closed port
The backend server in north america would export port 30000 only and exclusively if the request comes from your european proxy
So that's where IP whitelisting is used
And that's what a firewall is for
Hey guys is there any way to get all classes which extended specific parent class?
Why does your backend have to be in offline mode
hmm what If I use annotation?
If it's in online mode it'll try to authenticate requests with mojang's servers
And because the proxy effectively emulates the login part when connecting a player to a backend server it isn't really authentic
how can I upload my code in here?
The player already chose to authenticate when connecting to the proxy, so there's no need to authenticate again and have duplicate sessions
So it just.. doesn't
?paste
I have lots of my own custom enchants so I wanna register it with annotation
Look into jar-file scanning
Scan every entry, load the class, look for annotations and do stuff
hmm
I think I understand everything
Back when I worked at Akuma we had a @RuntimeInitialized annotation that automatically found a constructor, injected some variables and created an instance
Maybe do something similar idk
wow amazing
Thank you illusion
hell yeah one less conversation to manage
tryna debug code while answering both of you nerds
I tried this :
public class CustomRegistryManager {
private final EnchantRegistry enchantRegistry = ShibaCustomEnchant.getInstance().getEnchantRegistry();
public CustomRegistryManager() {
test();
}
private void test() {
Reflections reflections = new Reflections("kr.shibapark.shibacustomenchant.registry.sword");
Set<Class<?>> annotated = reflections.getTypesAnnotatedWith(CustomEnchantment.class);
System.out.println(annotated.size());
}
}
package kr.shibapark.shibacustomenchant.registry.sword;
import kr.shibapark.shibacustomenchant.api.annotation.CustomEnchantment;
import kr.shibapark.shibacustomenchant.api.enchant.AbstractCustomEnchant;
import org.bukkit.event.Event;
@CustomEnchantment
public class EnchantZombie extends AbstractCustomEnchant {
@Override
public void action(Event event) {
}
}
but why that annotated classes return 0 size?
¯_(ツ)_/¯
[13:33:50 INFO]: [org.reflections.Reflections] Reflections took 6 ms to scan 123 urls, producing 0 keys and 0 values
[13:33:50 INFO]: 0
just return like this 😭
different classloaders maybe
different classloaders?
wdym exactly different classloaders?
brother look things up you're tryna write a hella complex system with little to no clue on how java works
you come across as good at relationship 👍

Might be a little too harsh there but I'm not gonna do a super in-depth explanation for a system I feel is stupid
You're gonna end up with a black box of magic that automatically loads stuff and only you know how it works
And if that's the objective then please enjoy the journey of learning all about classloading but that's not something that the average spigot dev is expected to know how to use, maintain and overall support
Question about the built in bukkit conversations. I'm trying to take a string input from a prompt and I need it to suggest a list of responses and tab-complete. How would I go about doing that?
I really doubt you can tab-complete without a /
Only way I'd see how is by making fake players but I doubt those can have spaces
seems a bit over complicated XD
Has a nice end result but yeah you need a lot of hacky stuff
And I really doubt the result is flawless, at most you'd have your own name show up too
ok. thanks
good evening
just finished all my work for the week in under 2 hours
record time
can't wait to be yelled at for not meeting the hour quota
where u work at? just curious
did u get into hypixel
nah my only interview went so bad they never got back to me
Currently working for a minecraft-partnered bedrock studio
working on their upcoming network
You still had 17 interviews to go anyway
did 6 interviews and got my ass rejected
minecraft bedrock?
yea
oo nice
network runs on spigot + geyser because it's more stable than any bedrock platform
is your name influenced by html5? like markdown 5
and I'm responsible for writing the wackiest systems
md5 is a hashing algorithm g
frfr
^
I knew that 💯
broke nitro spotted

would rather get something to eat with that money
me welcoming your last 10$
😂
but yeah after I got rejected from hypixel back in like
2022 I think
I was in 11th grade computer architecture class when I got the interview email I remember vividly
I got depresso expresso for a year
Guess they hired choco instead
im in 11th grade rn
hypixel is kinda ass ngl. other than the fact that simon drives a mclaren
and for that year I just spent the whole time working on my hypixel game
looking at all their dev blogs, every minikloon post
learning the tech they use, learning how to work with it
😔😔
Wrote guides on grafana, minigame development and stuff
and then I applied like 5 times and have been ghosted

and it's been like 2-3 years now so I kinda just gave up on hypixel
At work we use kt
But outside of work I use java when possible
My condolences
yeah ngl it's kinda ass
its like mix of python and rust
but I've got some wonky career opportunities by listing kotlin as a language I work on
working on discord bots with webservers n stuff
o
It's not THAT bad but it's meh
so much object spam
Q: I use entity.hideName, but it only makes it turn to onHover. is there a way to disable the entity name showing on top?
is there any way to detect LivingEntity Vindicator + Raid Captain + Evoker ?
fym I pay hella money for my 10$ nitro
pay 10$
what da flip
?changename
Name changes on the forums are granted to those who have donated to the project. Donations are processed manually and generally take up to 24 hours. The donation widget can be found on the home page of SpigotMC at: https://www.spigotmc.org/.
I came to the conclusion that I should probably just write out more mechanics and what not then figure what all should be delegated to each module, any other insights perhaps?
entity.setCustomNameVisible(false)
or
entity.setCustomName(null);
if (entity instanceof Vindicator || entity instanceof Evoker || isRaidCaptain(entity)) {
// Nom nom
}
private boolean isRaidCaptain(LivingEntity entity) {
return entity.getEquipment().getHelmet() != null && entity.getEquipment().getHelmet().getType() == Material.OMINOUS_BANNER;
}
wawit
me when I stick a raid banner on my head with essentials /hat
thanks I already fix it as the same way
Oo
Is this actually a thing entity.getScoreboardTags().contains('PatrolLeader')
so, like ```java
private boolean isRaidCaptain(LivingEntity entity) {
return entity.getScoreboardTags().contains("PatrolLeader");
}
check, they should have PatrolLeader NBT iirc
oh thank youu
why it's in scoreboard Tags? I really can't understand minecraft structure
bro spilled the curry 😢
val playerMoves = mutableMapOf<ServerPlayer, MutableList<Move>>()
why is my list null?
Most likely because you never create a list
when i try to set the value it saids its val and can't be changed
you have to show more code
can't change val
use this as val still and have a get and add class or set/get
for ex ```kt
val playerMoves = mutableMapOf<ServerPlayer, MutableList<Move>>()
val moves = playerMoves.getOrPut(somePlayer) { mutableListOf() }
moves.add(someMove)
wait why are you using a ServerPlayer instead of a bukkit Player
oh im dumb, i never added them to the map, sry guys
im making some custom things, its working cross server and stuff
custom
thank you
"custom" what
ServerPlayer is a NMS class
Cannot resolve symbol 'me'
whats wrong
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.6</version>
<scope>provided</scope>
</dependency>
how can I upload a image on here?
thanks
https://imgur.com/a/3n9ZmCv
can I remove like Snout description? & intgredients
Nope, there is no flag to hide that
Did you make sure this dependency was found by maven?
oh, got it
Yessir
Show your entire code then pls
https://pastes.dev/6PKGAtKZtm
pom.xml
and
https://pastes.dev/pUFC8nXvHB
code
Alright, does it compile at all?
Aa wait a minute, When I deleted the reposity and wrote it again, the 'me' problem disappeared, but this time there was another problem.
Cannot resolve symbol 'PlaceholderExpansion'
🤨
Alright, but does your code compile? Im asking because this could just be your IDE being confused.
nope
How do you compile?
The problem is solved sir, but this time there is something else I can't solve 😅
Now I integrated the plugin with placeholderapi, I made a scareboard using simplescore to show the statistics.
But it looks like this
Kills: %blocksinpvp_kills%
Did you register the placeholder properly?
yea Sir
Have you checked with the papi command?
Did you check your placeholder using the placeholderAPI command?
Actually when I say papi list there is only simplescore, interestingly it has not been downloaded.
ecloud download blocksinpvp did not work holder is also correct hm
You dont need to download your own placeholders...
Just throw your plugin on the server and make sure they are registered
Unless you specifically uploaded it to ecloud (which i would not recommend)
I think the problem is caused by the plugin not being installed correctly.
[10:29:39 ERROR]: Ambiguous plugin name PlaceholderAPI' for files plugins\PlaceholderAPI-2.11.6.jar' and plugins\BlocksinPvP.jar' in plugins'
Check your logs for exceptions
This means you have the plugin installed twice probably
Wait... did you set the name of your plugin in the plugin.yml to PlaceholderAPI??
You did that, didnt you
nope
name: BlocksinPvP
version: 1.0
main: dev.bingulhan.BlocksinPvP
api-version: 1.8
commands:
stats:
description: Shows player statistics
thats main
The Error above tells me otherwise...
Like? hm
u say like softdepend:
- PlaceholderAPI ?
First up add a depend or softdepend for PlaceholderAPI
yea
im adding
still same
[10:37:03 ERROR]: Ambiguous plugin name `PlaceholderAPI' for files `plugins\PlaceholderAPI-2.11.6.jar' and `plugins\BlocksinPvP.jar' in `plugins'```
Open the BlocksinPvP.jar with 7zip or winrar etc and check the plugin.yml
wth name is placeholderapi
I might have a gist
how do i hide the enchant list on an item with item meta
Nvm you have the provided scope on your papi dependency...
Tell me which steps you take to compile the plugin pls.
Add the HIDE_ENCHANTS ItemFlag
oh alright thanks
I think he builds artifacts and this copies dependent artifacts in the jar
How did I compile it? I don't understand sir
Do you use any commands, any buttons. What are the steps you take in order to 'create' your jar from your code?
If you are talking about creating a plugin jar, I first selected the area where it should be saved, and build, then build artifacts
hi guys, so all my entries have the same name so i had to use the index to differntiate them inorder to set em up on different lines, but now two numbers are seen so how do i make the scoreboard not show scores? any other work around would be fine too
Alright, so that ignores your pom and maven completely. When you use maven you should
- Never add any artifacts to your project
- Never build artifacts
All dependencies are only added to your pom. You should never have to add jars to your project.
And you should only compile using the maven lifecycles.
(In IntelliJ you can click the maven button on the top right and then run clean once and package afterwards)
You could use different color codes in order then no score should disapear.
Hope its quite understandable
You could just do a chatcolor in every score a different. Then it should work as far as i know
I changed the project to maven, I chose gradle
oh
You neither use maven nor gradle.
Building artifacts ignores any dependency manager you have.
ima go try it, but there aernt enough colors for each bar does like doing ChatColor.White + ChatColor.White + ....
like i add it
x times
and x would be the number
would that work?
Yeah that could work
alr imma go try it thnx
How
Again: You arent using maven properly. You arent using maven at all.
You need to build your jars using the maven lifecycles. Dont build artifacts.
Are you using Intellij?
Alr Tell me the result
I disabled all the files in the project, saved them somewhere and deleted them, there were 3 of them, only main remained, there is not much in it, but it still gave the same error
Yea
cuz ur still using the wrong method to build your jar.
got it 👍
If you're on some 1.20.? version you can remove the red numbers on the side.
dont we just LOVE deadlocks
average rust skill issue haver
oh wai really how?
Perfect
Isnt that just with a resourcepack?
No, 1.20.3 added the feature (last line)
But I can not find it in the API, maybe it's still not in?
Since I was getting a few import errors in Maven, I tried to solve it by choosing Gradle, but there was a problem with two plugins conflicting in Gradle and I switched back to Maven, now the plugin has been loaded without any problems, I will test it
Yes, it appears on the scareboard without any problems
Oh nice i just found infos about a rp that removes it
The API should be in, I just can't find it :D
Can someone help out here please ?
@lost matrix Thank you for your help sir 🌹
maven is being a bitch, it doesnt see any of the depedencies of my projects, other than invalidating the caches is there anything else i can do?
Update the IDE
like restart it? done already
it is already to latest
Does your project compile?
no wait after invalidating caches only one dependency is giving problems and maybe ik why
hey @lost matrix smile you know alot about mongo right? im tryna use their time series collection. which requires a timefield. now if i were to add my date directly to the document there would be no problems. but i serialize my class using gson and then parse the document. which does not result in a valid "bson iso date". do you know how i can handle this?
Hm, did you implement a custom codec for MongoDB or do you manually convert from Bson to Json
this is the gist of what i do
i dont have any custom codecs
and it works. but like the Document class automatically formats java's Date class correctly to a bson iso date
but gson doesnt obviously
Myeah, in that case you need to register a TypeAdapter in your Gson instance and make sure the Date is formatted in ISO 8601
So "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
yeaa so i tried this
this one is valid
but my result: 2024-08-24T10:19:31.991Z
doesnt add the 00:00 for some reason
with your pattern same thing
Try a different format
Otherwise you could simply throw your date directly into your document after calling Document.parse(json); you simply
add doc.put("date", date); its a bit of a workaround but should work fine.
yea. wanted to avoid that. but i guess if i cant find another way that should work.
You could create a Bson document, add a date to it, and then deserialize it to Json.
This should show you the representation needed for your dates.
is there a Sson format?

so its correct
but i need to add the date stuff?
ig
Hm, yeah you probably had {"date": "2024-08-24T10:19:31.991Z"}
😂

The date field contains an object. Pretty sure that what you are doing is gonna mess things up.
Implement a JsonSerializer/JsonDeserializer and register it in your Gson instance for Date.class
public class DateSerializer implements JsonSerializer<Date>, JsonDeserializer<Date> {
private static final SimpleDateFormat isoFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
@Override
public JsonElement serialize(Date date, Type typeOfSrc, JsonSerializationContext context) {
JsonObject dateObject = new JsonObject();
dateObject.addProperty("$date", isoFormat.format(date));
return dateObject;
}
@Override
public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) {
JsonObject dateObject = json.getAsJsonObject();
try {
return isoFormat.parse(dateObject.get("$date").getAsString());
} catch (ParseException e) {
throw new RuntimeException(e);
}
}
}
Anyone got experience with multiverse api? Im trying to import it in the pom.xml file and it wont work
Show your pom

<groupId>com.onarandombox.multiverseCore</groupId> <!-- Don't forget to replace this -->
<artifactId>Multiverse-Core</artifactId> <!-- Replace this as well -->
<version>4.3.1</version> <!-- This too -->
<scope>provided</scope>
</dependency>```
i replaced it just like the docs told me to
Did you add the repo?
ye
Could not find artifact com.onarandombox.multiverseCore:Multiverse-Core:pom:4.3.1 in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
Could not find artifact com.onarandombox.multiverseCore:Multiverse-Core:pom:4.3.1 in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
Show your pom
?paste
yea this works
ty
Ay, nice
anything found?
Looks fine to me.
no dependency information available
also no javadocs for this, very bad documentation on their end
Where do you have the 4.3.1 from? I dont see that version in their repo
it says just lookup the newest version on their spigot page and use that
As for the version, use the latest release version based on their respective Bukkit site.
where did u find that info?
Their repo
wdum?
🤨
oh ok
Yeah their documentation is horrible
just tryna rename a world 😿
What do you need multiverse for then? Or is it a world that was loaded by multiverse and you are trying to rename it on the fly
every week i want to rename the current farming world to "farming_world_old_(number)" and then paste a schematic in the newly generated farming world
@lost matrix turns out i didnt need the isodate after all.. xD when reading it just returns epoch millis. which works with inserting as well.
themoreuknow i guess
lol
may i ask what theme that is? xD
yea, Settings -> appearance -> ui options
This one worked:
<dependency>
<groupId>com.onarandombox.multiversecore</groupId>
<artifactId>Multiverse-Core</artifactId>
<version>4.3.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
thanks
When using Bukkit.getSchedular().runTaskTimer(...) how do i cancel the task on condition? Or do I just have to init a new BukkitRunnable()
?scheduling
^^
oh thanks
Is it possible to pretend to kill a player without killing them? I mean fakedeath
What are you trying to achieve
?xy
Check in a Damage Event of entities If the finaldamage is 0 or below then cancel the event and do what u want like teleporting to respawnpoint
Respawn screen comes after death and it is not possible to remove it in older versions, fakedeath prevents features such as kills death from increasing.
Health - FinalDamage <= 0
What I want to do is to have the player go into spectator mode after he dies, and teleport to spawn after 3 seconds.
hmm
What?
I am confused
Wait a sec
ok
u could do it like this: ``` @EventHandler
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
if (event.getEntityType() == EntityType.PLAYER) {
Player player = (Player) event.getEntity();
if (player.getHealth() - event.getFinalDamage() <= 0) {
// Cancel the damage event to prevent player death
event.setCancelled(true);
//What u want to do if the player "died"
}
}
}
}```
@slate siren
Thank u ill testing noww
Alright, tell me if it works
No, it didn't happen
It actually kills the player and the death screen is also visible
Thats code
you didn;t register the listener then
and if u do the entitydamageevent?
yeah im pretty sure it should work because im using it in my skywars plugin
i did
hello i build spigot with build tool for elder guardian effect
how can i import this to libraries?
?maven
idk whats the problem is for me it working
its working now for me too
ty
for helping
Alright, no problem
how can I send a player from server 1 to server 2, I have a Velocity Proxy
?pmc on bungee
I get "com.mongodb.MongoInterruptedException: Interrupted waiting for lock"?
@Override
public void onLoad() {
this.mongoDB = new MongoDB();
System.out.println("[CorePlugin] Loading MongoDB!");
}
// This causes it
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event)
{
Player player = event.getPlayer();
event.setJoinMessage(ChatColor.BOLD + player.getDisplayName() + ChatColor.RESET + ChatColor.YELLOW + " has joined !");
if (this.mongoDB.players.find(eq("uuid", player.getUniqueId().toString())).first() == null) {
this.mongoDB.players.insertOne(new PlayerPojo(player.getUniqueId().toString(), "", (float) 0));
System.out.println("No database entry for " + player.getName());
}
}
Why are you running database queries syncrhonously
this is for Bungeecord
Genuine question
yes, this channel is for Spigot/Bungee
You're borderline killing your server every time a player joins
How would I do it then 😭
No DB access on the main thread
Oh
declaration: package: org.bukkit.event.player, class: AsyncPlayerPreLoginEvent
async player pre login shoudl have an UUID
Use this event it supplies a uuid and is run asyncrhonous
Else doing it in the Login/Join event every player on teh server gets lag anytime anyone joins
Hello, how can I get an item's attack speed ? Here is the code I already got :```java
for(Material material : Material.values()) {
ItemType itemType = material.asItemType();
if(itemType == null) continue;
Multimap<Attribute, AttributeModifier> defaultAttributeModifiers = itemType.getDefaultAttributeModifiers(EquipmentSlot.HAND);
Collection<AttributeModifier> attackSpeedModifiers = defaultAttributeModifiers.get(Attribute.GENERIC_ATTACK_SPEED);
if(attackSpeedModifiers.isEmpty()) continue;
double attackSpeed = 0;
for (AttributeModifier attackSpeedModifier : attackSpeedModifiers) {
attackSpeed += attackSpeedModifier.getAmount();
}
System.out.println(material);
System.out.println(attackSpeed);
ITEMS_ATTACK_SPEED.put(material, attackSpeed);
}```
But, well, for a diamond sword, I get this values instead of diamond sword's attack speed (which is 1.6) : DIAMOND_SWORD -2.4000000953674316
How can I fix that ?
Also, is my code to get the time in ticks for the attack speed, based on the attack speed, correct ?java public static int getTicksFor(@NotNull Double attackSpeed) { return (int) ((1 / attackSpeed) * 20); }
Thanks in advance
If you use AsyncPlayerPreLogin
Don't wrap the call in a complete able future
You have 30s before the player is timed out that's more than enough
And I wouldn't use onAsyncPlayerPreLogin?
You use that one
I miss wrote
does clone() clone arrays properly?
@EventHandler
public void onAsyncPlayerPreLoginEvent(@NotNull AsyncPlayerPreLoginEvent event) {
String name = event.getName();
InetAddress ipAddress = event.getAddress();
UUID uniqueId = event.getUniqueId();
boolean transferred = event.isOnlineMode();
// Your logic here
}
```it's complaining about the transferred
🤷♂️
why starting db already in onload
Idk I thought it would solve my issue
You'd hope so
shallow clone
You see the diamond sword doesn't necessarily have an attack speed of 1.6
By default technically it does because default attack speed is 4
But what the dia sword does is actually have a a tag that affects the attack speed by -2.4
If you have armor that speeds up your attack speed, the diamond sword will still slow it down by 2.4 but overall your attack speed will be faster
oh okay
so i've did double attackSpeed = 4;
and then I loop through the default attribute modifiers
And, looks like it's good
Well maybe u should get the default from the player itself
[14:50:57 INFO]: DIAMOND_HOE
[14:50:57 INFO]: 4.0
[14:50:57 INFO]: NETHERITE_SWORD
[14:50:57 INFO]: 1.5999999046325684
[14:50:57 INFO]: NETHERITE_SHOVEL
[14:50:57 INFO]: 1.0
[14:50:57 INFO]: NETHERITE_PICKAXE
[14:50:57 INFO]: 1.2000000476837158
[14:50:57 INFO]: NETHERITE_AXE
[14:50:57 INFO]: 1.0
[14:50:57 INFO]: NETHERITE_HOE
[14:50:57 INFO]: 4.0
[14:50:57 INFO]: MACE
[14:50:57 INFO]: 0.5999999046325684
[14:50:57 INFO]: TRIDENT
[14:50:57 INFO]: 1.0999999046325684```
through his inventory ?
Nope
equipement slots ?
Player#getAttribute
oh yeah
And then all equipment slots
that'll be consuming ?
But you need to check that the attribute is active for the equipment slot that it's in
yeah 😔
How often are you calling this code?
every time a player interact with a tall grass / grass
I basically want him to attack through grass
Yep you can listen to an armorequipevent
yeah for sure
From mfnalex
and then put that in a list
always him x)
"null server" is crazy
what ?
sh
we saw it x)
my own server
oooh
in rust
gg
ofc
x)
now just need to load chunks from db and send them
then i got actual world loading
do it in assembly
💀
or in cobol
haskell fr
brainfuck 👍
x)
with every cell of my body
(minecraft is bad)
YoU sHoUlD sWiTcH tO pApEr 🤓
what a good thing
whats with paper
pApEr Is PeRfEcT fOr PeRfOrMaNcE
What's wrong with chunks
Spotted Leaf has made some of the best patches for paper hands down
complicated tbh
Well ofc it's not easy they're trying to be somewhat efficient
It requires packing bytes into ints and longs to save memory etc etc
Hi iam working on reaweakning system for my plugin , so when a player reach (final rank) he can run a command , that ill reset his rank to default ..
also ranks are kills dependant so when i get 5 kills i change rank to the rank that require 5 kills to unlock .. etc
iam just not sure if i should reset kills to 0 too
ye
block entities have packed xz
I still get the interuppted lock
what exactly is the question?
Is it even possible to add custom items to creative menu or it needs NMS hackery?
no
its client side
should i reset kills too ?
cause the ranks depend on kills so if the kills still the same , there will be a glitchj
i feel thats a design question we can't really decide for you
it will give him the same rank he had if he kill another player ..
Damn, thanks for clarifying!
yeah ik
Hello, how can I check if a block is a short grass, a tall grass, a sea grass, a tall sea grass, a flower or a crop ? Is there a method for that ?
nah dont reset kills
(ik = I kill ? for the joke ?)
ik is i know
ik
Theres probs a tag for it
declaration: package: org.bukkit, interface: Tag
I came to block.isPassable() && !block.getType().isInteractable(), looks like it's good
Thats a very hacky solution
you think ?
It is
for tags, there is minecraft:flowers, minecraft:replaceable and minecraft:crops
but, I forgot to mention that I want to include sugar cane and kelps 😅
no
I want it to be maintainable
not for sugar cane and kelps 😔
yeah
but it's better if it covers everything
They’re not crops?
nah
they are not in the crops tag
sugar cane has an age, but not kelp
last i remember kelp had an age
my bad, they have
if they are a kelp, not a kelp_plant
What class would yall put this under? java public static boolean isInt(String s) { try { Integer.parseInt(s); } catch (NumberFormatException nfe) { return false; } return true; }
MiscUtil? xD
or just put it in the main class
are you making a Spigot plugin?
yes
just make a file called Util/Utils
there might be some name conflits but IntelliJ will start prioritizing yours first after a little while
Use Ints.tryParse()
MathUtil>>>
Spigot ships with with Guava
Thats just to convert to an int though?
I assume you want to use the int
if it is one
That method returns an Integer which is nullable
null if it isn't an int and the int value if it is one
Gotcha, Thanks
anyone got a good glow api I could use? I'm using https://github.com/SkytAsul/GlowingEntities/blob/master/src/main/java/fr/skytasul/glowingentities/GlowingEntities.java but it's reflection hell and it's buggy at times
Do you want the api to change colors?
glow is quite easy. Not sure why you would need a lib for it
its somehow not
Spigot has api for both teams and glow
Problem is if you want specific people to see the glow
yeah then you need packets
team packets
Meth is MathHelper, not MathUtil
smh
The scoreboard api can actually handle different colors for different people
Problem is compatibility
Wait wdym
?paste
This was a sample rainbow team color class https://paste.md-5.net/jolepicapi.java
just added a cycling glow color to all creatures
I see, thank you
But are you able to allow only certain people to see the rainbow effect?
you could but not as simple
O
as I said you just make a scoreboard for that specific player
Yeah
Ty guys
So I'm guessing it would be
- create a temp color scoreboard if it doesn't exist based on the player scoreboard. Set the color
- add the glow player and the reciever (watcher) player to the team
- set the reciever glow to true
Only thing tho is that stuff like dropped items which i want glow might be hard tho
It's an entity so it shouldnt be that hard i dont think? or does Dropped items fall under a different type
not much different
you just set the item to glowing and add it to the team
how to ban someone with spigot api?
player.ban?
Isn't there a banlist which you have to use to ban the player
its pretty complicated
its so weird
firstly its imperative that you grab a player object
It has like 4 thousands arguments
once you have that you must use the ban method
then?
yeah but its weird, like waht is an instant
A class
if you don't want to use an Instant use Data or Duration
When the ban expires
The time you want it to end
Olivo we look the same
addBan(player, timeItends, then what is s1
What confuses me is the name of the variable tbh
s and s1
You should download the javadoc to your project
Javadoc has more descriptive names I think
download sources
and add the javadoc jar
or if for some reason you don't feel like it
literally
declaration: package: org.bukkit.entity, interface: Player
ITs a weirdly configured project
i'll just look at the online javadoc
but thanks
like its not a plugin
You can add javadocs into the IDE o.o
yes
ik but i spent too much time configuring this
Are you using Intellij?
yea
Welp, doing that now. Yes @chrome beacon
Open the maven/gradle tab on the right
Then click this
and download doc/sources
That's IJ, not maven or gradle
k
Well IJ is using maven/gradle to find and download sources
i'm still used to eclipse
But a major part of the work is still done by IJ isn't it
Depends on what you mean by majority
Show it to the user? then sure you're in their text editor?
by "a major part" I just mean a lot
It starts the process, it finds the files, and lets the user see those
Well, if not IJ you would neither have sources nor decompiled code right in your IDE soo
Or, well, no
I said it wrong
other IDEs do have it
Yeah
????
I just meant IJ makes it easier to find
There are people who use vs code as a java IDE
omg..
I use to use NotePad++
my brothers Java course tells them to use VScode 💀
Murder them all.
Guys, in a premium resource, would spigot replace this placeholder?
private static final String LICENSED_TO_USER_ID = "%%__USER__%%";
wtf is cp
it should
Then it's not working, I asked a friend of mine to download the resource (which he has purcharsed) and the placeholder is not being replaced
BRO WHAT
STOP, I MEANT CyberPunk
Please tell me there is more context
Connection pooling?
CyberPunk
💀
never played it lol
WHY DO YOU STILL HAVE THOSE?
I have a fuckton of stuff like this
Internet never forgets
Pov: @quaint mantle when he sees cp
I think ima start doing this xD
😮
why did this server turned into rp
I mean, there's nothing bad about cp
mother
It's a good game
And this is why we lurk folks
Paper more like shittier
I think you have a skill issue
paper is good tho
ehhh
I hate paper, fr, in the latest updates, they decided to simply remove the vX_Y from package name
Why you got 2 genshin impacts?
One not enough? lol
you got it
Breaking tons of plugins in the process

