#help-development
1 messages · Page 1271 of 1
Yes, but have had it for years
##############################
## Java
##############################
.mtj.tmp/
*.class
*.war
*.ear
*.nar
hs_err_pid*
*.jar
##############################
## Maven
##############################
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
##############################
## Gradle
##############################
bin/
build/
.gradle
.gradletasknamecache
gradle-app.setting
!gradle-wrapper.jar
##############################
## IntelliJ
##############################
out/
.idea/
.idea_modules/
*.iml
*.ipr
*.iws
##############################
## Eclipse
##############################
.settings/
bin/
tmp/
.metadata
.classpath
.project
*.tmp
*.bak
*.swp
*~.nib
local.properties
.loadpath
##############################
## NetBeans
##############################
nbproject/private/
build/
nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml
##############################
## OS X
##############################
.DS_Store
*.icloud
That's my global ignore, to clarify
Could try to temporarily move that
I'll try now, just in case
tho nonthing in there looks too troublesome
but yea, iirc spigots build tool thingy does a git reset on the files there
spigotclip when @blazing ocean or whatever that thing was called
nice o.O
Damn
That was indeed it
Thank you good sir, I'd not have thought to go there
Much, much appreciated

Can we kill this discord then?
I kinda like it tbh
Useful for small stuff
That ur only testing / never gonna use again on a brand new pc without all ur logins to places.
hey what would be the best way to update proxy without putting down the whole network?
i was thinking proxy on proxy but most the time it is unsupported so how should i handle it
there isnt really a way to do that, they have to be connected somewhere so best bet is pretty much pick the quietest time of night and have a 5 min downtime or smth
Well yeah obv I'm not refering to the main connection, for example can I not just connect them to something like HAproxy which sends them to proxy1 and if that gets disconnected HAproxy redirects them? Or something similar
transfer packet
1.8 :3
So you know the TextComponent click action suggest to put text in the player's chat bar? Can that be done from a GUI rather than clickable text? Thanks!
No
Sad. ok
i mean u can do it w a book
Yeah that's basically all you got. Can't do it from an ItemStack or anything like that. Has to be text you can click with your mouse
I am so annoyed by api prices of claude sonnet 3.7, it's good enough to do a lot of interesting things but about 10-100x to expensive to actually pursue them
claude's prices in general suck though
Their "pro" subscription already sucks, when it only gives you double prompts as free.
Even if you try with openrouter, just using their API, the amount of credits used fucking sucks
that's why I didn't even bother trying AI code editors like windsurf or cursor
I'd rather not know whether it can be useful to me or not, I can hold off till it gets to a far more reasonable price
java.util.ConcurrentModificationException: null on Bukkit.getOnlinePlayers (many concurrent tasks call the method)
the issue occurs when there is about 100 players on server and they quit join pretty often
The javadocs literally say it's not thread safe (like almost every method)
then Collections#unmodifiableCollection would fix the issue?
No because that just wraps it in a version that doesn't allow modification
but i create a copy of the collection that will be independant later
If you do that sync, sure
Cannot access built-in declaration 'kotlin.Unit'. Ensure that you have a dependency on the Kotlin standard library
does someone know why this is happening
when im trying to build the project
is it a compiler error or IDE error
Hey, very newbie question but should Spigot and Bukkit package versions match?
wdym
Sorry my bad, I was using some old maven template to initialize the project, for some reason it was adding both bukkit and spigot. Looks like you only need spigot.
Yea
how old was this template 🫠
huh? isn't it a copy-on-write list?
I believe so as well. As far as I remember, the one for worlds was just a regular arraylist
this is really starting to get annoying
I think it may need itemsadder support
modifyUser(user ->
user.setPrimaryGroup(rank.getGroupName())
);
private void modifyUser(Consumer<User> consumer) {
getUserManager().modifyUser(uuid, consumer);
}
why isn't this changing the player's rank? luckperms api btw
what result do u get when invoking setPrimaryGroup?
whats the rank.getGroupName()?
iirc it has to be a valid group node that the user has already
group node by group id, not display name or some other name
oh
i want to give the player that rank
he doesn't already have it
user.data().add(inheritance node here)
i think?
and then u can ofc apply that node to be the primary group after ^^
by default the primary group is calculated based on the parents' weight
so the setPrimaryGroup method is a noop basically
oo
did something about display entities change in 1.21.5?
oh
what
view range defaults to 1
width and height default to 0
@echo basalt yo
did you fix your stuff to work for 1.21.5 displays
Is it possible to make a plugin that can host a web panel and allow two-way communication between the plugin and the panel? For example, the web panel sends data to the plugin (like commands), and the plugin can process it, respond, and also send data back to the panel in real time. Can both sides actively communicate and work together like that?
Was thinking about making a plugin that lets you execute commands and modify files through a web interface
Sure you can run a spark sever with endpoints
I was told, it is really "vulnerable" and the only way will be to require three active ports which will make the plugin inaccessible to a lot of people
<dependency>
<groupId>com.sparkjava</groupId>
<artifactId>spark-core</artifactId>
<version>3.5.5</version>
</dependency>
a webpanel and minecraft server on the same port?
Yes
not sure about the version though
i'm not sure what people mean by vulnerable though
wait a sec
oh yea one thing
will docker containers mess it up?
like most people use pterodactyl sooo
i want to make the plugin public, so it has to support people's needs yk
No
it won't mess it up?
Yes
wait my guy is saying using endpoints will be vulnerable, lemme get his reasoning
"i mean, for endpoints, can't anybody access that? since the server can as well (by simpler means, since the server sends data to the web server, why can't anybody else do the same?)"
tf
just keep them localhost
actually hm, maybe that would mean open just one more port
just reserved for that not accessible to public
isn't pterodactyl run on dockers
"docker and the host can't interact with each other
by just using-"localhost"
the port is opened on the host"
@paper viper dont leave me out here man
In that case, create an endpoint but enforce security policies
like IP address filter, credentials
I mean just don't make your endpoint vulnerable in the first place really
he replied with the triple question mark
"did you tell them it's a public plugin?
also verification is literally not possible
since there is no api
except you want to embed the password on the web server, sure"
How about that person join this discord server
told him
doesn't wanna join
thinks joining spigotmc will just result in an pointless argument
i mean im not going to talk to someone thats just in quotations
i have other things to do
i dont want to take things to dms, sorry
the best way to storage player data? like health or custom for example idk money, mana?
but i mean what i said is basically essential to like any endpoint out there
just add authentication like api keys, enforce security policies like filters
config file
and caching
i guess
so like adding uuid to idk storage.yaml file when player first join ye?
and then some data
yes
ty <3
np ❤️
[20:28:56 INFO]: ServerSeekerV2 (/45.135.194.65:57894) lost connection: Disconnected
server scanner bots
GET OUT OF MY SWAMP serverSeekerv2
yea
I had one player join before
and was asking if he can play and was asking about the server
how to distinguish blocks that were generated in the world, from the ones that player placed, or idk enderman or when lava and water make cobblestone
is there a way or do i have to mark them in the events like BlockPlace etc
you cannot. unless you keep track of all the blocks using persistent data containers prolly
i could add pdc to blocks placed by human, placed by enderman, generated by water and lava, i dont know if thats the same event, and if there are more cases, ill check
wel.. start with the placeBlockEvent and keep adding based on your needs
guys can someone know why if i disconnect and reconnect on my server, all scoreboards disappear and GUI don't working ! I use NMS for my TabList scoreboard and bukkit scoreboard for my sideboard but idk why this glitch continue to destroy my life...
I use oauth to authenticate users on my endpoints
Minecraft doesn't provide user oauth but discord and patreon and twitch do
a score board is something you need to resent to the player everytime there are updates
when a player disconnects, they remove all server related states/data
so on join, you need to resend it
I'd make a Scoreboard Manager that keeps track of "the" scoreboard and just send out copies to all players that join/need it
already did
i send the scoreboard to the player every time he join
then there should be something else you are doing wrong
any errors?
no errors x)
then debugging time
already did and nothing haha everything work lmao
check if the code sending to the player actually triggers
yeah all is good
yeah but no displayed
send the relevant code
okay
paste your code and send the link after you click "create"
sure
in line 112 you update the score board
yeah ?
imnot sure if you're using any special library
sorry for the delay btw
but I don even find any "setSlot"
im only using Maven and Java 11 and bukkit of course
np np x)
yeah x)
Score scoreObj = objective.getScore(text);
this put the text and this
scoreObj.setScore(score);
put the line
Im experience a weird issue with player profiles, when I set a new PlayerProfile to a player with a new name it wont allow the player to be referenced via commands til they respawn in some way, someone told me that this is due to the cache not updating when you do the player.setPlayerProfile(); but im not sure if im comfortable reloading the player via a death unless its my only option, could I just update the cache myself somehow?
Not many regularly play with their display entities
Wiki records no changes
Possible regression?
they logged changes in their update log
but I can't get them to uh
display
I think
hard to tell
^^
I believe you need to send a new packet to tell the client this player changed or a new player is present
let me check
hmmm
I'm not sure if theres another packet besides faking death
maybe the problem is with my packet or smth
Thank you :D
can you show some code?
here is the method I have that is meant to give players a new profile
public void setPlayerName(Player player, String newName) {
PlayerProfile oldProfile = player.getPlayerProfile();
PlayerProfile profile = Bukkit.createProfileExact(oldProfile.getId(), newName);
profile.setTextures(oldProfile.getTextures());
profile.setProperties(oldProfile.getProperties());
player.setPlayerProfile(profile);
player.setDisplayName(newName);
player.setCustomName(newName);
}
where are you creating your gamePlayers?
ok yeah nvm seems like something about 1.21.5 broke packets
when the player join the game if gamePlayer with uuid player dont exist, it will be create, else nothing happened to gamePlayer and players list cause gamePlayer is already in list
yeah but if the player is already a game player
?? i dont understand
i will try
scoreboard isnt here so debug didnt work x)
Anyone help please I dont know what this type of plugin is called, I want to one hit kill mobs that are stacked so that you can kill stacked mobs way faster because there is a delay before you can hit a mob again and you cant instantly kill them, I want it to be instant kill one mob and no delay before next hit
please @ me
yeah but why it didnt here
i literally create it when player connect same as plugin launch and didnt work when player join ?? just why ? x)
if your score boar ddoesnt even get created when a player joins then log how far the creation logic takes you
put debugs all over
it will but a debug plugin lmaoo
im so confused i cant even use my brain
i just put debug every line im tired of this plugin
its okay just take a break
yeah i will
its like almost midnight for you prolly
ty for your help i will send you news later
np
Anyone help please I dont know what this type of plugin is called, I want to one hit kill mobs that are stacked so that you can kill stacked mobs way faster because there is a delay before you can hit a mob again and you cant instantly kill them, I want it to be instant kill one mob and no delay before next hit
please @ me
are you a plugin developer coding a plugin?
Hello?
No i want to make a server but im just testing plugins rn
sorry if im being bothersum just no idea what to do here
then go to #help-server
or #general
oh yea mb
get player.getPlayerProfile() isnt part of Player class
lmoa
its working fine for me
how is it even building?
declaration: package: org.bukkit.entity, interface: Player
yes im sure, im running in 1.21.1 i think
I do not see it
what?
you mean
OfflinePlayer
declaration: package: org.bukkit, interface: OfflinePlayer
@rough ibex
i dont think so
ahh
oh wait sorry yeah, im using paper, im just asking questions here because i already asked ppl over on the paper server and i couldnt get much help there so i was hoping i would get some here
rename players, i dont want to deal with possible async issues with getting an entity to ride a player with a changed nametag, or use protocollib, i tried doing that for almost a week and had no luck
well you certainly can't set Player Profiles
and I don't think there's a way without keeping track of it yourself
buit it shouldnt be that hard
well ive achived it, it works fine other than i cant refrance players in commands without getting them to respawn first
also like i said im using paper ^^
do you not think i could update the cache? i mean the only issue is that i cant reference players in commands without getting them to respawn first
so if a player is named random_name then i do /kill random_name, it wont work
but if i kill them first, or just use there original name before they reload it also works
hm. should'nt be there a way to detect when a player respawns?
well of course, but the issue isnt with respawns itself
its with how only after a respawn it will update the servers cache
not when i do .setPlayerProfile()
No damn wonder it's not in spigot javadocs.
I know 😭
but like i said
i already asked ppl on paper, I was hoping someone here could help despite that
TL;DR im desperate
sorry youre dealing with a paper-specific method
Anyone know why I dont have Attribute.GENERIC_MAX_HEALTH in 1.21.4? Was it removed
Just renamed to match vanilla
Read the docs? https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/Attribute.html#MAX_HEALTH
declaration: package: org.bukkit.attribute, interface: Attribute
but that laaaame
1.21.5 broke my beautiful displays
kinda got it back kinda not
it's not behaving like before
that ain't right
and it's only on 1.21.5
1.20 for reference
wtf mojang
what did they even do
I don't get it
Mojank
are you using an external api for that?
hm just nms and spigot
is there any documentation on how to learn that?
I am thinking of bunch of armor stand but that just would kill the server ig
Just use modelengine
doesnt that shit cost like 40 dabloons
I got a problem, one of my staff ran the purge code /asadmin purge [TimeInDays] and delted liek 1000 islands before we stoped him, is there anyway to undo that without rolling back the server
backups 🙏
You should always have a protection plugin and backups
Like coreprotect
since it was like
last night
Can i bring back islands without effecting peoples work
"should" 😦
Do you have a back up of it?
We probably have backups of the server but we dont want to set peoples work back
Then no
are you sureee 🥺
Also tf is /asadmin purge
is there anyway to see what islands are purged
Why would that be a command and why would you give it to admins
Uh
Idk what islands you are talking about
He pulled up the wiki
So, why does he have permission?
If you are talking about a plugin go contact the developer and ask him
it was someone elses accont that got hacked
how and where
:D
😄
- Always have backups daily
- Have coreprotect imo its the best one
- Secure your account..???????
- Don't give op
If you want to revert the stuff there is 2 things,
you can either make players lose a bit of progress but give them something in return, like coins, gems or whatever
or you can lose 1000 islands and continue LMAO
ask the developer first
click the ask questions get support on the plugin page
how tf you get there
im slow af
I might be blind
found it
thanks
idk how to oask a quesion -.-
holy sdhit im so incompitent
Found it
🤩
i so prid
proud
I just want to learn how that works
If magma guy is ok to share an example for me
One google search away
https://www.youtube.com/watch?v=nLLiObmQLgM&pp=0gcJCdgAo7VqN5tD
Without model engine
Magma uses his own library
It’s open source
Ask on FAWE disc
okay so I just finally made fawe work without any apparent bugs or errors.. it actually sped up my game terrain generation by like.. 7x or so.
But this comes at compatibility costs:
My plugin has to support paper only.
Fawe has to be used and not world edit. (otherwise, massive server lags happen)
I don't have a code issue, like I said no errors and it actually works good (so far)
but now I feel like I blocked many people who run spigot/world edit on their server
my question is, how common is it for plugins to only support one plugin loader (paper) and only fawe?
Can i save players' mo eh amoung to config or do i have to use database?
I don't want to needlessly add dependencies and cut support when there could be other ways
mo eh amoung?
yes you can definitely save it to a config
I want to make a bot that sends a message every time there are new updates—using https://api.spigotmc.org/simple/0.2/index.php?action=getResourceUpdates&id=26665 but how can I always fetch the latest update? Thanks!
lol why is the resources api broken
it works for me
Because first item in the array :p
yeah, and if you wanna get the info of the latest update you have to figure out the page that contains it
anyway, you can just getResource instead of getResourceUpdates, then get the current_version
oh
Gud point
I think I’ve figured it out. The JSON response contains a stats.updates counter; I’ll cache its value on start-up, and if that value increases I’ll broadcast a message that also includes the current_version string. Thanks!
Hey, I'm trying to make minecarts go faster but the carts are having trouble going up inclines. I'll attatch a video of whats happening. Does anyone know how I can fix this?
I think its something to do with velocity? not sure though
The code I've got is
public void onMinecart(VehicleMoveEvent e) {
if (e.getVehicle() instanceof Minecart) {
Minecart cart = (Minecart)e.getVehicle();
cart.setMaxSpeed(1);
}
}```
why not use the experimental minecart datapack
I'm not sure how to set that as the server im wanting this on didnt have the gamerule to begin with and im not sure how else to sort of edit it
you have to edit the level.dat in a nbt editor to enable the datapack retroactively
I'll have a look at that thank you
uhh, do i just crate an enabled value with the name name then delete the one in disabled or is there something else i have to do=
im not sure on the details
Does anyone have some expirence with CommandAPI as im trying to use it with maven but i dont see anything in documentation for maven or anything, Any help would be appricated 😄
I know i red it a few times but cant figure out how to use it in my maven build system
omg im dumb mb
toggle the toggle on the right to maven
yeah
i forked fancyholograms and made it so i can make glowing holograms but for some reason
byte sharedFlags = fsDisplay.getSharedFlags();
if (data.isGlow()) {
fsDisplay.setSharedFlags((byte) (sharedFlags | 0x40)); // enable glowing
} else {
fsDisplay.setSharedFlags((byte) (sharedFlags & ~0x40)); // disable glowing
}```
these lines makes all holograms disappear as if they don't exist, regardless if they glow or not
https://paste.md-5.net/kagaruyoci.java
public byte getSharedFlags() {
return (Byte)this.sharedFlagsData.getValue();
}```
it returns a byte but it can be null
can that be the issue
fixed it, it was actually because it returned a null byte so i added a try-catch block
Return Byte instead of byfe
and just do a null check
that's a library
not mine
print out the shared flags and see what it outputs
also consider doing a PR
Hi
I need a dev to help me make a plugin please
``package com.example.sololeveling;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.CommandExecutor;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.Location;
import java.util.HashMap;
import java.util.Map;
public class SoloLevelingPlugin extends JavaPlugin implements Listener {
private ManaSystem manaSystem;
@Override
public void onEnable() {
this.manaSystem = new ManaSystem();
getServer().getPluginManager().registerEvents(this, this);
getCommand("rank").setExecutor(new RankCommand());
getCommand("skill").setExecutor(new SkillCommand());
getCommand("mana").setExecutor(new ManaCommand());
getLogger().info("Solo Leveling Plugin Enabled!");
}
``
I can't send it all 😭
?paste
Open the URL sent above, paste your code into that website, then press the save button (Or Ctrl+S/Cmd+S), then copy/paste the URL here
A brief description really should be sent in that message
this man isnt real
people don't read so it is not like it's gonna be of any use
then again, I can't fault someone for not knowing how a pasting service works
hes also probably not even 10
Those pasting services are not really self-explanatory
The URL changing isn't obvious and it's not auto copied on save. Some browsers even truncate the URL by default (*glares at Safari*)
https://pastes.dev my beloved
auto copies the url and usage is super obvious
except for when it dies
I did not expect to see shreks penis on this discord
this is like the third time I've messaged con about this
Did you censor that pfp
i did
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
no one is going to spoonfeed you that entire plugin for free or help you make it with chatgpt
hire a dev
Smart cutie
Aight don't worry
I just want a plugin for my smp with my friends 🙂
Can I find a list of event ids somewhere? 😄
@Override
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
if (msg instanceof ClientboundEntityEventPacket packet) {
byte eventId = packet.getEventId();
super.write(ctx, msg, promise);
return;
}
}
Hi, When I have this code sound should play right? Is playing some sounds but some not. Ex. this does not work
public static void playSound(Player player, String soundStr) {
String[] sound = soundStr.split(";");
player.playSound(player.getLocation(), sound[0].toLowerCase(), Float.parseFloat(sound[1]), Float.parseFloat(sound[2]));
}
SoundUtils.playSound(player, "ENTITY.EXPERIENCE.ORB.PICKUP;1;1");
But this does:
SoundUtils.playSound(player, "ENTITY.PLAYER.LEVELUP;0.25;1");
They change with every update
Someone submitted a pull request to one of my plugins which adds PlaceholdAPI support. How can I test it to see if his code works?
Merge it in dev and then run it?
its experience_orb not experience.orb
why are you using strings for this anyway? There's a Sound enum
declaration: package: org.bukkit, interface: Sound
But what's a good way to try it? I don't currently use PlaceholderAPI. Is there a plugin which uses it that could be easy to use for testing?
What does your plugin do
Yeah there is /papi parse
He added a placeholder so my plugin can return a string to other plugins.
tried this as well: player.playSound(player.getLocation(),"ENTITY_EXPERIENCE_ORB_PICKUP".toLowerCase(), 1F, 1F); still nothing I looked up.
Using string bcs the string is from config file, porobably will use Sound.valueOf()
Mods you should scroll up slightly
its ENTITY.EXPERIENCE_ORB.PICKUP
it was complaning when it was uppper case
but you should not be hardcoding strings in your code
its not hardocded in code, its just for showcase and testing, its loading from config file
You shouldn’t use valueOf either
Use Registry.SOUNDS.match
Then you can just use the in game sound key
(With or without the minecraft: prefix)
when it upper case
will use that, than. But weird one sound is working another is not. Thanks anyway
Ah, thanks for that. Looks like it will do the trick.
oh I see it now...
well youre namign them wrong because you havent gone and looked up what the sounds are actually called
whether you use _ or . is important
my name is md_5 not md.5
Ha ha, it causes the server to hang. Good thing I tried it.
The guy uses futures, which I've never used. I actually wonder if he had ChatGPT write the code.
Now I know why it's called a pull request. I'm pulling my hair out.
I call them Joel
Sometimes you just need to give them proper names, you're right
theyre called pull requests because
u pull at the devs heartstrings when u request they change their code
In no particular order:
- Assassin's Creed Black Flag
- Far Cry 3
- Rocket League
- Spider-man (the remastered one they ported from PS to PC)
- Planetside 2
Honourary mentions to Assassin's Creed Origins, Dyson Sphere Program, and Hogwarts Legacy
Also excluding Minecraft, but Minecraft is probably where I have my fondest memories
oh man, ACBF was fire
frfr 🗣️ 🔥
Far Cry 3 too, whee
Spider-man made me cry like a lil' baby
All three of them did tbh
Insomniac knows how to make games
is using NMS as simple as adding a dependency to maven?
?nms
?bt
look at teh CLI section
okay I ran java -jar BuildTools.jar --rev 1.21.4 --remapped and got a whole Spigot server folder. Do I need to do something with one of these .jars?
before i update the dependency?
no
can someone help me fix the spreading with holding right click not adding the items and only adding to the last one touched? Im using protocolib and adding worth to the lore of the item. stacking works fine but the spread doesnt
?nocode probably show the drag action relevant piece
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
I have some problems with carrots and potatoes interacting with entities
i'm trying to sell the vegetables I've collected to an NPC, it works with blocks (e.g. pumpkin/watermelon), but not with carrots/potatoes which are ingestible instead
Using Spigot API 1.20.1
And what is the problem ?
What happens, what you expect to happen ?
when the player interacts with these vegetables he gets the balance in his account, the system is almost working, in addition i checked if it is carrot and potato, but nothing happens
Show the code for the check
Problem solved
oh no you don't
I wanna know what happened)
Steve is on a mission
yup, i solved
🔪 How, what was the problem. AAAAA
💀
Chat
I have a class
And I want it's children to have different constants
So i just created a method in the parent that children have to override and return the constant
Is there a better way to do this?
Sounds fine
This is the best way to do it
It’s an OOP approach
Oop meaning?
You could also pass it in the super constructor but that approach is a little cleaner imo
Nvm googled
Object Oriented Programming
Create a field and initialize it in childs constructor
Trust
thats the only usecase for a getter (i will not die on that hill but its true)
Guys. can i manually update a plugin with a source code? the plugin is not updated to the latest versiom and i want to update it manually
Yes you can
Im not familiar with java but is it hard?
Depends on the plugin
If you've never worked with Java I suggest you hire someone to update it for you
I got no money XD
Time to look for a replacement or get familiar with Java then
there's a command that links a bunch of java tutorials
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
Not really API-related but just Java. I have a static registry list of custom classes that's populated on startup, and I later reference it to instantiate a desired Ability. The abstract Ability class has only one constructor that has no arguments pass in, and all currently-existing subclasses are the same way. However, java insists that the declared constructor requires arguments. Is there a fix to this problem, or is there some other way to accomplish what I'm doing without a declared constructor?
public static Ability create(int id) {
Class<? extends Ability> clazz = ABILITIES.get(id);
if (clazz == null) {
throw new IllegalArgumentException("No Ability found with id " + id);
}
return clazz.getDeclaredConstructor().;
}
java insists that the declaerd constructor requires arguments
elaborate
are you talking about the Constructor::newInstance method which takes a varargs object array?
Yes
the documentation on the method is quite clear
specifically
* <p>If the number of formal parameters required by the underlying constructor
* is 0, the supplied {@code initargs} array may be of length 0 or null.
so... supposing the constructor really has no parameters (and isn't an inner class), pass a zero-length array or null
or are you getting an error when doing that? if so, include the error and stack trace
[11:07:49 WARN]: java.lang.NoSuchMethodException: hollex.mCZ.abilities.spells.FireballAbility.<init>(null)
[11:07:49 WARN]: at java.base/java.lang.Class.getConstructor0(Class.java:3761)
[11:07:49 WARN]: at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2930)
[11:07:49 WARN]: at MCZ-1.0-SNAPSHOT-all.jar//hollex.mCZ.abilities.AbilityRegistry.create(AbilityRegistry.java:36)
[11:07:49 WARN]: at MCZ-1.0-SNAPSHOT-all.jar//hollex.mCZ.commands.zBootstrap.logicGiveAbility(ZombiesBootstrap.java:85)
...
public static Ability create(int id) {
Class<? extends Ability> clazz = ABILITIES.get(id);
if (clazz == null) {
throw new IllegalArgumentException("No Ability found with id " + id);
}
try {
return clazz.getDeclaredConstructor((Class<?>) null).newInstance();
} catch (Exception e) { e.printStackTrace(); }
return null;
}
updated function
ignore the return null it's just to let the stack trace print
mmm see what you're doing here is that you aren't passing null or a zero length array, you're passing an array of length 1 with the first element set to null
you'll want to cast that null to Object[] instead
or alternatively pass an empty array with new Object[0]
or just leave ti null with no cast
i think that will probably emit a compile time error since it's ambiguous whether that's an array with a null in it or a null array
varargs are kind of ass
It allows it but prints a big ass warning
let's see the warning
C:\...\src\main\java\hollex\mCZ\abilities\AbilityRegistry.java:36: warning: non-varargs call of varargs method with inexact argument type for last parameter;
return clazz.getDeclaredConstructor(null).newInstance();
^
cast to Class<?> for a varargs call
cast to Class<?>[] for a non-varargs call and to suppress this warning
Note: C:\...\src\main\java\hollex\mCZ\commands\ZombiesBootstrap.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
Ah wait
oh so you're not talking about newInstance, but getDeclaredConstructor
declaredconstructor is the problem
same thing applies
since it's a varargs call you should be able to do just getDeclaredConstructor() without any parameters
But that's the problem, I can't
if that emits a runtime error, include the error and the stack trace
It's a compiletime error
what's the error
It may be working now? I got another error but it looks to be from something else
I think I just needed to wrap it in a try catch before, which is strange cause I definitely did that before
wait a minute
Nah it's from the same thing
AHAHA
It's because the ability itself is failing to construct because of a failing method
Dolthead me
How can I attatch a armorstand to a player to display something like this: 20 / 20 (hp), I have something right now but it jitters
nvm i forgot to stop the playerMove updating it
Why are you using an amorstand?
Use a text display
Didnt know it existed, thanks ill have a look at it
Can you attatch it to a player?
Yes
Alright ill just use that then, thanks
I cant seem to find how, anychance you know?
TextDisplay tag = tags.get(target.getUniqueId());
if (tag == null || tag.isDead() || !tag.isValid()) {
spawnTag(target);
} else {
updateTag(target, tag);
}
}
private void updateTag(Player target, TextDisplay tag) {
Location loc = target.getLocation().clone().add(0, cfg.getOffset(), 0);
if (tag.getWorld() != target.getWorld() || !tag.getLocation().equals(target.getLocation())) {
tag.teleport(loc);
}
tag.setText(formatHealth((int) target.getHealth(), (int) target.getMaxHealth()));
}```
i have this but its not smooth and a bit delayed
how often do you call it
if you are using text displays, you're better off depending on the client-side interpolation for a smooth transition
though most people just choose to mount the text display, is there a reason you choose teleporting instead?
mounting stuff on the player is a bit involved because the spigot server will refuse to teleport any player that's mounted by an entity
Every playermove
You can't teleport the player if they're riding an entity, but you can teleport them just fine if they got passengers
i have a feeling we've gone through this tango already
use a task timer instead
and set the interpolation duration to something sensible
Guys, why does right clicking a block also call left click event?
You gotta do something like if interaction is rightclick
Action.rightclickblock
I think
interact event fires twice, one for each hand
how do I check if its main hand/
Maybe try set like a 1 second cooldown inbetween
the event provides a getter for which hand it is
I can .getHand() which returns an equipment slot but how do I check if it's the main hadn
all of this is mentioned in the event's javadocs
check if getHand is EquipmentSlot.HAND
And if the players holding something?
Or is that unrelated
unrelated
player interact event fires when you step on a pressure plate, that doesn't have any hand involved
oh right 🤦♂️
btw, why is pressure plate event groupped with click events? that always seemed so weird to me
because it isn't a click event, it is an interact event
ass pressure
it just so happens that most player interactions are made by clicking
💀
lmao
Ass pressure
what would something sensible be?
is there no way to just attatch it to the player?
mounting them
isnt that depricated
mounting entities? No, it isn't
if your talking about setPassenger() then yah but is there another way?
teleporting and mounting are the only ways
yes, that's essentially it
you just add the text display as a passenger of the player and it'll follow them
setPasseneger is from when entities could only have one passenger
Now they can have infinite
so addPassenger() isnt deprecated?
Well, probably 2^31 -1 but yknow
it is not, no
No
Jish, can you teleport entities which have passengers or does the server block it like when trying to teleport mounted entities
vcs2 brought it up before and I honestly can't remember the behavior
I honestly remember the server just being like, fuck passengers and dismounted them before teleporting but not outright cancelling the teleportation
welp, choose your poison then
there was a plugin which more or less fixed that behavior but I don't remember what its name was
with addPassenger() im assuming i cant move it around
you can't quite do that normally, but since display entities are transformable, you can apply a transform to set it to a specific offset
what do you mean?
Translation is applied before the billboard
just like
dismount all passengers
teleport them all
remount all passengers
???
Profit.
bychance do you know what tag setting is making it so that it like sees through entities
its showing me the blocks behind another player
I don't understand, do you want them to be see-through or not?
In any case: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/TextDisplay.html#setSeeThrough(boolean)
declaration: package: org.bukkit.entity, interface: TextDisplay
thanks
its not the text its the background
cant seem to see anything about background being seethrough
just says the text
just set the background color then
The background colour supports alpha
what does that do
Color.fromARGB(0)
will this seethrough players bodies or just be a opaque background
transparent
not opaque
if you want it to be opaque then you have to set the alpha channel to 0.5 or something
transparent
then 0 is fine
and int persists of 4 bytes, each byte represents a color. if the int is 0, then all colors are 0
Integer.max_value go brr
Dammit you already said that
Infinite doesn’t really exist for computers, you know this!
Just assume when I say infinite it’s actually the 32/64 bit integer limit
looking for dev for a new mc server
BigInteger:
I don’t think java uses biginteger for array length
(just make a BigList implementation smh)
all I ever wanted is BigInteger.MAX but java refuses to add it for some reason
because that would take.. well, a fuck ton of ram to say it politely
but then it instantly gets used
just buy more? lol
just download more ram
there is no upper limit to BigInteger and is implementation dependent. It must at minimum be able to hold the max value for int. But as far as going beyond that there is simply no limit
iirc it's backed by a long array so probably 64*2^31 bits
though i don't remember if it also involves radix shifting logic in which case god only knows how high it can go
that's like 17tb
it is backed by an int[]
the theoretical limit of an int[] is 2,147,483,647 but this is also implementation dependent as well
i'm not so sure, at least it can't be any higher than that, since passing long for an array index is a compile time error
fastutil does have BigLists and long-indexed arrays that are implemented as arrays of arrays, but that's quite different
well, since array would be based on natives, there is no upper bound to the size of objects and this also applies to arrays. So its implementation specific as well as hardware
as far as I am aware Java does not impose any hard limits
the only thing would be to keep the object small enough so that sizeof wouldn't overflow but even if the object is so large it would overflow it wouldn't prevent the object from existing or other functions being able to still be performed
the jvm might load and work with bytecode that accesses array indices beyond max int (though i doubt this) but i don't think any compiler will agree to emit such bytecode
have no idea
this isn't exactly something I have thought on testing out or really having issues with lmao
I can only go by what I know as far as natives and what the JVM says which doesn't say much in regards to the upper limits lmao
e.g. if you try to javac
int i = ints[(long)0];
you'll get
error: incompatible types: possible lossy conversion from long to int
int i = ints[(long)0];
i don't know since i don't like remember the specification in its entirety off the top of my head but i'd assume it being illegal is mentioned somewhere for compilers to enforce it
probably, but in regards to natives it isn't enforced in terms of array sizes
since array sizes is just the size of an object and again there isn't an imposed limit on it
mmmmyeah, though the virtual machine is pretty pedantic about what goes on the stack and what's being passed for what operands
type safety is enforced on the virtual machine level, e.g. you can't pass two consecutive ints for an op that looks for a long
so i sort of figure trying to pass a long for the array ops would explode when interpreting the bytecode
newarray takes an int count so any array can only hold 2 billion elements tops
10^(10^10.26956104063342)
would be the max in the current default JVM implemetation for bigint
which is still a really large number, however caveat is I don't know the arithmetic the JVM uses though which would matter
so I guess it is sufficient for most use cases lmao
what the hell is 10.26956104063342
If your system can support it anyways
You'll run out of memory allocating a max sized array lol
array.length returns an int, so it would make no sense at all for it accept a long as an index
power of 10 representation
okay how about, Integer.MAX_VALUE - 2?
You ask great questions
but also, a byte[] isn't the same as a long[] isn't the same as a String[] with 200-char strings
ive been making an immortal snail plugin. ive stopped armadillos spawning naturally, and on /snail start a snail is meant to spawn to chase the player eternally. but i cant even get the stupid armadillo to spawn. i changed it to spawn a cow, it works fine. but armadillos? no way.
ill drop the code below if it lets me
plugin.ylm is https://paste.md-5.net/womibixipa.makefile
please help im crashing out over this
I would use the spawn method that takes a class
Plus you can then use the consumer to modify the entity before it actually spawns
What version is the server on?
pls use multiple classes 😢
ylm cool new config format
if ItemStack#getItemName() is marked @NotNull why are we expected to check hasItemName()? what happens if an item name is not set? what does that even mean
you are using paper
or some ancient version
The notnull might be a mistake
Or it returns an empty string
Also it’s on ItemMeta not ItemStack
1.21.4
sorry my bad yep
thats what i meant to say
Okay so you definitely have the armadillo
Yeah idk try the class version of spawn()
hasItemName is probably just a relic from old api. IF its marked not null its most likely empty if non existent
What does that mean. I make a new class and do what
You can check the craft bukkit impl and see how it works
spawn(location, Armadillo.class)
Just checked, if it’s null you’ll get an empty string
am i not doing this though? the problem is that my debug messages are saying it is spawned at certain coordinates but it doesnt actually appear to be there. when i change mobtype to a cow it works fine
im really stupid and dont know what to change.
inside the spawnSnailsForPlayers method, first line in the try block.
Entity snail = (Entity) player.getWorld().spawnEntity(spawnLocation, spawnMobType);
probably is since not everything used to be marked with JSR nullability annotations iirc
minecraft's gaslighting me
I'm losing it
I'm about to go full on joker mode
I'M THE JOKER BABY
always have been
I better release this update and go to bed before I lose it and start morbing instead
hi guys how to create a custom hud like on this server? what plugin should i use?
i know about betterhud, but i don't how he work
Well it's just using a custom defined character, which is connected to a static image, which is being loaded into the boss-bar.
this isnt exactly the same, but its the same concept
https://www.youtube.com/watch?v=EL2X6ppZSCQ
We cover how to make custom ui bars similar to the health and hunger bar, in Minecraft.
💡 Amber's Negative Space Font (included in example pack) : https://github.com/AmberWat/NegativeSpaceFont
📦 Download (Contains Resource Pack and Datapack: https://www.dropbox.com/s/1fa3byoz6ugrwx3/cw_mana_bar.zip?dl=1
🔵 Discord Server: https://disc...
theres a negative space resource pack you can use combined with custom unicode characters
theres also this for betterhud https://www.youtube.com/watch?v=pVPW3WKa8UA
First of all, I used a robot voice in the middle of the video because I'm not an English speaker, so I'm really bad at it.
Useful links:
discord.gg/r7ACysju is the discord of betterhud and here i will put the pack of examples.
Timestamp:
00:00 Intro
00:12 Explanation of the folders
02:25 Me doing a hud!
You can also have custom overlays now
Like the pumpkin one
Only really good for static stuff though
they be doing anything but moving block structures
bedrock is probably too incompetent to add it
#general message
what block should i use to represent empty armor slots or empty offhand slot
Barrier
how do i shade this
i have this
<pattern>com.jeff_media.customblockdata</pattern>
<shadedPattern>me.kmyk.cashBlock</shadedPattern>
but what now
Top & bottom seem relevalt
Oooh I missed your actual question, sorry
thats oki
I believe that's all correct, it will be relocated when you compile the plugin
Yes
how do i check if it changes
open the resulting jar, the library should be in the place you specified
that's epic
i knowww
So in my plugin I need to dispatch commands via the console quite a lot, but the console always prints some output after executing a command. For example: [20:46:05 INFO]: Displaying particle minecraft:flame. I want to get rid of this, but I do still need to execute this command via the console. Anyone have some ideas? I already tried to add a filter to the Logger: Bukkit.getLogger(). Also tried creating a class that implements the ConsoleCommandSender Interface. Tried creating an NMS class that extended the CraftConsoleCommandSender. None of these things seem to work. Maybe they do, but I couldn't figure it out. Any help would be greatly appreciated
Are you using backlog?
And also what command are you dispatching that cant be done in code
99% of the time you dont need to be using a command
Yeah I know, but the plugin that I'm building works on commands written by the user that need to be executed in the console.
What do you mean?
Show your code
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), executableCommand); I mean its just dispatching a command?
No the modifying the logger
But again, I feel this is an xy problem. What command are you dispatching?
Is it for another plugin
No, I just need to know how to suppress command output haha. I know I can do everything with code, but my use case is exactly running user given commands
Bukkit.getLogger().setFilter(record -> false);
This was the short code of adding a filter just to test
But that didnt do anything
I think I found a solution
Hello! I don’t know how to code but I’m interested in helping a friend with a server plugin.
Can anyone show me the ropes? I could use some help in finding people that are very experienced coders. ;-;
Youtube is probably your best bet
I’m very stupid.
It’s not really something we can teach in an hour
Check out some tutorials but I would recommend learning java first
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
Ah, do you think you could land a hand? It’s for a Minecraft roleplay.
The bukkit logger does some funny stuff, I doubt most regular logger methods would work
Lend a hand in what sense?
give me money
Yeah Bukkit utilizes log4j apparently so adding a log4j filter does work, but thanks for your help anyway!
Check out backlog if you end up running into issues
We could use some help with coding. Our main coder has uni & can only dedicate little times
It’s for a political roleplay that I’m helping get off the ground. I don’t know how to code but I’m willing to put in effort to find people that can.
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Oh sure, thanks!
Chances of getting a good dev for free are pretty low though
hi there, sorry to bother, i'm trying to add serverselectorx as a dependency but i'm having some troubles, some1 can help me out? this is what i hav in my pom.xml
<dependency>
<groupId>com.github.ServerSelectorX.free</groupId>
<artifactId>ServerSelectorX</artifactId>
<version>3.7.2</version>
<scope>provided</scope>
</dependency>
am i missing something?
Should be correct, what does maven say when you build it?
Did you copy everything exactly
this is the error i get
Could not find artifact com.github.ServerSelectorX.free:ServerSelectorX:pom:3.7.2 in sonatype (https://oss.sonatype.org/content/groups/public/)
this is my complete pom:
<repositories>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.16-R0.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.ServerSelectorX.free</groupId>
<artifactId>ServerSelectorX</artifactId>
<version>3.7.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
does it not say anything about jitpack
yeah but it give me this error
and in the pom i have the red underline on the dependency for serverselector
where do you see that its on jotpack anyway?
I dont see anything about it on the github
honestly i dont know really what i am doing i asked chatgpt, got this error, and tryed searching over jitpack or sonotype the plugin name
i found this https://jitpack.io/#ServerSelectorX/ServerSelectorX
looks like there are some version on jitpack but not your version https://jitpack.io/#ServerSelectorX/ServerSelectorX
AI, right
I suggest you clone the plugin off github and build it yourself
clone off github and build with maven like your plugin
that might work
otherwise just add the correct maven <dependency>
<groupId>xyz.derkades</groupId>
<artifactId>ServerSelectorX</artifactId>
<version>3.8.0-beta</version>
im trying to match a block with its corresponding key in variants inside its json file in assets/minecraft/blockstates inside a resourcepack. i.e. one variant from the cobblestone_stairs.json file:
"facing=east,half=bottom,shape=inner_right": {
"model": "minecraft:block/cobblestone_stairs_inner"
},
so, how can i get the state of a block as key value pairs? im not too familiar with the spigot api, and i found this, but idek what CraftBlockData is, it doesnt exists, apparently, even tho its a recent post, and neither BlockState nor BlockData has a getValues method
https://www.spigotmc.org/threads/how-to-serialize-blockdata-for-any-block.631675/#post-4681514
i was just trying that. then just split on , and = and thats it? i was expecting something like Map<String, String>
is there not a way to cancel spawn eggs placed in water now?
? PlayerInteractEvent?
You need to do a bunch of extra stuff with raytracing
which can also be abused by hacked clients
if you want to parse these block states, you can use Bukkit#createBlockData or Material#createBlockData
do note that you need to specify a block type for Bukkit#createBlockData, the proper format is minecraft:block_type[some=data]
Says who?
Why would you need to ray trace
Because the event doesn't get called
It only calls right click air when you place spawn eggs in water
Why can't you cancel that?
Because it doesn't provide a click location
therefore I need to retrace for a water block
the action would probably be right click air given the water is deep enough but the clicked block should be water, no?
it should be but it doesn't provide a clicked block
so it is just null?
yes
can you even use spawn eggs when you're right clicking air/water
as far I remember, you need a solid block for it to trigger the interaction
pretty sure its a new minecraft version thing
uh then it could possibly be considered a bug in the interact event if that case isn't handled
uh apparently it works on water since 1.6.1 lol
I tried to spawn a packet based TextDisplay and sent addEntityPacket to specific players.
But sometimes addEntityPacket is ignroed.
Actually I was in 1.20.4 and recently I moved to 1.21.4.
Does anyone know how to fix it?
Show your code
and are you 100% it sends the packet? the client doesn't just ignore packets