#help-development
1 messages · Page 192 of 1
I try again that
Saves the need to call 2 methods
Tried getConfig() without removing the config and still it's empty
copyDefaults copies the section to RAM so you are saving a blank config file
If you only have one config why not using methods Provided by Plugin like https://hub.spigotmc.org/javadocs/spigot/org/bukkit/plugin/java/JavaPlugin.html
declaration: package: org.bukkit.plugin.java, class: JavaPlugin
if you have a config.yml in your jar just call saveDefaultConfig(). It will create folders and export the config
Yes. The Plugin object already does the "heavy" lifting.
Do I then remove the saveConfig() method in ConfigWrapper
which is used on loadConfig()
call plugin.saveDefaultConfig() on start and use plugin.getConfig() to retrive the config later in you code
Note: If the plugins config.yml already exists in your plugin's directory saveDefaultConfig() won't overwrite it.
Is there a way to change the player skin, I mean that one you see in the tab.
.
Anyone know if there is a way to load a nested settings.gradle.kts seems it only works in root project
Adding a plugin that should only be used in one project, not globally. Also needs to read from nested gradle.properties
hello, i try to make a message-system and i write this:
https://paste.md-5.net/jayuhufave.http
but on return plugin, plugin send me this error Cannot resolve symbol 'plugin'
by the Material ENUM
but there's very strange thing
there are some items which are like fully ghost
they don't either display
or have any properties
just a name
and it is showing like nothing in the inventory
are you setting plugin on enable
?
oh
@Override
public void onEnable() {
enable();
events();
commands();
setConfig();
getServer().getMessenger().registerOutgoingPluginChannel(this, "bungeecord");
}
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
doesnt help without what those methods are
also use di
its easier
i use the code from a youtube tuto
does someone know what Warped Wall Sign is?
this is then a BlockState
why is it in the Material Enum
bruh what
makes pretty good sense to not have nbt there
public class MyCommandClass implements CommandExecutor {
private final Main plugin;
public MyCommandClass(Main plugin) { this.plugin = plugin }
}
I prefer BlockState
this explain then why when I display all the items in the Material Enum there are some blank pages
player heads yes, idk about torches
is there a way to check these?
I mean for warped sign wall e.g.
ehh, is there a category?
don#t think so ?
signs aren't
those are rotatable
oop
is sign only for standing signs ?
TIL
Well
not like directional helps you tho
there are a bunch of other block datas that are directional
okay so I looked more for the Material Enum
and I found out that there are more of these
I think it would have been better if Spigot has made a BlockState Enum for these cases
the good thing is that these are filtered
as I see they're last
I mean
like
BlockState.WALL_SIGN etc
just type the Material like SIGN then set the state
I think it would be more organized cause the Material class contains all those things and you cannot detect super easily if the Material can be an Item
how to loop through all online players?
Bukkit.getOnlinePlayers()
bungeecord channel != BungeeCord channel
ty
for (Plater player : Bukkit.getOnlinePlayers())
🤢
Bukkit.getOnlinePlayers().forEach() ❤️
You know what? You're lifesaver
what?
seems like I should look more into the methods
I dont even know what he is doing
Im like those one that just disturb when u need help
gotcha
first is lambda, used for small operations
I have a small question no?
If a have a user UUID on every List<UUID> from many random object (same object many instances) ? How would i really know which to get for the event?
huh
Yeah its confuse
I also confuse
I will make a code eample
Let say i have the next structure https://paste.md-5.net/qovoziqeze.php, and i want to check if event player uuid is inside of one those game, to finally return another object
Do i have explained now?
?paste
i try to tp a player in server, the code is this:
https://paste.md-5.net/ocefadakiq.java
And the error is this:
https://paste.md-5.net/uxitizalav.bash
i changed somethinfs
like Bungeecord is now BungeeCord
ecc
Looks like Main.getPlugin is null
didnt we just say to use di like 10 min ago
code here
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
I would heavly recommend using Di over singleton
?main
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
?main
I'm confused
Read!!!
Read the follow urls
https://www.spigotmc.org/wiki/using-dependency-injection/
https://www.spigotmc.org/threads/why-you-shouldnt-name-your-main-plugin-class-main.493289/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
tha
https://paste.md-5.net/opehocumij.java this should be the command class and on the set executor it should be new cane(this), this
?spoon ;/
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
yeah i hate it too
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
?convertions
Also that
Okay
cant really force someone to change their file name
So he must read many things before start coding
you should
Agree
does anyone have an idea how to rotate a location by 90 degrees, I have 3 points on the axis of a cube, I need to rotate it being proportional to the center
Vector#rotateAroundAxis
Pretty sure theres a matrix translation for that
so..
i was skipping class

