#help-development
1 messages · Page 348 of 1
Server thread/[ERROR] Could not pass event PlayerInteractEvent to BaronSMPM v1.0-SNAPSHOT the error
There is more than that
Server thread/[ERROR] Could not pass event PlayerInteractEvent to BaronSMPM v1.0-SNAPSHOT
It's not, read under that
wdym with collide?
block.getState().getMetadata("chest-last-opener") is null
what should i do\
hashCode can collide?
there are more strings possible than ints
wait nvm
ah english moment
therefore different strings must have the same hash
well do something if it is null?
i.e. when there is no such metadata
e.g. take the strings {a, aa, ...} up until 2^32+1 a'se
i opened the chest
and still problem
a 32 bit int can only represent 2^32 different values
therefore at least one of those string's hashes must be duplicate
also there is this error Server thread/[ERROR] Could not pass event PlayerInteractEvent to MPATSARIA v1.0-SNAPSHOT
hmm good to know
for the last time that is not the error
The thing below that - which we call stacktrace - is the error
hashcode is a hash function, but kinda weak one compared to bcrypt or sha
And without stacktraces we are basically guessing what is happening
Can anybody spot a logic-problem in this little algorithm? I'm having a byte-array of RGBA values, which I want to transform in-place to an RGB array, so just remove all alpha bytes. I'm basically pulling the rgb-groups "forward", copying them into the alpha slots, then moving to the end of that group and repeating.
The resulting image looks okay, I'm just having some small pixel sized artifacts. Wondering whether they are due to color approximations. Another opinion would be very much appreciated.
can u make the code and send it please
not only kinda but MASSIVELY
i cant understund im a new coder
TH <yjetöbpoznrxuivölmkolszmödb,u8bl,tz
?
Exception in thread "main" java.lang.IllegalStateException: Broken mixin: de/geolykt/starloader/micromixin/test/j8/mixin/erronous/TooManyAtMixin (attached via null)
at de.geolykt.micromixin.MixinTransformer.addMixin(MixinTransformer.java:76)
at de.geolykt.starloader.micromixin.MixinMerger.main(MixinMerger.java:145)
Caused by: de.geolykt.micromixin.internal.MixinParseException: Unimplemented key in @Inject: method
at de.geolykt.micromixin.internal.annotation.MixinInjectAnnotation.parse(MixinInjectAnnotation.java:72)
at de.geolykt.micromixin.internal.MixinMethodStub.parse(MixinMethodStub.java:38)
at de.geolykt.micromixin.internal.MixinStub.parse(MixinStub.java:37)
at de.geolykt.micromixin.MixinTransformer.addMixin(MixinTransformer.java:59)
... 1 more
A stacktrace looks kinda like this
you can crack sha with the modern hardware under an hour or so, imagine how easy would it be to crack hashcodes if you can generate them easily 😄
Without stacktrace we might as well roll the dice
what is
init {
}
from kotlin in java?
Chances are you can easily compute a possible string with a given hashcode
Basically constructor
static {}
geol i send u
No, it's for instance
ohh
As primary constructor is embedded into class name
Vaggos22 not wondering to be rude, but you must first learn the lang were you are coding and then i would suggest start using libraries or apis. Its just a personal recommendation from my bad experiences i had had
kotlin moment
so what does init exactly represend?
now only if it were to actually work...
Hello, I'm getting an error but even when I use try catch the message is still getting displayed, does anyone know what I'm doing wrong? ```public void rotateSkull(final Skull skull, final BlockFace blockFace) {
if (MinecraftVersion.atLeast(MinecraftVersion.V.v1_8))
return;
try {
//final Rotatable skullRotation = (Rotatable) skull.getBlockData();
final Directional skullRotation = (Directional) skull.getBlockData();
skullRotation.setFacing(blockFace);
skull.setBlockData(skullRotation);
} catch (final NoClassDefFoundError t) {
skull.setRotation(blockFace);
}
skull.update(true);
}```The error that is getting displayed: https://pastebin.com/9gQPLsK2
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
remove the / from the end
but how to
So basically
public ClassName() {
}
then it's {}
oh alr ty very much
I would first learn fully Java, the most important concept
Not really, it's used for code that should run with primary constructor
I.e.
class X {
{ /* CODE */ }
}
@vivid hill
what is the primary constructor?
i know java i mean algorithms
and graphics
i know how it works
oh right, my bad i just got confused because you said you didnt know what was a stracktrace
public class ClassName(val name: String) {
Var foo: Boolean
}
Basically embedded into class declaration
record
Yeah smth like that
so basically a constructor that will get invoked no matter what?
laughs at Boolean
stracktrace i dont know what is it
In that case {} is the right approach
this stuff
if you want the code to always run on init{ } yeah
that's because your entire log is a stacktrace
Hi guys, I come back again looking for help for my 1.8.8 spigot plugin (yes 1.8.8).
After finishing all the plugin, I have some graphical bugs, and I can't solve this issue. When I'm trying to move an item in my inventory, at the moment when I'm closing my inventory, the item goes back to his first position. I tried to handle this with InventoryMoveItemEvent, InventoryDragItemEvent, InventoryOpenEvent and InventoryCloseEvent by adding "player.updateinventory(), but it doesn't solve the problem.
Can you help me ?
using a stick
Basically it means that block.getState().getMetadata("chest-last-opener").get(0) is an invalid operation as there is no such item 0 @dire bluff
so i must make it?
help
most likely because there is no such metadata
ok needs data
if you think that it is needed, yes.
Please if you want to do that, its better to open a thread
where
is the issue clientside or serverside or both?
I think it's more clientside, but I don't really know how to find it
can someone help me on dms by screenshots so i can fully understund what to do
Yes. You are VERY annoying
Im really seeing that main java knowndledges are missing, maybe im wrong
i am i understund
I'd normally want a video, but that might be a bit complicated for you...
Happens to me today, its was really anoyying, i couldnt be able to fix it with just a machine reboot
wait, i'll try, i'm coming soon
Also, does the issue happen when you calls directly Player#openInventory()
Some times the Player#closeInventory() and then calling Player#openInventory() can bug the items cursor, is not related but its something extra
I don't call anything, it's the event when a player is trying to moving an item in his inventory
oh, its allow them to move the items right?
yep
Are you sure you want to proceed? You WILL need to give them actually working code - they won't figure it out themselves
idc? What lang is this 🤔
player.sendMessage("This chest was last opened by " + block.getState().getMetadata("chest-last-opener").get(0).asString());
I don't care
https://paste.md-5.net/tunejeyebo.java this is all the code
You are trying to access to a metadata, which doesnt exists on the item
No, he doesnt set it from what i saw
just tell the user there isnt metadata or smth
i tryed my best
working 3 days :PPPPP
tried
this is i want to get a stick named MPATSOS so i can check it with that
man been trying for 3 days to send the user a message there is no such metadata
Hum... I tried to make the bug again, and I don't know how or why there's no bug anymore ? Maybe because I used ngrok ? (ths bug was here since one week I really don't understand 😭), thank you all @sterile token and @quiet ice and sorry for disturbing
Sounds like an edge-case to me, wouldn't be so sure about the bug being gone, :-:
guys i dont know what to do i think im fking trash
legit
i just spend like 3 hours x3 days no reason
Yep, maybe, but I really tried all things that bugged before, and now it doesn't bug anymore, so I hope it will continue that way !
whatever
fkjdfgnkjfdnhdks
my friend opened teh chest
that must set metadata
right?
but still
im trying like 2 monmths \
this is my first try by myself
i want to make it /mpatsos
check if label.equals("mpatsos") then
Alrighty, but if it comes up again, don't hesitate to ask ahead. And don't listen to those 1.8 haters, xD.
ok have u got smth to suggest me
its the alias being used
cmd.getName() refer to the actual command name
its the same if theres no alias
Thank you, I will, and yes I try to stay focus on my 1.8 project, event if all the french community is mad against me (french people are weird guys)
Not only the french community is like that, believe me, lol
some video
i wanna learn
i just need to learn i listen to all of u
can KodySimpson help
suggest me someone
if possible send me a link
so
a site?
how is watching video easier then reading ?
relaxing
it like takes 2x time
bivieh is the goat 🫡
i use intelliJ
I think that coding tutorial are not really good, i think the way for going is to learn the main concepts, how to create commands and events, listen to events, scheduling, config files, basic plugin structure. And then most of the api you will learn it by coding and making small plugins
The most efficient way would be to learn coding through a game IMO, something like shenzhen io, but for bukkit, haha
Agree
I prefer taking hours reading, rather watching videos
i think i will start next year because i finish school and go to college
Valid yes, but not equally efficient. It hugely depends on the type of personality, but still, games tend to provide the fastest progress, as they're interactive and present the topic in a fun- instead of a dry and boring way.
stop playing with pets and start studying son
In a few words you have said it all
There amazing and free books about Java
I was told since I was a child that those who do not learn it is because they really do not want to, because there are many options without money
I just search the dependency via artifact on google, something like Maven dependency <artifact-id> and then you can see the latest and old version/s
You probably need to use a custom maven repo
That being said I am not sure whether you can use DFU like that in spigot world
I know that Paper's ItemStack#toByteArray (or somethin like that) goes through DFU though
At worst use Bukkit's BukkitObjectOutputStream and BukkitObjectInputStream to serialize itemstacks under spigot
with the warning that they may break at any point in time if you go between minecraft versions
Hello again guys, I'm just wondering why do my Merchants don't spawn when I'm starting my local server, but only after a reload ? (I receive messages in my console when they are supposed to spawn, but they don't spawn), did you see that before ?
is it night perchance?
exactly
then they will be invisible
but why after a reload they are visible ?
minecraft being bugged I guess
What is the best way to keep track of amount of a block in a chunck
I would keep their location
I want to track player heads
Arent heads, something like items?
Idk it gets placed it gets removed
I dont want to do a for loop each time
For 65k blocks
So the only way a block is placed is on playerblockplace but the block being removed, what are the possible events?
hey, how can i spawn BlockCrack particle ? This doesn't work for me java Main.world.spawnParticle(Particle.BLOCK_CRACK, a, 5,0,random.nextDouble(0.6),0, Material.BLUE_STAINED_GLASS.getData());
what is a?
location
What do you mean doesnt work, its a really open term
For this type of things you can use the javadocs for the version you are coding*
i already tryed to find something but all things on the spigot page didn't help actually
But if you want to know what params a method have, you can check the docs
what version are you on?
1.19
have you tried Material.BLUE_STAINED_GLASS.createBlockData()?
🫡
when I am changing the drops from a player that died, is it safe to set the amount to 0 to remove it ?
public void SaveReSource(String SourceFileName, String FileName) throws IOException {
if(plugin.getResource(SourceFileName) != null ) {
InputStream Stream = plugin.getResource(SourceFileName);
byte[] buffer = Stream.readAllBytes();
CreateFile(FileName);
OutputStream outStream = new FileOutputStream(File(FileName));
outStream.write(buffer);
outStream.close();
}
}
or does that create weird air items
or , how else would I remove certain drops from that event
talking about my code?
yeah
yeah, Resource is 1 word
any better name?
and methods names should start without capitals
saveResource
Simplify to: Files#copy(inputStream, outputFile)
try it i guess, but i doubt it will make weird air items
event.getDrops().clear() might be better though, but i havent tested that
Thanks!
I just made it up on the spot with no experience with Streams
I dont want it cleared
I just want to remove a few items based on their pdc contents
na its okay, i just remmeber i used to use that method
you can probably just set the amount to 0
ah then yeah just do that
hey guys what particle is red because REDSTONE doesnt work for some reason
redstone can be colored
or well, redstone dust I mean
You can have blue redstone particles I am fairly sure
Although I think it's just called dust
is it possible to store an item in nbt?
you probably can store it as a byte array
not really
the client will probably limit it to 256^3 possible colors again
plus lighting and shadows and you have more like 245^3 colors
wait how do i do a blood lookalike particle?
you mean Particle.REDSTONE_DUST?
like 1.19.3
does it exist?
it doesnt work
like nothing shows up
yes
intellij
hello. i am new to plugin development and i have a question: Is it possible to create like the command argument title? Not like tab completion but just a suggestion what you should put to that argument. For example when you type /say message above the argument will pop up text <message>. Thanks for any help 🙂
the line of code is
event.getPlayer().getWorld().spawnParticles(Particle.REDSTONE,event.getPlayer().getLocation(),10);
brigadier
that
is not what i corpied
and it doesnt work
wow that was quicker than i expected! Thanks!
in 1.8.8
event.getPlayer().getWorld().spawnParticle()
doesnt show up
how do i spawn particles in 1.8.8
help.
Too old! (Click the link to get the exact time)
World#playEffect maybe? after that you're on your own
no but i need it in 1.8.8 cuz the REDSTONE particle doesnt work in 1.19.3
?
cuz the REDSTONE particle doesnt work for some reason
ye lol
has any of you guys ever made money with mc coding??
yep
how?
sold spigot pl0ugins>
?
oh ok
wat about fivver?
ye i think its a long procces to register
is 5$ a lot for a custom plugin?
depends on the size and amount of effort required
tbh idk like custom items and stuff
ok
yea
yes but i guess it would also be hard to get people to buy it even for 5$
how old r u btw?
oh ok
any body know why they teach all the functions and sh** in school like has anyone here ever used calculus to do smth?
yes
yes
when??
spigot plugin development already gets you into it
wdym how does
y = ln(ae^x)
find the maximum and minum
ever helped you guys?
Wow, that is very narrow thinking. It's not about "when do I need xyz", but it's more about developing an intuition for mathematical concepts.
you arent going to use everything they taught at school but when a situation comes up and you need to do something like trigonometry or vector math, you'll be grateful you were taught it
Looks like stuff i got on my exam
Maybe the reason why i failed it
Is the player.spawnParticle method threadsafe?
I was trying to send packets with ProtocolLib but it seems that there are issues with its outgoing packet system for particle packets.
com.comphenix.protocol.reflect.FieldAccessException: Field index out of bounds. (Index: 4, Size: 4)
at com.comphenix.protocol.reflect.StructureModifier.writeInternal(StructureModifier.java:371) ~[?:?]
at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:347) ~[?:?]
at com.comphenix.packetwrapper.WrapperPlayServerWorldParticles.setOffsetY(WrapperPlayServerWorldParticles.java:155) ~[?:?]
at co.lotc.aesopianproject.commands.PacketHandling.sendFakeParticle(PacketHandling.java:251) ~[?:?]
at co.lotc.aesopianproject.commands.GaelBoltCommand$1.run(GaelBoltCommand.java:33) ~[?:?]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.16.5.jar:git-Airplane-11]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:485) ~[patched_1.16.5.jar:git-Airplane-11]
at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1489) ~[patched_1.16.5.jar:git-Airplane-11]
at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:439) ~[patched_1.16.5.jar:git-Airplane-11]
at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1402) ~[patched_1.16.5.jar:git-Airplane-11]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1134) ~[patched_1.16.5.jar:git-Airplane-11]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:292) ~[patched_1.16.5.jar:git-Airplane-11]
at java.lang.Thread.run(Thread.java:832) [?:?]```
index out of bounds for some reason
@eternal oxide yeah i know
but the bigger issue it seems like is protocollib is doing that, not me
i can circumvent this, though: Is the player.spawnParticle method threadsafe? if i can call it from an asynchronous task thats fine
nothing in Bukkit is threadsafe.
Packets can be sent Async but no idea if ProtocolLib is threadsafe
yeah
like i said im trying to send packets but protocollib
is effing up my particles
its fine
ill figure it out
hey is there any way to change the value of the burn time in a furnace of an allready existing fuel (1.19.3) e.g. changing the default coal burn time from 1600 ticks to 2000 ticks?
hello all, im using ultimate kits on my factions server. i need help the kits i have do not show up when doing /kits?
however when i /kit {kit name} i recieve the kit
any ideas?
^^
my bad x
all good
what?
and because I set it to rotate based on a time, (speed) of course there are some things to be fixed yet, and therefore outside the 20 ticks thread
i update the rotation with the base on the previous time so it gets bad
ig because thats how a compass works
a brilliant idea of solving a problem that would make it even worse for players with a greater ping
Should be i think
spawnParticle literally just sends a packet
it should be thread safe
the fact that the minecraft 1.8.8 is as old as a first grader makes me so old inside
i still remember beta 1.8 days
Okay, im having some troubles with redis. Its not opening the connection and i tried to try-catch the issue but it doesnt seem to throw any exception
Mainly just telling me that my JedisPool jedisPool is null when calling any redis command or while trying to use jedis pub/sub, which makes sense if the connction is not being opened
Does your jedis have a username and pass?
dw i alredy fixed that it was a dumb issue, i was doing sout for RedisPool#isClosed() and was returning false, so i thought the conection wasnt being opened. But that is already out, now im having the Jedis instance null i will have to check what happening new
That why i love coding spigot plugins, they are a box of prizes, every day a new surprise
not only that, we always got something new to do
Yeah, u ar totally right
Okay im tired so its momment to harcode it, to see what the fuck happens
I have 2 questions about the citizens API:
- do I have to place the citizens jar file in my spigot server in ordrer to work ?
- Is citizens API compatible with 1.19.3 java version ?
Yes and yes
do you have the jar file of citizens api ? I can't find it :/
how do I get the Minecraft server's total days online?
I already have some code but that doesn't spawn an npc:
NPCRegistry registry = CitizensAPI.getNPCRegistry();
NPC npc = registry.createNPC(EntityType.PLAYER, "npc test");
npc.spawn(Bukkit.getWorlds().get(0).getSpawnLocation());
What happens when you run that
Normally it spawn a base npc at the server spawn point, but it doesn't spawn anything, not event a log in command
I dont think is posbible to get that information via spigot
hmm
how does hypixel restart their servers every few days
thats what I was gonna do
ig I could just do it in a certain time
They jave some soft of timestamp which when its ends the time, just stop the sever or run an script (named as .bat or .sh (depends the paltform)) file
So any idea on why it doesn't spawn ? :/
Dont they have own support? Im not wrong
They do
yes, but they don't respond :/
Consequuences of using 3rd party apis 😬
That why most people laught at me when i said i dont like depending on 3rd parties, there you have the answer. Custom libraries != needing to wait for support 😂
Takes more time to write it yourself
Agree, but if they are well done then you wont have more problems, because your code, you update it when ever u want, fix the issues also you help other people to use your libs
idk they are just prefecenes
Are you sure you're looking in the right location. Teleport yourself to the same loc variable as the spawn method uses
ItemStack item = new ItemStack(Material.DIRT);
JsonObject JSON = json.getAsJsonObject();
JsonElement type = JSON.get("type".toString());
JsonElement amount = JSON.get("amount".asInt());
item.type = (Material.getMaterial(String.valueOf(type)));
item.amount = amount;
So i get some errors starting of at asInt and going further to item.type and item .amount
Also, dont get spawn world
JSON.get("amount").asInt() its goes outside the parsing/conversio - That in case of using Gson
alright ty
Np, just for help
I generally use 3rd party libraries but sometimes I am forced to replace them as they aren't great.
And boy, rewriting humongous libraries isn't fun at all.
Yes i agree with that, for example, actually i spent 3 weeks writing a menu api which i havent finish. But once its done i will skip lot of headaches
I did this code and doesn't work. No errors, no logs, no npc:
NPCRegistry registry = CitizensAPI.getNPCRegistry();
NPC npc = registry.createNPC(EntityType.PLAYER, "npc test");
World world=Bukkit.getWorlds().get(0);
Location loc=new Location(world,-41,200,-120);
npc.spawn(loc);
is citizens enabled?
Check if you can spawn without using their api (via citizens cmds)
how do I do that ?
/npc is the main cmd if im not wrong
Again teleport yourself to that location using code
So you know you're in the right world
Oh right that makes sense olivo maybe are in diff worlds
wait I have to put the citizens jar file in my spigot local server even thought I have the dependency in my IDE ?
ofc. how would the plugin know you are using it?
ok, I don't have the jar file lmaooo
💀 now everything makes sense
let me create a spigot account and dl it
Yeah ofc it wont work
Because the api will probably trying to get the citizens plugin instance which is null, so its just doesnt do anything
Which is not a good design tho, because if the citizens plugin is not enabled. Atleast the api should throw an exception telling you that he cannot get the citizens plugin instance
where can I have the jar file for spigot ? It says that I do not have permition to view the page :/
You probably want to grab it from their ci page since the spigot one costs
oh
ci?
You need to be logged in to see it
I am logged in lmao
What is ci?
open the site again on new page, sometimes get bugged happened to me
continuous integration
oh right, but what have that?
🤔
I know what its but why will he grabe it from there
because the CI is used to build stuff
it works like a charm, thank you guys for all the help 😄
But arent they not public, i mean just used for coding phase
no..
wut coding phase
org.bukkit.command.CommandException: Unhandled exception executing command 'givesword' in plugin FoolingAround v19.0.2
what does this mean
Send full stracktrace please
ok
?paste
Send it using that site please
In my case my ci/cd are in setup in the repo but you pickup the latest(s) jar version from the releases area
just send all the lines below org.bukkit.command.CommandException: Unhandled exception executing command 'givesword' in plugin FoolingAround v19.0.2
ok
Hmn okay, let start from begining have you learnt basics java? Because you mustnt be coding without knowing the lang where you code - Not wondering to sound rude, just say it from personal experiences i have had in the past caused of that
I have some knowledge of java I just forget alot💀
Okay, so that is no the way for going
I would refresh first all the java knowledge and then yes try using apis or libraries
Its just an advice you can take it or not
ok ima read all my notes
I would start reading the most basic things
ye
found problem
if (cmd.getName().equalsIgnoreCase("give-sworsd")) {
sworsd lol
ye
Can any one help me in dms with code? Im cinda new and ive been trying for ever to get a code to work. Need some one that knows java cinda well.
When converting from Kotlin to Java do I still need the ::class.java thing from WarpItem::class.java ?
@vivid hill ur question makes little sense.
Though that is the equivelent of getClass in javs on WarpItem @vivid hill
90% answers here is "Learn Java", but that dosnt help, cuz it is boring doing regular java. I learn from trial and error and minecraft makes it so much more fun and is the only reason i can even spend hours trying to do few lines is bc mc makes it so much more fun when something works rather than just numbers on console.
But ok. I have commands set up /maps create <name> - creates a map/hash map key
/maps addspawn <map name> - adds a value to the hash map key
and so on
Ok, so i have /maps join. Which is supposed to send the player to a random element out of the current active map/hash map key.
all that is fine, but i cannot figure out how to make it so every 5 minutes the active map switches
So i need it to do:
every 5 minutes
set currentMap to random key out of all the keys (random map out of all maps)
and then make it so when ever player does /maps join it sends them to a random spawnlocation that is saved inside of the maps name.
Maps name = hash map key
keys content = all of the spawn locations inside of that specific key/map
How is the map made.
You can have a repeating scheduler that sets the current map to a random map.
/maps create <name>
?
how would i make a scheduler that repeats and how do i make it so the veriable updates. Where do i put the scheduler, in the same class as the command that creates the maps and sends players to them?
?nocode
?
I got an issue I've never encountered before.
This simple event listener, actually doesn't cancel, the moment I cancel this event listener, console gets spammed at an incredible speed "NATURAL"
public void onCreatureSpawn(CreatureSpawnEvent e){
e.setCancelled(true);
System.out.println(e.getSpawnReason());
if(1 == 1)return;
}
well it actually does cancel, but it starts spamming the event
@lethal knoll The server wants to spawn creatures, you canceling just make it try to spawn somewhere else.
But this was not an issue before :/
Maybe you had enough creatures in the world then.
I can't believe that, the result of what I had in code didn't change, the only difference is that the world get's spammed
Maybe paper is causing this?
or an unstable version?
Well thats why i dont ask here
@worldly ingot tell him i’m right or smth
learn java
It's not that I tell you are wrong, I only tell you that this didn't use to be an issue at all
Also
something else
when I cancel the event, another mob is spawned by me
and the fun fact
The spawn reason is still natural
You asked a development question without including relevant code expecting us to simply guess how you are doing everything. I gave you a generel pointer to how to do stuff. Googling would have shown you how to make a tasktimer using the scheduler.
Fun event lol
so even though it's spawned by me using the API, it doesn't say spawn reason CUSTOM
it's always Natural
The general pointer you gave me was just repeating what i said basicly. The thing is that there is no code other than the commands that set the keys. The question was detailed as much as possible to explain the issue and the issue isnt even about the commands, it was asking how to do a specific task
I see
It most certainly was not detailed as much as possible. You asked a question, yes, but you asked it with so little substance and context that we literally cannot answer it without guessing lol
?cba
Jan Tuck#0142 definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.
I read your question three times and I really don't know what your goal is
in my listener file, how can I use several methods that are in my main class?
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Ikr, I first wanted to see how he made the hashmap etc, to see if he used a POJO for his values and then ask about that. Then I’d be interested in seeing how and what he is setting in this map, and how he is attempting to call it the join subcommanf.
Then what did you not understand?
What part you want me to clerify?
Of the commands?
I don't think that's it
Goal
first screen my listener, and on second my main class
but I can't call itemWithUuid, why?
I guess you already have a currentMap variable
All you need to do
Is update that
Every 5 minutes
so every time I have to use Flyheads? can't I do it cleaner?
With a tasktimer
Am i allowed to paste the 90 line command code in here even?
?paste
and you could explain me simply the difference between "public" and "public static" ?
https://paste.md-5.net/rocepigonu.cs
List<Location> currentMap = mapSpawnLocations.get(new Random().nextInt(mapSpawnLocations.size()));
This line updates it, how do i make it update every 5 minutes using scheduler so that the veriable can be used outside of the scheduler
Change the scope of the variable.
Nvm checked the paste
Either create a getter and setter, then use those to set it in a tasktimer you start. Remember to pass an instance of your “single” Maps class.
EntityDeathEvent = e.g when a mob dies?
All entities, mobs included
My issue solved, as expected, a broken server version causing the issue
Bukkit.getScheduler().runTaskTimer(this, new Runnable() {
@Override
public void run() {
List<Location> currentMap = mapSpawnLocations.get(new Random().nextInt(mapSpawnLocations.size()));
}
}, 20, 20);```
Errors:
I see.
But thank you for the help
There is quite a few things wrong here. Obvious scoping issue, obvious extra parenthesis, maybe obvious extra scoping issue/dependency issue.
if I kill a mob, I'm supposed to get the "drop" message, right?
Sure or a nullpointer error
I don't have any of that... yet I registered the event in the onEnable method
no @EventHandler
FUCK

