#help-development
1 messages · Page 1884 of 1
i know java
but i didnt master it yet
lmao
it takes 3 lines of code for people in here to come to the conclusion you don't know what you're doing
i was going to do that
stop running through the entire player list any time any player moves
oh lord
lmao
Why do you need to use break
look at the code
looks like he neither really knows how to use an if statement nor knows about returns
if they use that special armor the loop would stop
or at least thats what i hoped for
you also need to go talk to a priest about the sins you just committed
LMAO
there was a course on udemy that is made by stephen king
is it worth buying to learn
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
i finished that course from sololearn
ok
and see how it looked like
can we get a mod to delete the second entry please
When you say "uses armor" do you just mean has the armor on in a certain world?
is it possible to spawn an entity when an arrow from a specific bow hits the ground?
yes, but some spesific helmets without using any other armors are allowed
Use the EntityShootBowEvent to add a pdc tag to the arrow, and then use the ProjectileHitEvent to check when it hits the ground
The average java library tutorial:
- Add builders
- Add Consumers and Functions
- return this;
Looks like in your sample code you got sent a little bit down the wrong path. Let me make sure I'm with you here.
Certain worlds do not allow any armor to be on, except for some special helmets which are allowed everywhere. When a player wears armor in those worlds, they should be ejected from the server, right?
If someone doesnt know how to create builders, DM me I'll help you out!
Can't forget the abstract factory design pattern and the decorator design pattern which are both based as fuck.
https://i.imgur.com/Zf9Mofy.png
What am i doing wrong, I thought this would work, it's throwing the error: https://paste.helpch.at/mixewoqalu.bash
The format from config is: https://i.imgur.com/MczHTqK.png
How can I check if a lever is powered or not? I have an event listener to see if a lever is flicked, now I need to check the current state of the lever.
read the javadocs
Do you have a link to those? All the info I can find is dated
For example, all I can find is the isPowered() method which is deprecated and no longer works
?jd
long time no see
🌊
So I found the "BlockData" interface but I don't know how to pluck out just the [powered=true/false] element
Any more clues 😉
see which is the subclass useful to you
yessir
the format have to be compatible with the AsyncPlayerChatEvent format á String#format
Figured it out, thanks everyone! 😉
a switch statement is a switch
do you guys have any idea why
@EventHandler
public void onSpawn(CreatureSpawnEvent event)
{
getLogger().info("CreatureSpawnEvent");
}
``` won't print in console
damn you got his number?
idk if the event is even being called, all the other events in the class work fine
ok nvm i found it, button is just button lol, funnily not powerable
#empowerthebuttons
nevermind ill try entityspawnevent
ok now to figure out why my tracking compass is slightly offset
why does entityspawn event just start getting spammed as soon as i join
same for creaturespawnevent
Called when an entity is spawned into a world.
you are an entity
and as soon as you spawn
nearby entities do too
nice
compass now 100% works
it's like my grandma used to say, two big dumbs make one big brain
it's amazing how much you can get done just using vectors
Have you checked for an event that fires when a player changes their armor so you can stay away from using the PlayerMoveEvent?
nope
there is none offical
but there is: https://github.com/Arnuh/ArmorEquipEvent
i can prevent them to wear armor without any errors ors exceptions
you can also check the Inventory Click Event... but its a lot you have to care of
but i couldnt figure out how to add that special helmets
and im also gonna change that kick situation i've just added that for testing
if the player clicks on the helmet-slot with an custom helmet at Cursor ?
then just set the hand to what the helmet is currently (null or other helmet) and the player helmet to the cursoritem
not really thats not what i wnt
im rewriting my code when im finished i'll send it
when they use special helmets, i dont want them to use any other armor pieces
so instead of creating hasAnyArmor method, i should create a variable for each armor slot so i can check all of them right?
depends on how this should work... can they put on the custom helmet when they have an armor already ?
then you should have "hasAnyArmor" and "hasSpecicalHelmet"
hasanyarmor = true means they can not put on the special helmet
and hasspecialhelmet = true means they can not put on default armor
if(hasAnyArmor && hasSpecialHelmet)
if i do this, they wont be able to put on anything
if i do how you said it
right?
yes
of course they should be able to take of the helmet when hasSpecicalHelmet=true
https://paste.md-5.net/idoliyucal.java @spiral light can u check this
why one method for both ? that doesnt make sense
you first check for items and if there is an item you return true...
AFTER that you want to check if there is an item at head... but this would already return true
you probably should switch to pdc and not using custom names too ^^
?pdc
yea thats what im struggling with
just create 2 methods... one for checking if there is an item at all
and one for checking if there is a special helmet
when i create that method, the first one also gets triggered because special helmet is also an armor
i couldnt find out how to prevent that
If you call hasarmor and it's true
You can simple check if the other one is true too
If it's true it's a special helmet ... If it's false the player has default armor
ooh makes sense
While I'm upgrading one of my plugins to 1.18 I have some trouble importing the craftbukkit classes. I'm trying to use the classifier remapped and remapped-mojang, but that just ends up with "Cannot resolve org.spigotmc: spigot :1.18.1-R0.1-SNAPSHOT" in the log. Any idea what I have to do?
https://pastebin.com/mPP7Zss3
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Did you run BuildTools for 1.18?
Also nms for 1.17+ has changed a bit
?paste
I ran it for 1.18.1
@spiral light https://paste.md-5.net/fumarelaqa.java this didnt work either
Did you register the lsitener?
Dont use names to identify custom items
im currently using vanilla item for testing
And dont use FileConfigurations like that.
You should always read the whole config when the server starts and then access variables instead of config entries
oh got it
i think there isnt spigot artifact for 1.18.1 yet?
Idk im still using 1.18 for spigot
When I say spigot i meant the artifact
question for bungeecord, is isForgeUser() still supported? because it seems to me that it isnt working at all
?jd
Either way, this error happens (Cannot resolve org.spigotmc: spigot :1.18.1-R0.1-SNAPSHOT) when I'm not using the buildtools generated file, I'm referencing to the spigot repo using the pom.xml I included with the message. It's when I add <classifier>remapped</classifier> that this error shows up
Build 1.18 instead and use that
Remapped or the ordinary one?
Are you sure you are using forge and not fabric.
This is also not incredibly reliable.
Copy classes you that you need
😐
Yep, its Forge, I have read the documentation but I think that info about 1.8 / 1.7 is deprecated for a long time (since I am testing it with 1.18.1)
Hm? Thats how you supposed to use it
hmm why not use protocollib ?
im using protocolib
just use buildtools to install the remapped version
you will find the remapped classes in the cloned repositories
remapped
Hi guys, does anyone know if it exists a sort of ping packet that I can send through bungeecord channel to see if a server is online?
Oh wow, ty
np :)
Could be possible that mongo Atlas (free cloud for mongo) its not creating by default the colections when they dont exists?
Cuz in getting NPE (null pointer exception) when I dont use mongodb installed locally on my pc
The db or the Connection?
connection, if im right about my assumption lol
@crimson verge there is a problem. My plugin isn't a bungeeplugin. I haven't access to ProxyServer class
I need to do it through the bungeechannel
Only possible if a player is online
Some one told me that method db.getCollection(name) should never give me NPE. Because the database will automatically create the collection
ok, if I have a player does it exists a ping message or I send whatever message I like and catch for errors?
i havent personally used mongo atlas so other than whats in those docs, im not sure
Oh allright
but I would try following the docs and see if that solves things
This sentence makes no sense for me...
what is the best way to lower my custom entity on the y axis? I wish it to behave as if it wasn't lowered. Currently, I do this with every tick packet, but I don't know if that's a good way.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Is your entity invisible and has a custom model item on its head?
yeah, head and arms
You have to use methods: DataOutputDtream#WriteUTF() for asking what you want and DataInputstream#ReadUTF() for reading the response
Change the y offset in the model then
in its json file
What I mean is: Does it exists a ping message that I can use (https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/#playercount)
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Its give the parameters that you have to send to bungee channel
I can't do it too much, I animate my entity so the head and hands move, the models are adapted in such a way that when rotating by hand or head, the model rotates perfectly in its central axis
Ugh...
Then mount the entity with a slime that has a negative size
Not sure if thats still possible
it is good idea, but in newer versions (which im using)
But that message returns the list of all servers without checking if they are online or offline
is it a very bad idea to do it in packets?
Then change your model. You can edit the pivot point somehow.
If they are offline then they are not in the list
i think
the page description says "Get a list of server name strings, as defined in BungeeCord's config.yml"
Well... then you need to write a custom message
Why dont you search as
On google: Spigotmc get server count
I always when search: Spigotmc + question I find really útil info
it would likely be easier if you did it with bungee api (for empee)
i would assume
What you can do is get the IP of the other servers und then create an InetAddress object and check it with .isReachable()
still need ?
thats a lie O.o did they rly change the max/min size of slimes to 1 and 127 ? so there is no negative size anymore ?
its a screenshot from the dev so i would assume he is telling the truth lol
Is it possible that the user has set some sort of firewall that deny my request? By the way I think I will just create a custom message bc I need the available slots of that server
You dont ping the Inet address of the player but of the server...
Ah i see. If he blocks that port then the bungeecord server wont be able to use that server all together...
https://timcloud.ddns.net/mapping/
made this for exactly this... wait util the page is loaded and you can search the classnames at the top - left ... its just a very big page O.o
Ok perfect. ty
huh so weird question
minecraft:setworldspawn doesn't set pitch and yaw
can those just not be set or is there a way I could force a value, and no I don't want to handle it myself before someone suggests that
Hi, from 1.18 i cannot change slot number of my server is the parameter of "maxPlayers" has change since 1.16 ?
try {
Method serverGetHandle = Bukkit.getServer().getClass().getDeclaredMethod("getHandle");
Object playerList = serverGetHandle.invoke(Bukkit.getServer());
Field maxPlayersField = playerList.getClass().getSuperclass().getDeclaredField("maxPlayers");
maxPlayersField.setAccessible(true);
maxPlayersField.set(playerList, value);
} catch (Exception e) {
e.printStackTrace();
return;
}```
Why do you want this though. If you want it to change in the server list just use the ping event
???
i wanna change the slot max number amount for real not for visuel in ping event
Bro the question is not why i wanna do this
Does it send an error
NoSuchFieldException: maxPlayers
I just wanna know if something change from 1.16 in fields name
why not just use getMaxPlayers()
because i wanna change it
not just get it
do you even understand the method i sent ?
Find the new field. It would be unmapped now
Deconpile and take a look
Thanks captain obvious
Then just do it?
if i'm asking here is to know if someone have this new field name
Ah you might have to wait then
declaration: package: org.bukkit.event.server, class: ServerListPingEvent
That's ping
Bro please...
Try just to thinks about what you send with the expose problem
start here
i'm trying to know what's the new field name (if there is one) of maxPlayers in 1.18
this code work for 1.16
What exception?
.
Go to google
hahahaha
Common is there someone competent here who can answer me (VERANO if i'm here is because i don't find the solution on spigot forum and google either)
Yeah I understand you
My answer is: download a decompiler. De compile the spigot 1.18
And check the class which contains the field you want
Or just use your IDE if NMS is imported
you don't need nms for doing this
Olivo I have done that without having the package nms from spigot
That's fine
They are calles reflections
you don't need a decompiler for spigot o.O you can use buildtools to obtain the source
I'm aware
well its the official way of obtaining spigot and related sources
not our problem if you choose to not use official sources
does not work the same if it isn't spigot
The problem is that I only api of 1.8.8
This
zelytra's issue is specific to new versions so maybe sit this one out
Yeah they are exsctly the same. I have looked and the source is from builds tools but have some extra event for player kb
So they Are the same
theres no optimization if they are exactly the same for one
for two, they are using much newer versions, so regardless you arent really able to help them
Can some one help me migrate a 1.17 plugin to 1.18?
depends what the plugin is lmao
declaration: package: org.bukkit.event.server, class: ServerListPingEvent
Shop plugin
frostalf thats irrelevant to what theyre doing
This is only visual
i sent them the same link lol
I dont use api greather than 1.8.8x
Sorry
specifically?
I found the answer : A new method as been implemetend Bukkit::setMaxPlayers
but he dont know how to migrate 😅
The older method doesn't work at all
ah, pog
Thanks for saying all bullshit 🙂
This doesn't exist in spigot keep that in mind
you could just modify the config of the server
then just reload server config o.O
Omg its disaster Last spigot. Its uses Java 17 and its a fuck because the network run base on 1.8x which requiere Java 1.8
that was the older method but the field name is not more recognize
why not just use the shopkeepers plugin?
I am not sure what you mean by this
declaration: package: org.bukkit, interface: Server, class: Spigot
...
Main reason of not using Last spigot versiones
?paste
ooh apparently shopkeepers isnt even 1.18 yet oof
yuh
can someone tell me why line 9 is throwing a CME, this is the last thing I want to do before bed but I am way too tired to see straight https://paste.md-5.net/veqokubake.cs
i would load shopkeepers and see if there are any issues with it running on 1.18
you can choose to not cooperate if you want, but do know support here is free and not something you are entitled to. You are asking for help and yet people are telling you ways you can do it, but you keep saying it is wrong. Not sure about you, but just maybe there is something to it if everyone else is telling you differently. But hey whatever I don't have to waste my time helping you either so have a nice day 🙂
Beta builds appear to be 1.18
^ did not see this, I would try this for sure
ty Olivo
Your welcome sir. Have a lovevly say
You answering to another question and offering any help in the discussion. I don't care if you don't answer me. Everytime i'm asking here a question i just wait for someone that occure to have the same problem as me. If you never encounter this jut don't answer. I say the solution the subject is close and i let the channel to another problem
Just stop that conversation
Yes
"I say the solution the subject is close and i let the channel to another problem" this is what i said
Ignore them, like they do when I ask stmh that they dont know
They just dont answer
Just because you refuse to use the API, does not mean it isn't the solution either
Bro, the solution was found go next.
Message hover events and click should work without bungee?
yes
I see your English is not your first language. Do note that the way you are translating makes you sound really rude just fyi
I love java I can be reading more than 20m to see that its was a simple error
it be like that lmao
Nono, i'm rude with you, you clearly understand it ! Have a nice day
lol, well guess you won't last long here then XD
I miss racist santa sometimes
Prob we cannot predict the furuture
That's why i'm here from more than a year 🙂
Everyone that has been rude here or just overall smug or ignorant, generally don't last more then a few days here 🙂
so yes I can predict that will happen
maybe NNY is still around
we just dont know it yet
lmao please don't summon them
don't know about ignorant, I've been on irc/discord for a fair few years and I am still around
and I can't even figure out this NPE
I haven't really known you to be ignorant o.O
this may be related to an extreme degree of sleep deprivation
talk to my hand
I got on spigot irc before I ever compiled my first line of code
if only I could go back in time and tell myself the true horrors of java
and also to invest in bitcoin
start investing in NFT's
please no
you either hop on board or you get left behind 😂
i keep getting this error
Could not resolve org.spigotmc:spigot:1.18.1-R0.1-SNAPSHOT.```
repositories {
mavenCentral()
maven {
name = "Paper"
url "https://papermc.io/repo/repository/maven-public/"
}
maven {
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
content {
includeGroup 'org.bukkit'
includeGroup 'org.spigotmc'
}
}
maven {
url "https://org.bstats/bstats-bukkit"
}
maven {
name = "IntellectualSites Releases"
url = uri("https://mvn.intellectualsites.com/content/repositories/releases/")
}
maven {
url "http://dpnw.site:8081/repository/maven-public/"
allowInsecureProtocol = true
}
}
dependencies {
implementation 'org.jetbrains:annotations:20.1.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
compileOnly("io.papermc.paper:paper-api:1.18.1-R0.1-SNAPSHOT")
compileOnly 'org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT'
compileOnly 'org.spigotmc:spigot:1.18.1-R0.1-SNAPSHOT'
compileOnly "org.bstats:bstats-bukkit:2.2.1"
compileOnly 'com.darksoldier1404.duc:DP-UniversalCore:1.18.1-SNAPSHOT'
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit:1.17-418")
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core:1.17-418")
}```
am i doing wrong?..
yeah if we could just go back in time and be born as X AE A-Xii
gethitblock event on xp bottle. returns block is null. How would I fix that
if I am not mistaken org.spigotmc:spigot:1.18.1-R0.1-SNAPSHOT. it is missing the jar at the end? maybe something to do with that?
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
?bt
there is some links and info for you
I think the lack of the mavenLocal() repo is the bigger issue, unless one of the other repos should distribute it
I think its a combination of both
what you are saying and what I posted for the boostrap
Might as well be
god Why is it so difficult XD
Though the bootstrap issue can be thrown out of the window as this is gradle, and BuildTools should put the spigot jar into maven local by default (unless it changed). But if Buildtools was not run you'd get the same effect
if they are depending on the spigot server jar or that is what they are wanting then bootstrap info is relevant, if instead they want the api, then their issue is what you said but also a mislabeled dependency as its missing API
might wanna reread the spigot gradle tut rq
Meh, it is more of a small beginner oversight
hmm wonder if the bot has a command for gradle
?gradle
nope, would have been cool though
Especially if you are accustomed to maven you may not realise (or forget) that mavenLocal is not the default
maven local is not even the default in maven 😂
it isn't?
no, you have to specifically tell maven to check local repo. Otherwise it starts checking everywhere else and may even fail without checking local repo
hm, interesting that it does it on my machine then. Eh, I don't use it all too often thankfully
well it depends how your pom is setup too
most of the time maven does pretty good about falling back to local repo, but in some cases I have had maven fail the build even though my local repo contains the dependency in question lol
.
How to disable randomized knockback
you use a plugin to do that or?
How do I make it so that when i Right Click and item it automatically deletes it and adds a speed 2 effect to the player
do you want to disable knockback at all or just apply always the same ?
No like, on 1.17 there's randomized kb
How do I make it "normal"
I am trying to get a JAR that contains the NMS code that has the mojang mappings, but I am unable to do so. When I use the JAR Spigot/Spigot-Server/target/spigot-1.18.1-R0.1-SNAPSHOT-remapped.jar I can find all the classes but they aren't remapped, and when I try Spigot/Spigot-Server/target/spigot-1.18.1-R0.1-SNAPSHOT-remapped-mojang.jar it cannot find any of the NMS classes. Can anybody help me out here?
It is more reliable to check your local maven repo
What IDE are you using?
IntelliJ
^
maven or gradle?
You want to use the maven special source plugin. Don't import the jar manually
it has nothing to do with specialsource
Gradle
When you import it, just click the gradle tab and click Refresh Dependencies
sometimes it bugs out a little, then you might need to invalidate cache and restart
It does. If they're looking for the jar rather than the maven dependency their jar won't be remapped and won't work. (Assuming NMS actually will be used)
If this is a thing, then use that instead. I never do, I just import the actual jar but yh I'm not a perfect civilian
I'm unhinged
It's fine if you want. The remapping just won't happen and the plugin will break
if the jar isn't remapped then what is the -remapped.jar for?
The jar is not the server
compileOnly("org.spigotmc:spigot:1.18.1-R0.1-SNAPSHOT:remapped-mojang") Using this in my gradle file also doesn't help, it still cannot find the classes:
You are talking about post-compilation
Yes
Yep exactly
I'm trying to prevent issues post compilation. What's point of solving that if it won't work post and needs to be redone
Sure you can get it to compile and not work
I can help you with that if you want
but he needs help for a different problem at hand right now lol
I'm solving multiple problems at once by doing things the right way but sure you do you
It's just called ArmorStand in remapped.
Oh, looks like I was using the spigot mappings previously
That's very likely, just change it to ArmorStand if you're wanting to use Mojang Maps now
I'd rather use the Spigot Mappings if possible, but when I use those the fields aren't remapped
Mojmaps > Spigot mappings
Yeah, if you're using NMS you should probably use Mojang Maps and then use SpecialSource to remap it when you compile.
Hello!
I've got a question about my listener for ExpBottleEvent: For some reason I can't use the getHitEntity(), getHitBlock() and getHitBlockFace() functions which it should inherit from the ProjectileHitEvent. If I read any of them, for example e.getHitEntity(), the value always equals null. Does anyone know why this happens?
Which is what Olivo was talking about I believe
^^
exp bottles might just be weird in that it doesn't set what was hit
But, I'm not sure why they'd be different 
They should work though
Make sure you're running the latest version of spigot
If it doesn't work report it as a bug
?jira
I am!
How to remove knockback resistance from netherite armor?
meta.addAttributeModifier(Attribute.GENERIC_KNOCKBACK_RESISTANCE, new AttributeModifier("generic.knockbackResistance", 0.0D, AttributeModifier.Operation.ADD_NUMBER));
Is that right?
attributes
I'll try to do so but I'm not 100% sure if it doesn't work because I programmed it wrong or it's an actual bug
I don't want to look like an idiot :p
?paste your event method
And I assume it's printing all the "no" messages
I removed some junk methods, which I used to try and recreate getHitEntity() and getHitBlock() myself
yes
Yeah I would report it then
lmao my crash log was so long it broke discord
now i cant send anything in help server
soo im sending it here
Anyone know why everytime i join my server it crashes? Heres a bit of the error cant upload the entire thing cause its so long it crashes my discord [17:02:07 ERROR]: app//net.minecraft.world.entity.Mob.tick(Mob.java:393) [17:02:07 ERROR]: app//net.minecraft.server.level.ServerLevel.tickNonPassenger(ServerLevel.java:1120) [17:02:07 ERROR]: app//net.minecraft.server.level.WorldServer$$Lambda$7954/0x000000080272da38.accept(Unknown Source) [17:02:07 ERROR]: app//net.minecraft.world.level.Level.guardEntityTick(Level.java:977) [17:02:07 ERROR]: app//net.minecraft.server.level.ServerLevel.lambda$tick$7(ServerLevel.java:775) [17:02:07 ERROR]: app//net.minecraft.server.level.WorldServer$$Lambda$7953/0x000000080272d800.accept(Unknown Source) [17:02:07 ERROR]: app//net.minecraft.world.level.entity.EntityTickList.forEach(EntityTickList.java:43) [17:02:07 ERROR]: app//net.minecraft.server.level.ServerLevel.tick(ServerLevel.java:756) [17:02:07 ERROR]: app//net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1627) [17:02:07 ERROR]: app//net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:490) [17:02:07 ERROR]: app//net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1483) [17:02:07 ERROR]: app//net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1282) [17:02:07 ERROR]: app//net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) [17:02:07 ERROR]: app//net.minecraft.server.MinecraftServer$$Lambda$3654/0x00000008013cb560.run(Unknown Source) [17:02:07 ERROR]: java.base@17.0.1/java.lang.Thread.run(Thread.java:833) [17:02:07 ERROR]: ------------------------------ [17:02:07 ERROR]: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH --- [17:02:07 ERROR]: ------------------------------ [17:02:12 ERROR]: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH - git-Paper-
I will! Thank you!
You're using Paper so you should go to their Discord
One last question, is this a good way to print debug data? Using a foreach loop on all players of the server; is there a better way to do this?
oh yeah
Show entire pom in a paste
I just took a look at the ExpBottleEvent class
ExpBottleEvent has no data on hitentity or block
only the bottle itself and xp rewarded
although it extends from ProjectileHitEvent, it uses super(Projectile) constructor
Okay, what does it mean that it uses the super(Projectile) contstructor?
Also, does this mean I should still report it? (I'm working on a ticket currently)
If you extend a class, you are likely to call your superclass's constructor, which in this case ExpBottleEvent did, but only calling the constructor ProjectileHitEvent(Projectile) and has, have no information about hit target
it is not a bug, but i would prefer to have that implemented
What do you mean it has no information about hit target
you can look at ExpBottleEvent class's constructor
Okay, one last question; could you check for me if splash potions do have data on hitentity, hitblock, etc? And if a splash potion doesn't check if a snowball does?
That would help me out tons!
what event is that lol
Both of those can probably produce the effect that I'm looking to make too
Lol, let me check!
I wonder if you just use ProjectileHitEvent instead of ExpBottleEvent
Yep, just 1 extra step checking the projectile type
Although if that works, then ExpBottleEvent not having it is def a bug lol
ProjectileHitEvent is fired pre-hit, while ExpBottleEvent is post-hit
I've been trying to find an event that is being triggered when an entity updates, but no success.
Is there even an event for that ?
Lingering splash potion: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/LingeringPotionSplashEvent.html
Regular splash potion: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/PotionSplashEvent.html
(these both seem similar in that they are direct subclasses of ProjectileHitEvent)
Snowball: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Snowball.html
(I think a flying snowball makes direct use of ProjectileHitEvent)
They're both fired pre-hit
ExpBottleEvent is cancellable because ProjectileHitEvent is.
there is no effect on cancelling ExpBottleEvent
I'm currently converting my code from the Spigot Mappings to the Mojang Mappings, and am having trouble to find the replacements for these classes: PacketPlayOutEntityEquipment, EnumItemSlot, PacketPlayOutEntityDestroy and the following fields: EntityLiving.isInvisible. Do any of you know the Mojang Mappings equivalents of these?
This is correct, I need to cancel the effect through the method it inherited from ProjectileHitEvent. This does however seem to work
So if I listen for ProjectileHitEvent and check if the entity is an exp bottle then I can get the hitEntity() and hitBlock() location?
yes
Yeah probably
Okay, thank you guys so much! I'm going to try this out! 😄

Lemme check, but also you should learn to find these yourself. I'll explain that as well.
Ah that would be great
what is the problem exactly
How can I get all values from HashMap but in order according by the time the key or a new value added, idk how to explain it properly.
The ExpBottleEvent still has it's use, it can be used to set the exp of the bottle and mute the effect once it lands. Or can this also be done through ProjectileHitEvent?
Can I find the player that caused someone elses totem to pop?
isn't hashtable implying the lack of order?
what do you mean?
yes and no
the purpose of a hashtable is to provide O(1) query, insert and remove
so there is no order in a hashtable
ClientboundSetEquipmentPacket, EquipmentSlot, ClientboundRemoveEntitiesPacket, Entity#bU() (I think?)
If you want it to be in order, you may want to use a tree, like TreeMap, which guarantees O(log n) time query, insert and delete
with time added as key
Thanks! And how would I find these myself?
tried refreshing/restarting ide?
???
i'm just gonna use List i guess
oh wait yes, sorry, i'm dumb yea
Also to find them, you need the spigot maps and mojang maps files,
Spigot Maps are in: /.m2/repository/org/spigotmc/minecraft-server/{minecraftVersion}/minecraft-server-{minecraftVersion}-maps-spigot.csrg
Mojang Maps are: /.m2/repository/org/spigotmc/minecraft-server/{minecraftVersion}/minecraft-server-{minecraftVersion}-maps-mojang.txt
Basically all you do is open them both, and search whatever you're looking for, and then find the mapped value in the other file.
So for example, I searched for PacketPlayOutEntityEquipment in the spigot file, saw that it was called tx, and then searched tx in the Mojang file.
Thank you! I'm going to quickly save that
^ You have to run BuildTools for those to be there
I have done so
Then yeah, should be there
What kind of updates
Do i have to worry about the licenses about every license that is downloaded, even if it isn't contained in my uber-jar? Because it is included in the spigot-api
If it's included in spigot, you can use it without worrying about the licensing
download license?
For example, when you drop a block.
oh man... still not reading API huh ?
I've got another question which continues with my last question; with ExpBottleEvent I could check for e.getEntity().getItem().getItemMeta().getCustomModelData(), with ProjectileHitEvent I want to try and see if my experience bottle has customModelData, how do I go about doing this? for ProjectileHitEvent getEntity() returns a projectile whereas for ExpBottleEvent getEntity() returns an item. In other words, how do I check if the experience bottle is a "special" experience bottle which should produce a different effect that normal experience bottles?
Instead use the Entity PDC
Check and cast to ThrownExpBottle
oops
ok thanks
if you do this, you will need to listen to throwing events too
sorry replied to wrong message
Oh lol
i meant this message
yep
Thank you, my brain is having errors
You realize it's nearly impossible to help when you just say help right
?help
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
ah shit
spam
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
aha
Well
Show your pom
that looks exactly like my itembuilder class hmm
Bro I've been researching for so long.
I can't find anything.
You're trying to find an event for when a Player drops an item?
bruh
ok question, so I have an update checker to use GET on spigotmc's api, to check if the plugin has updates basically. Problem being api takes too long to update, is there a way to prevent user receive the update message if they use before the api gets updated?
EntityDropItemEvent
Is there a totem pop event?
Do you not read what we sent you smh
What I have in mind is having a time tagged to every version to check after a certain time frame
Tobys
I'm trying to make ItemStacker (x33 Gold Ingot)
Wait
you could try if it gets called when you drop the item by api, if not you can call an dropevent yourself and listen for it
Where'd he go 
anyone else seein this pic in like 144p
EntityResurrectEvent
thank you!
when in doubt, PlayerStatisticIncrementEvent
the only error is cannot find symbol 🌝
1.8 I'm out
LOL
i'm out too
the artifact is still there tho
Yeah the images are fine for me
i can zoom in 😎
Did you restart your IDE Toby's
wait isnt yes or no 🌝
why does the plugin.yml have spigot logo
Minecraft Dev plugin
spigot plugin thing i guess
damn
why even using it
i see nothing
there's nothing to see lmao
anyone with tricks and tips on this?
wha-
lol
Yeah I'm not sure what you're asking
Basically, spigotmc's api takes too long to update, while I want to ensure users to not receive update messages when using my plugin before the api updates
Don't send the message until the API says there's an update
when using my plugin before the api updates heh
ah before it checks?
wait no that doesnt make sense
Ok, to see if a plugin has updates on enable, you send a GET request right?
but the returned body isn't always updated
how is time measured in the PotionEffect? ticks?
Yes
ok
How would you know if there is an update in a periodic check?
but its ok, I just thought of the solution lol
I've never worked with the updater api so I'm not sure what it returns
Basically this link https://api.spigotmc.org/legacy/update.php?resource=95422 returns 1.9.2 now
but I have in fact posted a 1.9.3 update
but what I was doing is just checking String#equals(), which made the plugin think there is an update
where I could dissect string into major/minor version
and perform comparisons
I suppose but why would that fix it
So plugin will not send the message as long as it uses a version later or equal to what the GET request returns
yea
Ahhh I understand now
as a programmer, language isn't my strongest suit

I've tried using this, but it gets called even if the player is not resurrected
Called when an entity dies and may have the opportunity to be resurrected. Will be called in a cancelled state if the entity does not have a totem equipped.
Are there no events that get called when a player is resurrected by a totem
Or should I just check if the player has a totem in their offhand? But even that might not work due to the totem being removed from the offhand on resurection
It tells you that it will be in a cancelled state if they aren’t resurrected
So check if it’s canceled
Verify your account and post the image in the chat
Is there a way to get around the time gap between sending the Block Change for a Sign and the Opening of the sign editor with a packet?. I currently have the menu item in my hand for a second
thats because of your ping to the server
still lagg and ping problem
check spigot's api
oh he needs help with localizednamed ^^ thought he want to color it white again and not red
depends on what you want to do there ^^
put 1.18 in your pom.xml
even 1.8's api doesn't have that method
Am working on my A* implementation and i am getting stuff like this... The nodes that get evaluated are done based on their order in a PriorityQueue, comparator:
@Override
public int compareTo(Node otherNode) {
return (int) Math.signum(this.target.distanceSquared(this.location) - this.target.distanceSquared(otherNode.getLocation()));
}
any ideas on how to make this a bit more optimal? I would have thought it would be more direct
i thought the priority key is the distance from source plus distance to target
what is the best database to safe data for my server
relational, lightweight and serverless, SQLite
I prefer my DataOutputStreams
Getting this error on the following line: val worldServer = (location.world as CraftWorld).handle on the 'handle' part. I've made sure I don't have any duplicate JARs and don't have multiple imported, but that hasn't fixed anything.
(redis)Jedis go brrr
Is it possible to edit the message in the sign editor above the sign (the one that says "Edit Sign Message" by default
okay
public double priorityKey() {
return this.target.distanceSquared(this.location) + this.start.distanceSquared(this.location);
}
@Override
public int compareTo(Node otherNode) {
return (int) Math.signum(this.priorityKey() - otherNode.priorityKey());
}
like that?
it is weird to think that a higher priority key actually means lower priority in the queue but sure haha
have actually never tried that on 3D
I wonder if sum of distance squared or sum of distance makes significant difference
should only concern performance, not functionality
but surely they do not imply each other
oh apparently A* has had different implementations, Bertram Raphael is the guy who suggested adding of distances from source and to target
Hey everyone 😄 I'm trying to save/load hashmap data from/to a data.yml file, I saw plugin.saveDefaultConfig() however that's only for config.yml, what if I want to store data in a separate file?
Also, would a yml file be the best way to do it? I have a map of String (mc uuids) => Int (citizen id)
why tf does intellij that this is always true?
if(!Arrays.stream(Enchantment.values()).anyMatch(ench -> {
return ench.getKey().getNamespace().equals(new NamespacedKey(this,"test"));
})) {
Enchantment.registerEnchantment(Enchantments.GLOW);
}
oh I am stupid
I am comparing a String with a NamespacedKey
lol
yes, already did
I tend to create way too complicated streams until they work, then let intellij simplify them lol
I actually started with .filter() lol
from the wise words of maow
streams are the best things ever
I use them everytime I can
because of their lazy evaluation they are also pretty fast
I tend to not write ANY for loops anymore, everything's just streams lol
https://paste.md-5.net/dezonabati.cs
?!
i stopped used streams
new ArrayList<>(oldList.size());
for(Item i : oldList)...
anyone know a good way to make plugins without coding appart from skript or visual bukkit
visual bukkit?
rlly
There's no good way to send a message without typing 😅
cant say i wholeheartedly agree on ur practical decisions here
streams are great to convert stuff
e.g.
List<String> materialNames = Arrays.stream(Material.values())
.map(Enum::name)
.collect(Collectors.toList());
do you know a good tutorial to learn to code plugins
learn java lol
all those alternatives are just stupid and way more work
{TheSourceCode} on yt -- for specifically spigot dev***
is pretty good
he has a whole playlist
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
I would not recommend anything on YouTube
i see trans flag i send friedn request
thx
Horrible advice
There's a lot of people who dont understand what they do
Some YT vids are really helpful tho
TheSourceCode is very good, I gotta agree with @crimson verge there
unless the tutorials have actually gotten better from when i last used them, yt is not the place to learn code
showing bad practices and such
youtube is a place where you learn some abstract concepts and listen to people complaining about oop
I learned fluent Solidity/NodeJS there
it's always funny when someone sends their source code and it contains this
public void onDisable() {
// Plugin shutdown logic
}
lol
if you need something simple and want it done fast yt is pretty good, lets put it that way lmao
xd
lmaooo
💀
jetbrains academy is great
show build line 15
sir may I ask for a strategic advantage for using a stream's forEach instead of the default collection's forEach
you didn'T register the command "build" in your plugin.yml
i will never forgive bukkit for its horrid way of registering and managing commands
Arrays are no collections
Ewsy solution moge to sponge
oh fk, enum's values() returns arrays
🙂
want to iterate over array? WRITE IT
for(E element : array)
^
show us your InventoryCommands() method
Make sure you are using spaces and not tabs.
my point was u need to register in plugin.yml AND then register in code, instead of just registering it in code
that loop wouldn't be sorted alphabetically
if they would use tabs, the plugin wouldn't have enabled
okay thats definitely not right haha
what ide are you using? eclipse and intellij accept tab in yml properly
that's intellij
and intellij converts tabs to spaces in yml files
show your full plugin.yml please
Any suggestions?
true
hello guys, how can I add a custom block in my game (its just a normal block with a lucky block texture)
it will literally print "/<command>"
resouecepack
you can only create new blocks with client mods. ALl you can do is abuse some existing block like mushroom blocks or noteblock and give those a custom texture with a resource pack
So I make the server send a resourcepack to the client
saveResource()
Yea that is what I was targetting
i saw people using barriers tho i dunno why using them
Thanks I'll look into it
you can look at oraxen's source code but it's quite complicated
Yea using barriers is dumb
Whats Oraxon?
I'm guilty, but I stopped maintaining that plugin
a plugin for custom blocks and furniture
its open source
I see
is there even an adventage?
cant break em maybe
which plugin?
im embarrassed to share that lmao
whachu gonna do when u use them in a build?
it was my first ever plugin
xd
?
English please
i dont speak that lang soz
ah yes we can read that
xd
you see, barrier blocks makes you not have to worry about handling of noteblocks state or sorts
you should rly try to explain what your problem is ... you wrote again just "please help"
line a new line?
in which way are they identified uniquely?
List<String> lore = ...
itemMeta.setLore(lore);
ItemMeta#setLore()
either add them as separate lines to your arraylist of lore or you can use \n as an "enter"
i think they mean have them each on a new line
Arrays.aslist 💙
the custom block isn't the barrier block, but the custom item on an invisible armor stand inside that barrier block
idk, all they said was "please help" and "how to create new lore" lol
oh i understand that's why
toby
the easiest way
would be to add \n in your string
wherever you want an enter
nooo
Player#setDisplayName?
its messy looking code but works haha
wdym by name tag exactly?
this will not work O.o or does it ?
it does lol
thats not possible without packets or teams
You need to pass a List of Strings into the setLore method, not just a string.
like "blahblah\nblahblah"
or armor stands
but yes better practice is to make a list of strings for setLore
oh nvm
why haven't you looked it up?
most servers use PAPI so
would recommend trying that if ya need an API for packets
Also, you are trying to set the lore on a string when you already inside the setLore method.
wouldnt really recommend it but up to you haha
this is the only thread i found
https://www.spigotmc.org/threads/change-name-above-head-spigot-1-8.66314/#post-731468
why doesnt the following code execute?
gui.addElement('a', MiningItemManager.TITANIUM_SWORD, click -> {
if (p.getInventory().contains(MiningItemManager.TITANIUM, 2) && p.getInventory().contains(new ItemStack(STICK))) {
for (int i = 0; i <= 2; i++) {
p.getInventory().removeItem(MiningItemManager.TITANIUM);
}
p.getInventory().removeItem(new ItemStack(STICK));
p.sendMessage(CommonStrings.PREFIX_GOOD + "Dabūji Titanium zobenu!!");
p.getInventory().addItem(MiningItemManager.TITANIUM_SWORD);
} else {
p.sendMessage(CommonStrings.PREFIX_BAD + "Tev nepietiek materiālu!");
}
return true;
});```
`return true` isnt important atm
not well explained but none of those threads do
i use InventoryGui as the inventory thing
it always throws me to the bad part. even tho i have fulfilled the code's request
i think we need more code
is there a specific error?
tried containsAtLeast btw. doesnt work
nope
such as?
well na but what isnt working? it doesnt remove the items?
it goes to this part:
p.sendMessage(CommonStrings.PREFIX_BAD + "Tev nepietiek materiālu!");
even tho i have fulfilled the plugin's needs
which of the conditionals is not fulfilled?
how do i get an items name through nbt
no idea, but i have both items in inv
i will check
ItemMeta#getDisplayName()
idk if this will trigger
p.getInventory().contains(new ItemStack(STICK))
thats probably a variable
narrowing the scope can, most of the time, give you the direct explanation of failure
damn... spigot should have a method to get a materials composting chance...
I would just make a static ItemStack for your titanium sword and reference that anywhere you need it
would probably work smoother(coding wise)
yeah thats not going to work if you dont give them at least a material
capitalization should only apply for static constants
nvm
lol
xd
im tired
i find item names more satisfiying if they are capitalized
take a nap bro
CONTEXT
show us what the lore looks like, explain what the issue is, etc.
programmers don't sleep
that made it not work 
i do and the next day i'm still sleepy
sometimes i wondering why i would even sleep 🥵
is there anyway to wait before doing a function without making the server go into sleep mode
did you make sure higher priorityKey > lower priority
sleeping at school 😎
asynchronous
the blank lines not showing up?
yes, for some reason it just circles around the correct area
use Arrays.asList("", "", "") instead
odd, must not work in that lang or something
use this toby
#setLore(Arrays.asList(shit here))
lmao, how about the path in between
yes
all that goes within the parenthesis of your setLore() thing that you already have
i knew it wont work 😄
it will use a new line for each
it worked on something i did not long ago xD
Hey, does anyone know how i can rotate a log block via script? (I'm using the 1.8 version)
minecraft not liking String.format either :(
do you use paper api ?
?showerror
not sure which i used on that project tbh lmao
Does anyone know?
setDisplayname("§2Builder +. Build").setLore(Arrays.asList("Svet pre určeny pre väčšie stavby", "Príjemný čas strávený stavaním!", "Stlač pre pre nastavenie creativu")).setLocalizedName("pro").build());
does it even support in-world operations? 👀
it kinda goes halfway and then just stops
idk crap about skript lol
i mean placing a rotated block. Now when its placing a log, the log looks up
yes
i understand but that isnt an answer to my question 👀
1.8 cringe!
did you try sum of distance instead of sum of squares
hover over the error
one sec
you can estimate diagonals to be 3/2 tbh, if that affects your efficiency
we arent doing everything for you
🥣
nom nom cereals
you litterly use an ItemBuilder and dont know anything about it right ?
are you using your setLore method which accepts a string?
🤦♀️
hehe it looks like my itembuilder
you should take a look at the resource where you copy/paste it
and adapt the code
and understand* the code ... or better: learn java or how to understand an api
changing it needs you to understand what youre doing
dont use an item builder if you dont know how it works
stack trace
i still think its not working in the default spigot api
im too lazy to build an entire plugin just to test xd
i just see the code where setLore is declared ^^
spigot doesnt like the \n character
i must be thinking of something else then xd
only DecimalFormat worked for me
i believe ya lmao