i was never good with these things, i believe not remember
do you mean center?
Your drawing wont help if you are working on 3 axis
actually id rather do it with 3 angles, because I'm creating an obb and I need those
but im ignoring the height
Then why worry about y axis
aaaaah
Z would be more important in your diagram
yes yes, sorry xd
the y would be the z, ignore it then
myes
...
I told you how to do it I cant really explain any further
I can give a demo with actual numbers if you want a visualisation
but before you had thought it was three-dimensional didnt you?, that and looking over a cube
come on i already have all these red dots on the cube, what do i need to do to turn it to make it that way?
Even if you ignore y it is still 3d
to 0 a 90 graus
alr
just forget that there will be no depth
rotated jesus
what is theta?
Degrees in radians
you mean
j
_ _ e
_ _ s
_ _ u
_ _ s
other way
what exactly the calculation do?
Rotates a point about the origin
you mean
_ _ j
_ _ e
_ _ s
_ _ u
s
but isnt that what activateAroundAxis does?
Probs
nmvm this is hard
Folks, I've a question (about performance): Is it better to check a variable value rather than risk giving the same value?
In what context
like:
setfoodlevel(20) and not if(foodlevel!=20) setfoodlevel(20)
Oh it’s negligible
micro optimization is pointless in that instance
you are literally counting clock states at that point.
Reading first would probably be like micro seconds faster
yeye i know but I had this thought that I could not get out of my head ahhahaha
just write clean code
hey so im having a an issue:
I want an armorstand to follow an arc instead of a having its velocity rapidly decline because im using it for a projectile.
However, when I set the armorstand to ride a snowball, the snowball breaks instantly on impact with the armorstand even after setting .isInvulnurable
Is there another way for it do follow the arc, or for it to ride the snowball without it breaking?
Try an arrow
Like riding an arrow
I’m not sure if that would work for you but might as well try
How I can disable open trapdoor?
Wrong channel
Wait wait
Are u coding a plugin?
If you are not coding a plugin, you should use #help-server
- Wrong Channel
- Go to FAWEs support server
cancel PlayerInteractEvent
Indeed
Anyone know what packet I would use to send totem animation with NMS
I see the ClientboundAnimatePacket but everything only has to do with player animation in hte constants or do I just have to guess the arbitrary number
wait its a particle effect apparently 😭 i'm dumb
no nms needed
always nice when stuff is in the api xD
Agree
think it's entity effect
yep
I get this error and not know what to do
https://paste.md-5.net/wumivibeqa.bash
in your EPCommand class on line 27 ...getConfig() is null
make it actually return something?
Because the getConfig() method is returning null? 🤔
No it's returning config
No!
For sure
if something is null, its because its not returning what should be
This is the getConfig() I use
public FileConfiguration getConfig() {
if (this.config == null) {
reloadConfig();
}
return this.config;
}
I tried making a world generator and generate something at y level 40 but nothin generates
no errors either
Without code is really diff to help!
Alright lemme share my code
?paste
Debug 🤯🤯🤯
Indeed
Im 100% that he is trying to code without learnt java before
👍👍👍
I remember that i used to be like that
Cant agree more
Now im a bit annoying but i used to be 100 worst
Help me? Please?
I look at your code
I feel left out lmao
But i couldnt understand it
i mean im going to sleep right now, maybe another can help
can I tell you what Im attempting?
Also remember to be pacient
I mean i dont have problem about tagging me
I would help but im on my phone 😅
;-;
But im like womens "i have my days" were i can literally swear you full day or just be trying to help full day
🤣 🤣
Im also on cellpgone
LMAO i cannot use this shit, cellphone dicord is more trash than it used to be
i have a deadline
basically, asking for help for something paid
Fax 😔
So with more reason you should be pacient
I mean if you want fast help you should pay someone to finish it or give you a hand with it
I don't think you registered your listener unless I'm not seeing it.
I didn't even try to attempt to help, trying to help someone on a phone is terrible
I cant do it for the life of me
Intellij "decompiles" it. You need to fully decompile it in order to edit it
You should probably just obtain the source from the author
Something like https://github.com/fesh0r/fernflower. Again. I don't recommend it
I keep getting similar errors/warns to this when I try to load my plugin that is being set up to save data to a mysql database on a paper server. It does not do this on my spigot server... anyone know how I can fix this?
It's complaining you're using sys.out or similar
ah ok
so I'm not allowed to use that
does it want me to use bukkit getlogger thing
It's not that you're not allowed it's just bad practice lol
Hence it's a WARN and not a FATAL
Sure, anything that's a logger
ok
player.addPotionEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 20 * 20, 1)); Why wouldn't this effect be applying I tested my code it works it should apply the effect debugged before and after the call and both were triggered meaning this is the issue I swear I'm stupid or something
declaration: package: org.bukkit.boss, interface: BossBar
how to get chest of a structure ?
Wdym by this?
I think it means taking a chest with theirs of a specific structure in it
stronghold type etc.
what makes you think that
🤓
Hello Guys is there a way to get Anvil Input bigger than 32 chars? Because you can write more characters than the 32 limit but after completing they get removed
Currently I don’t listen for any packets
I just listen when the player clicks the 3 slot and then get the ItemMeta and the name
do you know which Packet is?
It's likely the client reduces the size and sends it. You can always check but I imagine the packet is the constraint here
client doesnt like long strings
There’s an intresting thing in 1.18 and up when I have been looking through the AnvilMenu NMS I found a filed called rename limit or rename char limit idk but I will try it to see I think the server reduces the text
if I can remove the Anvil char limit then this will be really cool
because its the only one remained which can be used without opening the chat and putting little long Strings
you could take a look at AnvilGui and see if they already do it
Signs are also cool but too short. I also read about Command Blocks and Books but since 1.8 they’re Client Sided but the Command Block GUI would have been fitting perfectly
I already have one working even with Reflection
I’m also using it but I don’t like the char limit
then you have to search for another alternative
there’s already an alternative you know Chat but I want more fancy style and Anvils are cool way and I think it’s possible to remove the char limit via Server Side just need to do some experimenting
i'll anticipate the excitement and save you some time: no its not
Thanks but still I wanna try because one field called rename_limit or something similar caught my attention but it’s only available in (1.18 or 1.18X) and up but Reflection adaption to those versions is hard
Probably a final field
and even if not changing the field would boom other stuff in the background
and the way minecraft is developed i wouldnt wonder if the client has the rename limit too, trims the text and sends it to the server which already knows whats the max possible length
i got it now no need of tell late support -_-
No need to be rude to someone trying to help
I am sommuning a dragon with a custom name but the bossbar is not appearing, how can i get the bossbar to show?
hey so im trying to spawn armour stands each 30 block away from each other in front of them using this code
Location location = world.getSpawnLocation();
for (int i = 0; i < 30; i++) {
world.spawn(new Location(world, location.getX()+(i*30), location.getBlockY()+(i*30), location.getBlockZ()+(i*30), location.getYaw(), location.getPitch()))), ArmorStand.class);
}
but instead of infront its instead creating digonally
is there any better way to get coords of 30 blocks away in north direction of a entity
it is about time you learn about vector math
of course it will move diagonally if you're adding to all 3 axis at once
Go in game
Check when you go towards north how x y and z change
Figure out which one you need to increase or decrease by 30
north is +Z
i actually tried to add the X vector only but the results were same
north is Z yep
if you want to spawn it in the player's direction then just get the direction, normalize, multiply by 30 and that's your offset
it works fine now, actually the armour stand was spawnning inside ground when i added X vector so i thought it not working
anyways Thanks for your help
have a great day
i fucked up
iirc mysql takes forever to connect but queries are fast
like 1-2 ms / query but connection is around 80-100ms
redis was like 120ms connection but 0.2ms latency per call
mans writing into a floppy disk or something idk
lol ye
CompletableFuture<T>.completedFuture(T object)
it's useful because thenCompose doesn't like null values
early return lol
thenCompose(null) throws errors but thenCompose(completedFuture(null)) does not
oh
took me days to write a reflection thingie and now its still full of bugs
ah now i see why it's that slow, pushQuery reopens the connection
just make a lazy singleton for the connection
type deal
timeout is in seconds and I'm dumb btw
ye i have a lazy connection thingie
im closing conn afterwards so ye
bruh bird sitting next to me on chair
redempt told me it was a good practice
only more reasons for me to hate the guy
lmfao
its yelling that the conn is closed now :/ i mean im not closing it in between iterations
on the last iteration it closes before executing the query lol
A ing student have told me that his teacher explained him that closing the connection and re open it makes more latency than the resources used by leaving the connection open?
correct
It was not a question sorry
I do not see the reason to ever close a connection unless your program is terminating
Agree with you paradise
Connection pools keep connections alive for as long as they can. Its pointless to close them if you can use them again
I've never really seen that done in other programming languages it seems to be common in java for some reason though
Yeah
so doing try (Connection conn = hikaricp.getConnection()) is pointless?
My mate that code on .net framework told me that he open the connection and leave it open. Until program restart or shutdown
it doesn;t close it
I mean if you already have one open why would you be a bozo and close it just to re open it a second later
If you use any kind of batch update with hikari you will want to increase yoru connection pool size
multiple statements executing at once or smthg basically
Oh ok
well idk how to explain
Yes I understand what you mean
No, batch updates are an SQL method
pushes all changes in a single batch query
instead of issuing multiple individual ones
kinda weird but my connection closes on the prev last query
this doesnt make sense at all
sounds odd. What is the actual query you are performing?
Instead of inserting player achievements wait for a crash shutdown and insert them all
looks like whenever i pass more than 4 queries it says the conn is closed or whatever
There is no option yo know whe deber crashed
that was a joke
you wait for the server to shut down to do inserts but it crashes so you lose all the data kek
I dont like jokes
damn it. PC just bluescreened 😦
maybe its connectionphobic
how that
Fourteen
Fourten
Ahh shity cellphone discord
Its so bug that repeat the. Essave
No
Discord for cellphone is I the shit
Its really brokened
Fourten I need help creating a functional interface for executing tasks and allowing them to throw checked exceptions with no need to caching them manually
throwing function like thing
and sneakythrow
smth like this?
@FunctionInterface
public interface ThrowingRunnable {
void run() throws Exception;
}```
```java
public <E extends Throwable> void executeTask(ThrowingRunnable task) throws E {
try {
task.run();
} catch (Exception e) {
throw (E) e;
}
}```
made a whole bunch of those interfaces
you might even want to specifiy ThrowingRunnable with a generic parameter <E extends Exception>
Fourten my idea is to have a task class which allow you to run things throwing checked exceptions. And then use a custom executor for the task which add an id to every task, allow you to start/stop, run async/sync, etc
ig your task class will implement that throwingrunnable thing
How can I fixx that?
Ig?
and the executor will have to handle the unchecked exceptions
youll have to catch them at some point
not a command
Oh ok
dont remove while iterating over a collection
ig = i guess
They should add onr
use an iterator and iterator::remove
Okay
is it an arraylist? they you might use ArrayList::removeIf which takes a predicate
And please stop rigty now using va
You are making your code to take more time during compilation process
lol
In the executor class I will manage that
xd
but faster to write
That still gives me the java.util.ConcurrentModificationException
@tardy delta
ServiceExecutor executor = new ServiceExecutor.builder().delay(10, TimeUnit.SECONDS). pool(10).async(true).build();
executor.queue(task).catch(ex -> logger.severe(ex.getMessage()));
What u think?
you can;t loop and remove. the removeIf performs an iteration
Ill just use an iterator xd
you can do it all in the removeIf
Are u spsnish?
no just terrible typing
smth like this?
@FunctionInterface
public interface ThrowingRunnable {
void run() throws Exception;
}```
```java
public <E extends Throwable> void executeTask(ThrowingRunnable task) throws E {
try {
task.run();
} catch (Exception e) {
throw (E) e;
}
}```
add debug. a sysout when it pastes
K
remember it will only paste in new chunks
So was overriding the default generator a bad idea?
so listener has to be registered before you gen/load the world
I did load as startup
Here's my source coxe
it looks fine. add a debug in teh place runnable
you may have to pass e into the lambda runnable.
Lambda??
Isn't 0urs bukkit?
() -> {} is a lambda
So ill have to place the if(e.isNewChunk)
In the runnable
K what timezone r u
UK
Will you be available 6 pm est
EST is 5 hours behind BST
est? is that like NewYork time?
its like 11pm here
6pm est is 11pm uk time
O
possibly. I tend to go to bed sometime between 10pm and 2am
K
events are raised in one plugin and listened to in another
what's the equivalent of the else statement in a switch clause
default
aight
you can only have one
how would i display a fake light
what do you mean "fake"
because iirc theres a packet for light level and a light block in the newest versions that you cant interact with
the light block is invisible and not collidable but it still gives off light
I see
but like
im trying to uh
spawn a light source at the player
constantly
so it looks like theres always a light following the player
well then its probably gonna be packets
scary~
use protocolib and you should be fine
thats scarier than nms
a quick google actually lead me to something called "Light API"
maybe look at that
have fun recreating the api or protocolib then 🙂
alternatively just set the block at the head of the player to a light block whenever its just air or something
thats what i said yes
hmm i was thinking about my db lib, so should i have a connection open the whole time or should i just close it after x minutes or something?
like right now i'm closing it immediately but that goes brr when reopening it frequently
depends, generally you should be using connection pooling where you have a few connections maintained
ye i was thinking about using hikaricp too, anyways im using an sqlite db now
connections can't be opened for an infinite time as there is a max time for them, so the connection pool has to always check to make sure the connection is still valid
but you only need connection pooling if you know you will be using the DB often
the reason for keeping connections open, is because it guarantees a connection and less time is spent opening one up as there can be significant delays in doing so
im not using it very often
might even have a task that closes it after x time instead of immediately after executing a query
Is there a way to make goats always aggressiv?
I think setTarget() would work
and just run a timer to set them agressive to people nearby
hello, i write this:
for (String string : main.getConfig().getStringList("scoreboard")){
}
but i want create a variable they count a number of cycle
how i can?
either make a counter
or use normal for loop
but what is the use case ?
if you want to see how much enteties you have in list
just do List#size()
I want to create an editable score in the config
more specific, obviously everything in a config is editable and you appear to know how to save and load from a config. So need more details on the nature of your problem
currently it sounds like so far you want to be spoonfed because what it seems like what you asking is relatively a basic java question meaning you probably need to learn more in using Java. Getting help here should be last resort in that you have attempted to solve the problem on your own as well as research yourself
okay, thanks
How would i get all materials in a list? i want to get the statistic blocks mined but i need to supply a material
hi im making a plugin and i need to store data, and i wanna know what the best way to do this is. i feel like theres so many ways, like csv files, yaml, json, sqlite dbs etc, and i dont know which one would be best to use
there's basically only 3 I can recommend
pdc for small-medium scale data attached to in-game objects
yaml for data that will generally remain unchanged most of the time (config, mostly)
databases for "hot" data that will change frequently, needs to be shared across more than one server, and/or is large scale
for real small things you can also use txt files but as soon as you need key value pairs its yml
its basically this, data will be changing a lot, but i dont really need the data to be transferred between servers. what would the best database be to use, like h2, sqlite etc?
sqlite is usually good
sqlite if it's medium-scale or smaller and doesn't need concurrent access
mysql otherwise
you could theoretically also save data in hashmaps and save it less frequently if you wanna use yml files for simplicity
of course under threat of data loss
there is no such thing as really which is best
it is all dependent on what is required and what you are comfortable with using
Not really spigot related, what does % do like 5 % 3
for this would I loop through all materials and add them?
% is reminder
so 5 % 3 = 2
yes
is there anyway to iterate over each value in an enum
.values or something?
there is API for this ?
declaration: package: org.bukkit.entity, interface: Player
nah you can use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#spawnParticle(org.bukkit.Particle,org.bukkit.Location,int,T)
declaration: package: org.bukkit, interface: World
oh
you can ignore that usually
there are a bunch of overloads
should be one with just an int after the location for the count
the data is for like, redstone data (their colour)
or block break particles and their material
Not sure why I am getting this
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
Caused by: java.util.zip.ZipException: zip END header not found
at java.util.zip.ZipFile$Source.findEND(ZipFile.java:1469) ~[?:?]
at java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1477) ~[?:?]
at java.util.zip.ZipFile$Source.<init>(ZipFile.java:1315) ~[?:?]
at java.util.zip.ZipFile$Source.get(ZipFile.java:1277) ~[?:?]
at java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:709) ~[?:?]
at java.util.zip.ZipFile.<init>(ZipFile.java:243) ~[?:?]
at java.util.zip.ZipFile.<init>(ZipFile.java:172) ~[?:?]
at java.util.jar.JarFile.<init>(JarFile.java:347) ~[?:?]
at java.util.jar.JarFile.<init>(JarFile.java:318) ~[?:?]
at java.util.jar.JarFile.<init>(JarFile.java:284) ~[?:?]
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:174) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
read the first line
I suppose i should've stated that beforehand
Does anyone know how i can make a landing entity explode on hit like a creeper does?
nope
I know
It's a private plugin so it's really just for cleanliness
anyone?:)
But I'm still really not sure why I am getting that still
I think it has to do with the Instance stuff i'm using
Not really sure what else I should do to access it tho
public static Main getInstance() {
return INSTANCE;
}
// in onEnable
if (INSTANCE == null) {
INSTANCE = this;
}
Show full main class
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
also nothing else should interfere so there's really no need
I guess you know best
Hi everyone, technical question: I know that a command can be execute by instance of Player, Console and BlockCommand. But in docs there are many entitys that they are subinterfaces of CommandSender, Does that mean that entities can send commands, or why CommandSender implements them?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/command/CommandSender.html
Yeah they can run commands
I can use that on two of my classes, But one can't be registered by the plugin manager because it is just for JDA
register it on the command registration
Its on the create JDABuilder.createDefault sorry, thought it was command registering .addEventListeners(new CommandClss(this))
ye ty
Why your plugin.yml have extra empty line ?
it dosent
also that wont change anything
xD
Looks like it does, but ig ok if it doesn't change anything
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java#171, also this seems to be your issue
maybe corrupted jar
I've already fixed it and the jar is not corrupted
World#createExplosion
a simple mvn clean package fixes broken jars in 99% of cases
exception you showed is thrown at jar.getInputStream, and according to google, it most likely happen when jar is corrupted
As ive stated, i have already fixed it
iterate over the config section map
you can get it directly as a Hashmap
hold on, i have an example here
this should work for you
then you just do .get("map") and you should be good
you will have to cast it tho
no
put it to false
that will make the only value in it be the one with the key "map"
when you use .get("map") on what you get from the getValues(false) method you will get a Map with values of the type Location
Is CraftPlayer class only avaible in CraftBukkit?
youre casting a configurationsection to String?
because IntelliJ doesnt know you cant
Why no one is helping me 🥲
cuz I dont know :/ how about you google it 🙂
?jd-s
honestly I am still confused as to what youre doing
I've already searched on Google, I even looked up on jdocs, and it doesn't come up, tho someone said that is avaible in all bukkit forks
literally one search
also I dont believe you know what a fork is
So is not rigt the one who told me that is avaible on spigot and paper?
lemme break it down for ya
Yeah I do, I've just saw what I wrote.
Spigot is a fork of Bukkit -> Spigot has all the code that Bukkit has
okay a sec
you searched for bukkit, I searched for CraftPlayer. we are not the same
wdym
iirc CraftBukkit isnt Bukkit
CraftBukkit is a fork of Bukkit iirc
Spigot is a fork of bukkit
oh didnt think of that dynamic
Omg everyone say something opposite, or maybe I'm just getting confused, btw can I use the CraftPlayer class on Spigot/Paper?
No
what
CraftBukkit is an implementation of Bukkit's interfaces
^
ok, fine, maybe if I explain my problem someone could actually help me
Epic just did
CraftBukkit got DMCA'd and spigot was born, revamping the build system to comply
Simply, I need to change the head of the skin, I mean the one you see in the TAB next to the player nickname
Spigot had some rules for PRs that some people didn't like, so paper made their own fork
implementing and maintaining those changes themselves
Looking up even in spigot forum, they say to use the CraftPlayer class
Since I can't use it in Spigot, idk how I can get out of this
Paper also had some forks for tiny obsessions in performance
you can
I'm using TAB API
CraftPlayer is the implementation of the Player interface
Light up me
nms stands for?
Yo, is there a way to increase the entity distance of something without forcing the player to change their entity-distance setting client side?
actually hold on
if it doesn't work:
run buildtools (java -jar buildtools.jar --rev <version>
if using gradle, add mavenLocal() to your deps
is this wrong then?
activation and tracking range seems to have no effect
net.minecraft.server
basically the code that spigot is abstracting away
not necessarily
Okay, so it should work even if my plugin is in Paper, isn't it?
Minecraft Server -> Bukkit -> Bukkit but interfaces && CraftBukkit as an implementation of them -> Spigot
Or maybe there's just a way to do it even without nms
idek what you're tryna do I just pulled up randomly
I mean TAB API docs have lack of info about skin changhing
look at the code or jds
Skin changing is a pain
wait a sec
I mean not necessarily but no point in using TAB for it
I'm not doing Skin Changhing it self
I'm trying just to change the head of the skin in the tab next to player, I've found on google like just 3 pages, and they all say to use the CraftPlayer class, readding in the server a gameprofile modified
yeah no that's changing the skin itself
actually I'm using TAB API and SkinRestorer API, but I can't still find a way to do it
you basically want the tab to display some fake players that have a different skin
and hide your real players from tab
You got it
is there a way to increase the entity distance of something without forcing the player to change their entity-distance setting client side?
so yeah it's basically a mix of NPCs and tab manipulation
I mean, not that quite
It's a disguise pl
check the first pin
And since is for a big rp server, I need to make it perfect
I mean if you want disguises just use libsdisquises
This perfect includes even small details, like when you disguise you must keep the skin you have, you're still in the tab
Disguising as player?
but others should see you differently?
yeah you can do that
in that case you'd uhh...
do some packet trickery
delete your player and respawn it as someone else with the same entity id to all players type deal
so all packets match the same id
all solutions are hacky
No basically, you're still "ok" in the TAB, you just change skin, tagname and prefix/suffix (already done with skinrestorer and TAB api), the problem is that in the tab even if you don't change tag or prefix, you change the skin
The skin mustn't change
yeah so back to the fake player in tab situation
Even if I change the skin by my self, it changes in tab right?
so basically I must readd the player in the tab
re-add the old skin into the tab as a fake player while hiding the real one
type deal
idfk it's something hacky and will use like 200 lines of nms
not in the mood neither do I have the time for that
https://github.com/SkinsRestorer/SkinsRestorerAPIExample/blob/main/src/main/java/net/skinsrestorer/SkinsRestorerAPIExample.java
https://github.com/NEZNAMY/TAB/wiki/Developer-API
If you have time give them a look
Meanwhile, if you want to explain how to do in the "vanilla" way, I would be honored
there's no vanilla way
yeah nms
well, so, I need to..?
Hi, I'm trying to listen to a custom event from a plugin that is a dependency of my plugin, but every time the event is triggered I get an error like this:
Could not pass event CreateClanEvent to MyPlugin```
Does anyone know what might be wrong?
@EventHandler
public void onClanCreate(CreateClanEvent e){
Clan clan = e.getClan();
registerClan(clan);
}
this is the method called when a clan is created
Going to need the full error
?paste
paste the whole thing
can you show registerClan method
and createClan
you are creating a clan on the event causing an infinite loop
public static void registerClan(@NotNull Clan clan){
if(gson.findClan(clan) == null){
ClanData data = new ClanData(clan);
GsonManager.getClanData().add(data);
gson.save();
}
}
what does findClan return and gson save
and is getClanData an arraylist
@brisk estuary ^
I don't understand which part of the code creates a new clan
the registerClan method just updates an ArrayList of clans and saves it in a json file
yes
public ClanData findClan(Clan clan){
for(ClanData data : clanData){
if(clan.equals(data.getClan())){
return data;
}
}
return null;
}
public void save(){
try(FileWriter writer = new FileWriter(this.file, false)){
gson.toJson(clanData, writer);
}catch (IOException e){
e.printStackTrace();
}
}
Where is the event fired?
have a map
How am i supposed to get the content of a chat message with AsyncChatEvent
AsyncPlayerChatEvent#getMessage
?jd-s
1.19.2 getMessage
It legit does exist
dms
You can verify
Then reset it?
Use a screenshot website
then why would we have motivation to help you out
How is me not wanting to reset my password inhibiting your motivation to answer a question 😂
I have 0 reason to reset my password
anyway thats off topic now
Use a screenshot websitr
well the issue is why would we wanna spend time helping someone who doesnt care in the first place
but yeah
When did i ever say that
😂
If you have no motivation to help us understand your problem, which we already answered, why would we have motivation to assist you further?
I mean you said this
Never said i didnt care
i said i did not want to reset my password
and apparently all of you feel the need to blow this up into a huge issue witch didnt need to happen in the first place
The solution to your issue is quite simple
Use the correct version of the spigot dep
Yep
I do?
?paste your pom
or build.gradle or w/e package manager config
It seems extremely unlikely you do if you're missing something like getMessage()
Cause either you're trolling or you've imported some 3rd party spigot.
ur using paper
AsyncChatEvent is paper
AsyncPlayerChatEvent is spigot
it should be just .message()
Certified paper moment
and to convert that to plain text it should be PlainTextComponentSerializer.plainText().something that takes a component param
?paste
I've been looking for this documentation for 2 hours, I can't understand why this thing doesn't go ...
https://paste.md-5.net/yumibirumi.java
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
yes
i do
nothing changes
okay
this is my main class
and this is my cane class https://paste.md-5.net/unijifowim.java
1.19
Does anyone know how to color my name tag (above head) with luckperms?
Ever since I got luckperms on my server scoreboard teams don’t color shit anymore
Side scoreboard?
seeing the documentation I fixed everything, I do not understand why it does not give me errors, the message sends it to me but it does not send me in the bungee
I did /scoreboard players and objectives and all where empty sooo
With the lands plugin when I try create a land it says "[lands] this is deactivated in this world. world: Finalriskmc "
@eternal oxide
quick question
how can I make it so the structure file is embedded in the plugin?
how
oh
put in the resources area?
@eternal oxide how do I extract it on startup?
Plugin#saveResource
in plugin.yml?
no
Hey folks! I have a hunger games server setup and I'm trying to figure out how to change the settings to allow for multiple lives. Any advice?
Your main class has a method saveResource
so on enable/
yes
false, you only want to extract it once
alr
No - I'm trying to devise a way that when a player dies in the game, they're actually just put back in, up to 2 times (like having 3 chances in the game)
Tell me how to mention the main class
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
ohhhhh I see! Okay, so I'm basically spoofing them back into the game by changing their role from spectator upon death to survival? How would this affect the gametype - IE, if it ends when all players are killed, will it end if I brought them back?
And where would I add this UUID? I'm a little bit new to this - I'm hosting something for a charity event and it's all a little beyond me lol
@eternal oxide
[ERROR] Error occurred while enabling Backrooms v1.0-SNAPSHOT (Is it up to date?)
java.lang.IllegalArgumentException: The embedded resource 'src/main/resources/backrooms.nbt' cannot be found in plugins/Backrooms-1.0-SNAPSHOT.jar
at org.bukkit.plugin.java.JavaPlugin.saveResource(JavaPlugin.java:193) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
that path is wrong for getting the resource. use just its name
Okay, I'm in a pickle because I'm using apex, which has some preset arenas/maps, so I'm trying to find the place to put all this lol
yes! I'm using their preset hunger games gametype
I can jump in and change/update files
Which is what I've been doing
@eternal oxide it isnt printing the sys out and no errors
I know! It's wild!
no sysout means the event isn;t running
yea ik
ok, the error is you replacing the default worldgen then
oh didn't
no clue then if you get no debug message, your code isn;t running
the void still generates tho
maybe listener isnt active
void generating is seperate
Then maybe the main class isnt calling on the listner?
no
or the generator isnt calling on the lister?
public class BackroomsListener implements Listener {
Structure backroom;
Plugin plugin;
public BackroomsListener(Plugin plugin) {
this.plugin = plugin;
this.backroom = Bukkit.getStructureManager().loadStructure(new NamespacedKey(plugin, "backrooms"));
}
@EventHandler
public void BackroomsGenLoad (ChunkLoadEvent e){
if(e.isNewChunk()){
Bukkit.getScheduler().runTask(plugin, () -> {
Location loc = new Location(e.getWorld(), e.getChunk().getX() * 16, 40, e.getChunk().getZ() * 16);
backroom.place(loc, false, StructureRotation.NONE, Mirror.NONE, 0, 1, new Random());
System.out.println("Hi, this means that the code for structure placement works, sort of!");
});
}
}
}
move the debug up so it prints before you try to place, but still in the runnable
also add a debug at the start of the event to see if is even firing
now this is spigot dev
I've got nearly fatal amounts of caffeine running through my veins
sitting here, writing inventory code
quintessential spigot dev stuff
I need the text to start appearing only after the music starts playing. The music, in turn, plays when the resource packs are loaded and the download window is coming to an end. Is there some kind of transition operator?
not even from the beginning of the event?
Nop
then I'll need to see all your code with the debug in it too
The only thing I can think it because you are running at startup the listener can;t register properly
did he actually register the listener?
yes
?paste
Which is why the code is designed to run on its own world not on world
and we're sure these are new chunks?