https://github.com/EthanGarey/BetterTeleports
https://paste.md-5.net/migocotore.pl
I keep getting this error message when I reload, its been around- 2 hours? I cant figure this out.
And this error message only happends on linux machines
it doesnt happen on windows
(Minehut is linux)
this hurts icl
return translate.replace('&','§');
its error on that
the translate stuff is null
yeah i know that but idk why its null
again it works on my windows device
not minehut
there is another way to create a head of a mob than having to go through skins sites?
are you compiling with utf8
check that the message actually exists in the config
im gonna take a guess that its an issue with the hundreds of Objects.requireNonNull
that should be used in apis, or libraries, not in this usecase
Such as betterserver & betterchatcolor
you made me curious and i looked at the code, my eyes
Any one know a fix for this?
remove the extra closing parenthesis
.
allready did
same errors
Bukkit.getScheduler().runTaskTimer(this, new Runnable() {
@Override
public void run() {
List<Location> currentMap = mapSpawnLocations.get(new Random().nextInt(mapSpawnLocations.size()));
}
}, 20, 20);```
New code:
same errors
remove the ;
,*
Bukkit.getScheduler().runTaskTimer(this, new Runnable() {
@Override
public void run() {
List<Location> currentMap = mapSpawnLocations.get(new Random().nextInt(mapSpawnLocations.size()));
}
}(// ->,) 20, 20);
that comma is correct
it is?
well still any idea on my plugin?
there is most likely a npe not being found
because you require not null or add empty strings
any idea?
which mobs
i think he means like player names
passive/hostile, vanilla mobs
Needs to be placed within the correct scope.
?paste the full class
public class Maps implements CommandExecutor {
HashMap<String, List<Location>> mapSpawnLocations = new HashMap<>();
List<Location> currentMap = mapSpawnLocations.get(new Random().nextInt(mapSpawnLocations.size()));
Bukkit.getScheduler().runTaskTimer(this, new Runnable() {
@Override
public void run() {
List<Location> currentMap = mapSpawnLocations.get(new Random().nextInt(mapSpawnLocations.size()));
}
}, 20, 20);
its not in a method
rousty add a }
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
brah
stuff has to be in methods
ebicpipic
well can you atleast help me with my plugni?
yo
remove the countless Objects.requireNonNull or blank strings from it, then test again
Lmao im really tired of seeing people who dont fully learn java
I mean what the problem, you must learn Java
The same happen when you expact to make a delicious cake following and amazing recipe, but you never cooked before its obviously it wont be like the recipe
you can make a good cake without having made it before just fine
just follow recipe
in this case theyre eating the recipe instead of following it
it doesnt make sense, you must learn basic cooking first
hi?
ther might be some stuff
give me 2 minutes
I tried that but it didnt do shit
your best bet is to learn java
you were the one trying to figure it out 💀
So according to what you say, why is it that when you go to get your license to drive a car for the first time, they ask you to have previously attended driving lessons and on top of that they test you before giving you your license. Exactly applies to the program
1 look at that code and its quite obvious
no suitable method found for runTaskTimer(me.roustytousty.moul.Maps,<anonymous java.lang.Runnable>,int,int)
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
just checked, i dont think there is a better way other than finding textures for them
wait until you find the map.get(0) + ""
he used every auto-correction the ide gave him 💀
Then where do i put the code? in the main class?
you pass an instance to that class
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Yea what if you were wrong he first time
make sure true is true and false is false aswell
Thisss
How do i pass the instance?
new AnotherClass().doSomething(this); in main class?
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
you forgot me picpicebic 🥹
this.getServer().getPluginManager().registerEvents(new Maps(),this);
Added this, still the error
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
i replied to my message earlier, i cant find anything online ther might be a few mob heads as materials but other than that you would need the texture
oh dear, I missed it, thanks for looking!
the texture in other words via a skin right?
can be via a skin, can be a texture like 621197e53c1ab112e68079d3c83fa4714c77a83d0621a29d762e99e9feaae4d5
mainly on custom heads
ok ty
If i put the startTaskTimer in main class. How am gona update the veriable in the other class. Ill try tho
for the love of god learn java
yeah the veriable dosnt go thru
do you have a matching constructor
Learn Java
I've provided links that explain di and links to learn Java with
Why not just return true 💀
Boolean intToBoolean(int x) throws IllegalArgumentException {
switch (x) {
case 0:
return Boolean.FALSE;
case 1:
return Boolean.TRUE;
default:
throw new IllegalArgumentException("Invalid integer value for boolean conversion: " + x);
}
}
Check for -1 incase they made a typo
Yea true
Boolean intToBoolean(int x, int threshold) throws IllegalArgumentException {
if (x < 0 || x > 100) {
throw new IllegalArgumentException("Invalid integer value outside range [0, 100]: " + x);
}
boolean y;
if (x >= threshold) {
y = true;
} else {
y = false;
}
// Log the conversion result for auditing purposes
logConversion(x, y);
return y;
}
private void logConversion(int x, boolean y) {
System.out.println("Converted int " + x + " to boolean " + y);
}
anyone know if its possible to like set a default path for a FileConfiguration, ive checked the base stuff and options but cant seem to find anything
what
set a config section to be the default
Sorry, but idk what constructur is.
would it be like this:
mapSpawnLocations = new ArrayList<>();
}```
But if so problem with this would be that it sets a new empty veriable?
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
please
are you trolling?
new ClassName(this)
---
private final JavaPlugin plugin;
public ClassName(JavaPlugin plugin) {
this.plugin = plugin;
}
that looks like the nbt data for /give commands
its probably used in a plugin somewhere so they can have all the heads
what does nbt mean?
I'm going to use this, it saves me the trouble of searching for the skins on the sites myself lol
its pretty much how a lot of stuff works on items
Anyone know how to setup proguard in spigot plug-in
😬 🤔
is it that time of the year already
that time where we get the mass influx of new people joining asking about obfuscation again
i think were at 3 so far
its like every year almost around the same time
you know what it is
its the people that spend the past 2 months on their computers learning to code
now want to sell stuff but dont want it stolen
Lol, either that or this lines up with some schools and possibly have a class on programming or related and this is about the time where they get into obfuscation or something
and thus the kids are like, wait I can apply this to spigot
I swear we share braincells
too early into a school year imo
in the US this is late
i just realised how late in were are
school year ends in like June, starts in August
wtf
ends july, starts september here
school year ends mid june here
and starts mid september
or well, if you're an idiot intern like me
lol
mid july to like october
I caught covid and they forced me to be an intern for an extra week >:/
Lol, yeah basically this some school teacher who probably also likes obfuscation got to their favorite part XD
could be
do y'all actually know any spigot devs irl?
or is it just me
because like
what if all these people are from the same school
or follow the same program
lol
you think i know people irl?
I do know some devs IRL
well
not specifically spigot
I guess it's kinda cheating when the spigot dev I know IRL is like my best friend and I kinda forced him to be my assistant

lmao
yo. any idea why Player#sendBlockChange(25 blocks) halves the FPS of the client? Could it be that some serverside thing is slowing it down?
probably because it sends a few different packets for it
are you sending a multi-block change?
yes
doesn't need to
declaration: package: org.bukkit.entity, interface: Player
just set the boolean to true
Did anyone else play around with BarFlag.PLAY_BOSS_MUSIC ? I never get that flag actually playing music
@wet breach I do not use BlockStates
depends how you are doing it
you would create a boss bar that has that flag set
Yup, that's exactly what I do, but I never got the music playing. The only difference is that I use setVisible to make it visible afterwards
You actually got it working before?
then that might be the cause for it
don't think if its invisible music will play on the client
No true, but you have to call setVisible first anyway before it becomes visible no?
BossBar bossBar = Bukkit.createBossBar("Bloodmoon", BarColor.RED, BarStyle.SOLID);
Bloodmoon bloodmoon = new Bloodmoon(world, bossBar);
bloodmoon.getBossBar().addFlag(BarFlag.CREATE_FOG);
bloodmoon.getBossBar().addFlag(BarFlag.DARKEN_SKY);
bloodmoon.getBossBar().addFlag(BarFlag.PLAY_BOSS_MUSIC);
that's all
and a setVisible
everything works, except the music
not too much of an issue tbh, I was just very curious as I never got it working
instead of just adding flags
how about include the flags as a list
when creating the bossbar
hewwo frostiboi
hmm
howdy
if you say howdy, I cant help it but imagine you with a cowboy hat, shouting YEEHAW at others
I hate the minecraft client
why is that? :p
maybe it doesnt like you either
no bro you can't tell me that this garbage is halving its FPS when I send 25 blocks to it
it made no difference
I think it's safe to say that this is broken
Yeah, true
as there is another api method for that
I am just curious why this flag never worked
it probably did, and something in mojang code probably broke it
Yeah must be
?jira
can always report it too 🙂
Yeah, will do
or just instantly PR it yourself, that'd probably be faster
Not sure if I would be able to fix it as I never look into NMS
but I could give it a shot
Only not now
what exactly is the issue btw?
BarFlag.PLAY_BOSS_MUSIC is not working
But to be honest I tried this long time ago and then I also couldn't get it working
Also checked that, no Sound seems to be named boss music or something like that
Maybe it's the ENDER_DRAGON_AMBIENT
net.minecraft.world.BossBattle it is
it has a boolean field "playBossMusic"
spigot simply uses that
if it doesn't work, it's a vanilla issue
Well maybe it requires you to be involved into a boss battle
any ideas why sendBlockChange(25 blocks every tick) literally bully the client FPS to demolishion literally letting the FPS implode while halving it?
are you sure it's only 25 blocks?
there is Music_dragon
got a server so I could join and see if it also reks my FPS?
Yeah sound is running but doesn't sound like boss music tbh xd
lol
uhm no but I could port forward rq lol
It's actually sound to fall asleep hahaha
shit I forgot the password for dad's router LMAO
omg, @orchid gazelle , tell me if you consider this boss music LMAO
One of the new minecraft songs by C418!
C418
ping me when you're done
what's your routers model?
What would be the best way for delegating the redis pub/sub input to the outside of my library?
6591 Cable xd
Oh like a fritz?
yes
And I assume you don't want to change the existing password? :p
unfortunately all consumer routers suck ass, and not in the good way
ye xD
nah I know we changed it
make your dad believe that he forgot the password
I even set it up for the family, but forgot the pw that my dad chose lol
or that something went wrong
bro its literally 3:46am for me
my router's pw is merkelgabrielsteinmeiermaiziere
and work
I GOT IN LMAO
Reminds me of something. I had a chat with a webhost for a way too expensive invoice, then they asked me this
Hold on xd
whut lol
need to scratch something xd
ok 😄
holy shit I forgot how this works lmao
wtf
That is not supposed to be visible, even not the last 4 characters xd
are those the actual AVM people?!
wtf by no chance that's the real AVM support lol?
AVM?
that correct? @tender shard
this was a webhosting provider xd
that seems like a very shady company lol
Well, fun fact, they are one of the best rated web hosts out there
And to be fair, for their support yes, for price HELL no, for this? shady asf
@tender shard im done
shared webhosters in general suck
IP
IT's not xd
this is good music to lead up to the fight, oh btw you could always use a resource pack that replaces music too
dmed
I expected epic battle music 😄
yeah surprised the boss bar music isn't in there
maybe the client has that music specifically tied to the boss bar
try again
just not sure why the api for it is messed up
Yeah well, doesn't matter, if this is the music it's supposed to play then I really don't need it haha
how's it?
I expected epic battle music, not ambient sounds :p
100 FPS with vanilla on 2560x1440 (no sodium etc)
can't you see that its going down?
we love ghost blocks
1 sec
oh its not going down?
lemme try again on the laptop
why does it half my fps then? Hardware not even close to full load
what cpu you got
let me try that with my rtx 3090 :p
get out
love the ghost blocks btw
wdym? lol
its halfing tho
wdym
it began at 800
going to sleep now, good night
gn
those blocks that the client says are air
they arent really air
thats why alex got stuck
nah
doesnt matter whether I move or not. on 3456x2234 pixels it's still always at 300-350 fps
why tf is it halfing for me then?
no clue
gonna disable port again btw.
kk
how the fuck can an integrated gpu achieve >300fps on a resolution of 3456x2234 lol
wasn't there this "render diagram" in F3 that showed you which of the render tasks took how long?
or was that removed?
I need recomendations about delegating some data arrived from a redis listener, but i dont know any good way. Something like retriving the arrived in the redis listener into a listener or smth like that
I coded for 10 hours today lol
verano needs recommendations about delegating sme data arrived form a redis listener
yeah, because i cannot think any good idea so then i can retrive the data received by custom payload class
Use redis pub/sub
I know how it works, just need to find a good way for delegating the payload
Let me send smth code
But you need a structure to translate data to send it and then deserialize it?
Yes i alredy have that step
Ahh you wanna send code via pub/sub?
I already have the packet serialization/deserialization, just dont really know how to delegate the packet data
Is Packet a custom class?
Do know i explain what i was trying to do?
Yes, every custom payload extends it, keeps the serialization/deserialization to /from byte array
Then send the byte array with redis pub/sub?
No no you dont understand what i mean
Let me use the translator 1m cuz my english doesnt really allow me to explain
My English isn't the best either lol
Look, I have already designed everything as it is to send information through redis, I am using an abstract class called Packet (which has an int id and boolean queue), it is also in charge of serializing/deserializing to/from byte array. The thing is when I receive the payload in redis listener, I don't know which is the best option to use information, if to use an event system (like the one in spigot) or some better alternative.
No no
I already all the data processing
Just dont know how to code the way for retriving the data received
And you have a Packet-Object on the receiver-server?
You listen to the sub channel of redis and then turn it into a Payload
yes that is all done
Just missing the part for getting the payload data
What is the payload exactly?
Let me send code example
public class UserUpdate extends Packet {
private final UUID uuid;
public UserUpdate(UUID uuid) {
super(int[id], boolean[queue]);
}
// getters
// setters
}
This is exactly what i call a payload, and its what is transmited thru Redis (serialized to byte array)
That is where my question started
How i would get tthe data back and do some operations
You use your deserializer
Yes i know
To turn it back into an Object
And then just call the operations in the UserUpdate Object
Let say i already coded the serialization/deserialization, the obejct is already parsed etc, but what i do with that object, i dont know what i should do
What do you wanna do with it?
Yeah so then i think implementing something like event-driven or directly do it over in the packet class itself
That is where my question take palce
Which is the best option in this cases
What does UserUpdate update?
The packet impls will be just for the data transmissions
Yes
kind of obvious on that
But what exactly do you want to do with UserUpdate?