#help-development
1 messages Β· Page 524 of 1
bec.
if you cant even google you arent going to go anywhere with plugin dev
Never asked π
idc
thank you :)
now
stop telling me learn java damn
ask for help not for clowns β οΈ
throwback to when this happened
there is 1 person i know of here that will help you with basic stuff the rest of us wont
oh learning what is hashset
@fluid river I regret pinging someone else I blocked but like
I never asked π
all hope is lost
Block and move on
the blue sky is giving me troll vibes
i telling to immillusi
um
its 9 or 10am for Nukerfall
insteed of saying learn whole java for small error
It's 8am here
maybe tell me how get error?
10am in russia
you casted an instance to something it isnt
yep
Google is a great way to learn
so i try fix it rn
yep
the guyy say he blocked me then send link π
i sent you a link to fix it but you didnt understand it because you havent learnt java
oh i was reading it π
@karmic salmon https://www.w3schools.com/java/java_inheritance.asp This is what you need to read
oo I might actually learn from this
there's this handy button called "Show message"
throwback to this
yep but block means ignore
this learn java not casting π
watch the fuckin language, fucker
you are there asking about constructors
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.
Casting is basically java thing so learn java maybe ?
by fix errors or send links π
not by tell me learn java
if u learn the java u can figure out casting
^^
send other link
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
java not object it parts π
in 5 words you have created quite possibly the most unintelligible statement ever
cant wait for the "why does it work i copied it right of the wiki"
i Fucked ur mom
this.plugin just set this class to var called plugin
how to report people here for swearing
anyone knwos about how my script doesn't works when i click on the result item of the custom Anvil?
@EventHandler public void TeleportNameSetEvent(InventoryClickEvent event) { ItemMeta itemMeta = event.getCurrentItem().getItemMeta(); Bukkit.broadcastMessage(itemMeta.getLocalizedName()); if (event.getInventory().getType()==InventoryType.ANVIL) { AnvilInventory anvilInventory = (AnvilInventory) event.getClickedInventory(); if (itemMeta != null && itemMeta.getLocalizedName().equals("BasiCore.confirmNameButton")) { Bukkit.broadcastMessage("Rename button clicked!"); event.setCancelled(true); } } }
this works on other space except the result item slot of the custom anvil GUI

this.plugin refers to a class variable
its called psudo code
not by telling me learn java
fr
Learn java and no one would tell you to learn java
can confirm
π learned it
done
no you havent
stop telling me
No you didn't
i did
wait we were supposed to learn JAVA? shit... i learned Scala....
never asked about your opinian
I'm just wondering how old you are ?
okay how do i use reflection to find out if the server is using mockbukkit
Whatβs a java
you like 2
I never gave my opinion
anyone knwos about how my script doesn t
this plugins not java π
my god you are a literal child
mockbukkit is server not java
my what in brother christ
mockbukkit is coded in java
yes
just like spigot
i know
and funilly enough what your coding in
If a serious question, why not simply use regex on teh version?
java is diff learning plugins
plugins have other add-on things
and i learning it rn
doesnt have it in package, they just dont even have craftbukkit package anywher
So
to makea da plugin 1 must learna da java
java is different than plugins how
oh right the startup is different, thats very sad
java isn't plugins
oh mockbukkit is the server test/emulator thing?
plugins made by java
but plugins are java
yeah
ah never used it
but plugins have addon
wat
and i learning the add-on
plugins are the addon
@tender forge can we get The Blue Sky kicked or something, hes just a mega troll at this point
but u couldnt figure out casting an object for ur plugin?
ah no
you can't kick some one who try find help but other people tell him learn java damn
you are just a troll
still learning it
this
Plugins
not java
big diff
nope
casting is java mechanics
what r u here for again
not spigotapi
what was the original issue
i β Learning β
Actually a timeout has been applied in the past for those who refuse the advice given and annoy enough of the channel
to Object to your plugin π π π π π
"plugin"
litty plugin word there
he was trying to cast his command class to a plugin instance
They casted random things causing errors
hmm
you normally dont ever need to cast your plugin
You can not cast an Airplane to a Car
but they have wheels!
they are both Vehicles but they are not the same
but we need change this from player.setMetadata ("Starttrue", new FixedMetadataValue(this, uuid));
you need an instance of this
yep
which needs to be your plugin
you can fix it if you do something called reading
correct
so you need dependency injection, which you have already been told
can i read now in peace after i know what is problem
That told by you guys and the link you send π
this more simple than drinking water
EpicEbic is only one that don't block me until now π
how would you know if i blocked you already
i think winnipixie to
ah i check about me
if it set to nothing
means youi blocked me
if it set to like text or anythimg
means you still don't blocked me
i can't say winnipixie blocked me or not
you sent me a message request
bec she don't have about me
cant dm me if i blocked you
I'm all private. Only friends can DM me, and I have no friends π¦
oh
Nope, I have no one blocked
β οΈ
rip
i think only one is olivo and imllusion
blocked me
good good
they uiseless anyway
Bro
they being rude
lol they are good helpers.
Is your goal to get a ban ?
i could be rude too
no.
Well I'm here quite a lot π
they being rude ;/
I suggest you drop it then. Bans are probably approaching.
package com.example.exampleplugin;
import com.example.exampleplugin.somepkg.AnotherClassWoah;
import org.bukkit.plugin.java.JavaPlugin;
public class SomePlugin extends JavaPlugin {
@Override
public void onEnable() {
// do stuff
AnotherClassWoah woah = new AnotherClassWoah(this);
woah.doSomethingLol();
}
}```
```java
package com.example.exampleplugin.somepkg;
import com.example.exampleplugin.SomePlugin;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
public class AnotherClassWoah {
private final SomePlugin plugin;
public AnotherClassWoah(SomePlugin plugin) {
this.plugin = plugin;
}
public void doSomethingLol() {
Player player = Bukkit.getPlayerExact("winnpixie");
UUID uuid = UUID.randomUUID();
player.setMetadata("Starttrue", new FixedMetadataValue(this.plugin, uuid));
}
}``` why cast when u can pass!
rip
who could ban
eh bad
They are just fed up with talking to a brick wall
i never asked for the code
i asked for help
π
ok now this troll
me not want ban
ok bye now
you dont understand getting help, you only understand being given the code
System.out.println("you dont understand getting help, you only understand being given the code");
AuthorNagException: Nag author(s): '_Rolyn' of 'Discord' about the following: System.out usage

People here will give code to those they feel already know but just need a push. Or its something which really interests them. Everyone else gets taught.
this always references the Object you are currently in. You need Plugin not this
a lot of the time if you have a good attitude people will give you the code to do what you want even if your new and you arent just refusing to learn java after starting a plugin
π
just fixing the error you said :D
md can we ban him
Gm sir
hes been trolling for like an hour today and has done it before
ah no
it not troll
idk
i want code now
i think md_5 will read all chat anwyay
read the links you were given, and the examples, then go write it π
You are literally just trying to replace this with dependency injection
fr β οΈ
And please understand AT VERY VERY LEAST what are objects, instances and classes
bruh how i don't know what is objects and classes π
Learning Java π
then how i would even know to start plugin π
We can teach you it if you ask
π π π π π π π π π π π π π π π π π π π π π π π π π π π π π
true true i agree
this litty the problem
does this count as static aboos @echo basalt
It really is the problem. You don;t understand Objects, instances and inheritance
you guys don't want teach me the basics things this the problem so i say send links and i try saying what i understand from that link
We can't do a whole java course for you like that
If you actually asked to learn we would teach. When you ask for a fix because you don;t want to read is when there is a problem

it called "help"
teach me what is instances
um
just asking π€―
?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.
ok
oh
how does it feel
It's quite weird and you're not really following conventions
to get ?learnjava'd by md
ok i will check the link
all it took was md
you can't ignore md_5 π
so time check links
I'd rather make a wrapper class that does all the matching instead but that would also be quite weird
am i goiung crazy or does this nag not exist
maybe an enum with a predicate?
When you create a Class, that is an object, when you use that class new MyClass you are creating an instance of that class. You can have many instance of some Objects, but only one of others, like Plugin
maybe you should have that manor with people responding when you ask for help
:0
im looking on stash and i can not find anything abt not using a logger
https://discord.com/channels/690411863766466590/1110103425418534913
any one can help with this
i've learned java alreadyπ
can't you just guys tell me everythign you need is there damn
paper feature
thats on PAPER?
yeah
i couldve sworn ive seen it on spig
nope
ok cya now
there are other nags but souts are paper-specific
i found a startup param to disable it
yeah it's hidden
what other startup params are hiding from us
https://github.com/PaperMC/Paper/blob/master/patches/server/0659-Add-System.out-err-catcher.patch ill be damned
what does that do
you can disable it
it just like
removes comments from server.properties apparently
there are also others like bypass host check, debug entities, gameprofiles
you can controll all the server.properties stuff from startup cant you
you can specify it on startup and cant you have env vars
i remember asking chatgpt about it
server.properties has comments?
at the top iirc
ok time go paper discord server
autism be damned that boy can COMMENT
lmao what the fuck
I just looked at CraftBukkit#main
the fuck
actually this is paper
get autism'd
They'll be back
should we feel bad for paper
i like how they try to load minecraft classes
as if a plugin is going to shade the entirety of fucking Minecraft
just gave them a warning
No
cmd line
thank u
oh so that's how you set them
?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.
ty cafebabe
i like -DIReallyKnowWhatIAmDoingISwear
oo
?!!??!
you can specify external plugin jars
their discord has it back
oh
or what plugins folder you want to use
and the world container which is why Bukkit.getWorldContainer is a thing
F
nvm will stay here
they are
wtf happens when u run server with --demo enabled ... 
Ireallyknowwhatimdoingiswear is the only hidden one
it actually creates a demo world
ok i will ask here if all ways of fix error is done like bing ai google and links
which is hardcoded to this
u can specify the fucking max player count w program args?!?
you can specify an alternative plugins folder
don't see that anywhere
what is jfr
server id most likely a 1.19.4 thing
has an unused setter hmm
this mf is uploading other people's plugins on spigo
i think its for crash reports
link link
yeah crash reports
illusion when he accidentally joins vc
I flicked my mouse
i remember when this got banned
I'm down to vc but like
there's no point
in having a bunch of sweaty nerds at 9am going "yes hello
yes hello latematt here
so uhhhhh this is gonna sound like a strange question
no it wonβt
I am getting the following error
Caused by: java.lang.NoSuchMethodError: 'dev.selena.items.ItemMapperBuilder dev.selena.items.ItemMapperBuilder.skullSignature(java.lang.String)'
But when I open the jar file with JD GUI its there so its in the jar file
I had this issue once before and I don't know how I fixed it lol
Make sure you don't have two of the same plugin in your plugins folder
nope
restart the server fully
^
most likely 2 instances got loaded
and you decompiled the jar inside the plugins folder?
yep
Could you send the jar
can you disable playerdata from saving?
?paste the method dev.selena.items.ItemMapperBuilder.skullSignature(java.lang.String)
That should be a setting one of the ymls
thanks
method is legit just
public ItemMapperBuilder skullSignature(String signature) {
this.skullSignature = signature;
return this;
}
is that in the same code base as you are calling from?
do you have another plugin with an older version of that class loaded
Works thx :D
yes
well thats the problem
oh okay will try that out
have to relocate code if you want different versions
need a Player#report
oml thank you
lol
now I got a new thing to ask about (been about a year since I touched Skull texturing)
Why am I getting this when I try set the texture on GameProfile
[20:11:59 WARN]: java.lang.IllegalArgumentException: Can not set com.mojang.authlib.GameProfile field org.bukkit.craftbukkit.v1_8_R3.inventory.CraftMetaSkull.profile to dev.selena.libs.authlib.GameProfile
Code that yall probably gonna laugh about
private ItemStack getHead() {
ItemStack head = new ItemStack(Material.SKULL_ITEM, Amount, (short) 3);
SkullMeta headMeta = (SkullMeta) head.getItemMeta();
GameProfile profile = new GameProfile(UUID.randomUUID(), null);
profile.getProperties().put("textures", new Property("textures", Skull_Texture, Skull_Signature));
try {
Field profileField = headMeta.getClass().getDeclaredField("profile");
profileField.setAccessible(true);
profileField.set(headMeta, profile);
} catch (IllegalArgumentException | NoSuchFieldException | SecurityException | IllegalAccessException error) {
error.printStackTrace();
}
head.setItemMeta(headMeta);
return head;
}
It is saying this line is throwing the error
profileField.set(headMeta, profile);
oops
accidently shadowed it into the development API
okay well progress Im not getting the error but Im also not getting the texture
1.8 π
doubt it likes the name being null, or the signature
What version of spigot are you building for?
ok, just there is a simpler way with post 1.18.2 versions
1.8
oh π¦
Is Protocollib support given here?
development support is given here unless itβs (most probably) an actual issue with a plugin
ProtocolLib is popular enough that people know how to use it here
What?
So if you have any development questions just ask away
When you typed it was 10
Well it's an issue with my plugin. So I'm using ProtocolLib for spawning a few experience orbs in an PlayerMoveEvent. This is the code for it:
@EventHandler
public void onMove(PlayerMoveEvent event){
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
Player player = event.getPlayer();
Location location = player.getLocation();
PacketContainer packet = manager.createPacket(PacketType.Play.Server.SPAWN_ENTITY_EXPERIENCE_ORB);
packet.getIntegers().write(0, player.getEntityId());
packet.getDoubles().
write(0, location.getX()).
write(1, location.getY()).
write(2, location.getZ());
packet.getShorts().write(0, (short) 10);
manager.sendServerPacket(player, packet);
}
But I get this whenever I try to write the doubles:
Field index 0 is out of bounds for length 0
The integer writes fine, as in it doesn't give any error.
Sadly im busy as hell today
What version are you on
1.19.4
No freejavalessons today
Latest Spigot & ProtocolLib.
Alright so most likely
and I can't stress this enough
the wiki.vg impl isn't the nms impl that protocollib wraps
and if you look at the nms class
from what I remember, just use getEntityTypes.write
Wiki is probably too old for actual plugin
So the packet does not have shorts anymore
You mean #getEntityTypeModifier()?
something like that
just look at the nms packet class, look at the fields
that's what protocollib modifies
Where do I find the NMS packet class?
No
yeah thereβs no shorts
NMS is copyrighted
only 2 inta
Where do I find the sources? π
I'm an idiot
mreow
Oh.
So it needs the entity id, the location in X Y Z and the value.
But then again, my error would appear when writing the location, not the short.
wiki vg isn't wrong the data is sent as a short
It's just saved in an int variable named value
- looking at 1.19.2... waiting for 1.19.4 to build
Now whenever I send the value as a short, my player freezes and I can't do anything but disconnect.
Yeah you want the entity id to be unique
Duplicate entity ids could cause problems
It requires the ID of the player, does it not?
Oh actually
You might be right.
Cause setting it the same id as the player makes the player freeze and that.
Hmm
It works now
Ahaha
Thank you so much
Listen to the entity metadata packet
and remove the enchantments from the armor
That will remove the glint for other players
It won't remove the glint for the player wearing the armor
basically
To display armor on an entity
an Entity Metadata packet is sent from the server -> client
containing the armor data
You want to intercept that packet, modify the armor data to contain no enchantments
packets are quite simple when you get the hang of it <3
packets are like objects
a box of data labelled with an identifier
Except they're basically objects that get sent over a network
Here let's make a basic technical example
We'll have 2 packets, in theory:
- SendMessage (uuid, string), which sends a packet indicating a message
- Kick (uuid), which just kicks
real king <33
Let's say that SendMessage in our protocol has the id of 1
and Kick has the id of 2
Writing the packet would be something like
For sendmessage:
write(1) - packetid
write(uuid) - player id
write(message) - message
For kick
write(2) - packetid
write(uuid) - player id
this is an oversimplification, in reality you'd be writing the characters individually etc
from what I experience with protocollib, is that it has some issues with performance :D
I hate protocollib sometimes
fortunately, in regards to the packets the protocol is already created. Would be a bit different if no such thing existed π
fukinβ overhead
int id = readbyte
id = 1 -> message packet (read id, read text)
id = 2 -> kick packet (read id)
and then just handle logic
just showing some basic networking because what if you end up writing your own protocol in the future? good to know the basics
indeed
So yeah that's the basics of packets
Now, minecraft has a bunch of pre-defined packets
(specified in the protocol page at https://www.wiki.vg/Protocol/ )
if you had a custom client, you could make your own!
yes but this only works when you have a protocol established, I was merely commenting further on that what he is saying is an over simplification indeed. π
fake chunks :D
most common usage is fake entities. The advantage here is that only the client knows about it and not the server so the server uses less resource, but the exchange for that is forcing the client to use more resources which is alright in most cases
somewhat
I've been following along with the Spigot Plugin Development guide. I the guide makes you make a main plugin class. However, intellij already gives you a main class. I made another project and completely skipped the make a main plugin class step and just treated main how like main plugin class and it worked. So, why does the guide have you make a main plugin class?
in the case of MC, this is half true but only because the client dictates the data in some cases where it shouldn't
if the server was allowed to dictate everything or nearly everything, then server side anti cheats are not a problem π
Here's that one time I used protocollib wrappers to create fake entities
it was pain
lag bans are nothing new are still a thing in games today
most of the time you just get kicked
no β€οΈ
no
Player#sendBlockChange
anything client side is subject to be manipulated by the end user
not good if you want to prevent cheating π
you can inject whatever you want client side, but if the server was allowed to not trust the data from the client to begin with its a non-issue
again client side trusted data
its not derived from the server
better tickrate as in more tps?
Would mean all plugins have to run in less time aswell
why in less time if the tps is increased?
Because things run every tick. More ticks = shorter time for execution during each tick
20tps = 50ms per tick
40tps = 25ms per tick?
tps of 20 = 50ms. tps of 40 = 25ms
and you think your cpu runs that slow?
I never said the CPU is slow. I know most operations are done in microseconds. Yet still servers with a lot of entities or a lot of heavy plugins exceed the 50ms per tick. Reducing it would therefore make things worse
that is because it has limited space in 50ms, where as it would have more space when you increase the rate
Obviously we just need a packet to dynamically set the tick rate
But entities follow ticks. Therefore if you double the tickrate each entity would get ticked twice as much. If you exceed 50ms for ticking all entities why would it get better with 25ms ticks?
As in not sending more updates to the player but still making the server tick faster?
Nah just pick the highest tickrate your server can run
Oh. Yeah that would make sense
there should be a way to have a modular spigot thing like
because of scaling
what if you just don't want advancements ever?
and want to just
nuke those checks
or just like
have a completely lightweight version where hoppers aren't a thing
But you can't just partition those entities and tick 50% every odd tick and 50% on the others. That would cause issues with skipped ticks
maybe I'm thinking too much about minestom
man pinged lukas
it's ok he's my homie irl
he an addict when it comes to that game but it's whatever
Its hard to explain time related things π
Certainly. Could be that I misunderstood what you meant by scaling aswell
you are focused on the overall time length, where as I am talking about not just dealing with seconds but rather smaller time scales. At the smaller levels you have more time. CPU's and code are capable of executing at those higher speeds without issue lol
JNI based server when
at that point might as well just go straight for native
C server when
But wouldn't time consuming tasks like ticking every entity still be a problem? I mean sure the CPU doesn't care about the interval but looping and ticking all entities will still take time. While server with less entities can have higher ticks (maybe even 5 times as high), servers with a lot of entities must tick slower to not exceed tick times. Right?
part of the problem for this is most likely because of threads and such, forcing everything to be in a single queue waiting on the previous to finish before executing the next
no OS just pure hardware
Slower as in slower than the normal tick speed?
yeah the whole one thread for everything obviously hurts performance
Well it helps also but sometimes does get in the way
if necessary, yes
Since you inherently donβt require thread safe stuff for memory effects etc
Yeah, I mean sometimes thatβs the case
When it comes to the notchian server (and forks like spigot and paper) given that you know stuff about how the server will be used you may be able to optimize through jvm options btw
Like quite heavily optimize
Is there a guide on that somewhere? Sounds interesting
A good start is to look at zgc and g1gc, the two gcs you probably wanna pick between, then I think aikar has a good set of jvm flags, but ye as frostalf said
I have explained about the JVM memory a bit before
Like there are so many flags
and that how your code is structured affects some things with it
And just so many of them are documented sadly
and there is a JVM flag to increase some things in regards to that
for instance, if your Object goes over a certain size, it doesn't go into heap space
I mean, it doesn't go in the stack space
it actually goes over that and lands randomly somewhere in heap
thus making it slower to lookup all its data
conversely the same happens when you make too many objects
I recommend learning more about the JVM and how it works π
but as Conclure said there is a lot that just simply isn't documented at least not in a way that is easily accessible
@EventHandler
public void onMove(PlayerMoveEvent event){
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
Player player = event.getPlayer();
Location location = player.getLocation();
PacketContainer packet = manager.createPacket(PacketType.Play.Server.WORLD_PARTICLES);
packet.getModifier().writeDefaults();
packet.getParticles().write(0, EnumWrappers.Particle.EXPLOSION_NORMAL);
packet.getDoubles().
write(0, location.getX()).
write(1, location.getY() + 1).
write(2, location.getZ());
packet.getIntegers().write(0, 1);
manager.sendServerPacket(player, packet);
}
Why does every particle look the same? EXPLOSION_NORMAL looks like a black something particle. If I change it to HEART for example, it looks the same.
Alos Fabsi, on a programming level you may also be able to optimize certain stuff by adhering to certain paradigms like data oriented design
(Not to be confused with Data Oriented Programming)
Well obviously I can adjust it to my code and plugins but not for all plugins from others
Yea indeed
that's why I asked if there's a "performance guide"
Yeah there is, but not an objective one, and I donβt think tps change would help
True
how do you see that?
Spark
I only know the sparkjava web framework
You also have JFR, and the debugger
Well sadly a lot of those things are hard to adjust when not doing a deep dive. Unless you keep running tests
unfortunately some of these things like what I mentioned won't appear in your tests unless you were specifically observing all of the memory in the JVM
Is Timings also a Plugin or is that included in spigot?
Well at the end it's only important that you notice changes in performance
yes but no, if you observe the end state only you won't really know what is causing it, and what I am talking about is not something that is easy to see from your code either
Well I guess I could find issues with my own code quite easily since I'm usually aware what slow workaround that should be fixed I'm producing while I'm coding. I'm more concerned about foreign plugins performance
Therefore just improving it would be fine
yes, but as I said, what I was talking about is not something you can discern from just looking at your code. You have to observe it happening from the memory side where you notice objects going into general heap space when they shouldn't be. If this happens it causes your code to run slower when those objects that exist outside of normal memory areas because of size limits need to be fetched/looked up. There is plenty of other things in the JVM that have quirks or hidden ways they work that if you learn about them can help improve your stuff π
mreow
Hi all!
If I were to access a chunk using Location.getChunk() every tick (using a repeating task for example) will it ever unload (fire the ChunkUnloadEvent) ?
From my limited testing, the answer is no.
if you want to keep it loaded add a Plugin Ticket
I want the exact opposite, I want it to unload, but I think accessing it every tick keeps it loaded.
But I am not sure if this is correct.
why do you want it to unload AND access it every tick?
I don't want to access it if it is unloaded
But the chunk never gets unloaded if I keep calling getChunk()
I think
?jd-s
Alright I'll try using this ty
how can i turn my plugin into a dependency<
huh
private void sendSoundToPlayer(Player player, Sound sound){
Location playerLocation = player.getLocation();
PacketContainer packet = manager.createPacket(PacketType.Play.Server.NAMED_SOUND_EFFECT);
packet.getSoundEffects().write(0, sound);
packet.getSoundCategories().write(0, EnumWrappers.SoundCategory.MASTER);
packet.getIntegers().
write(0, playerLocation.getBlockX()).
write(1, playerLocation.getBlockY()).
write(2, playerLocation.getBlockZ());
packet.getFloat().
write(0, 1.f).
write(1, 1.f);
manager.sendServerPacket(player, packet);
}
Why does this not work? There is no sound whenever I call that function.
What's the implementation for NAMED_SOUND_EFFECT?
if you have 3 int fields on the nms class then you just write thsoe 3 ints
check it yourself
without an IDE you just
Well yeah but what's it called?
select whatever version
?
uhh
let's see
in paper mappings it just seems like it's a ResourceLocation aka namespaced key
but that seems to have changed in 1.19
Holders are just a container for registry objects
maybe packet.getMinecraftKeys.writeWhatever
never seen holders before honestly
but then again I haven't played with 1.19
So uh have you tried https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#playSound(org.bukkit.entity.Entity,java.lang.String,org.bukkit.SoundCategory,float,float)
declaration: package: org.bukkit.entity, interface: Player
before using packets
I've just said that I'm trying to do it with ProtocolLib so I understand how it works.
Alright, did more experimenting and I can safely say that location.getChunk() keeps a chunk alive for the tick it was accessed in and the next tick as well
I feel like the game should unload the chunk next tick
Guess I'll just have to work around this quirk
Just donβt access it if it isnβt loaded?
world.isChunkLoaded
wouldn't that return true if I am using world.getLoadedChunks() ?
It would
Do you just want to keep the chunk loaded?
If so add a chunk ticket
declaration: package: org.bukkit, interface: World
If you are using that why do you ever need to call getChunk
You already have the chunk
No, I want to use the chunk in the tick and then let it unload
But accessing the chunk with location.getChunk() simply keeps it alive for the next tick
I am passing Location instead of chunk
I can work around it but it is slightly annoying that the game works like this
Why do you want to load the chunk for a single tick?
I want to use the chunk when it is loaded
I want the game to load/unload the chunks when they should
Then just access the chunks in the loop
if (world.isChunkLoaded(x,z)) { world.getChunk(x,z)...
no access of chunk unless it's loaded
But I am iterating over all loaded chunks
world.getLoadedChunks()
So I doubt that would work
if you are iterating all loaded chunks then they are loaded. chunks do not instantly unload
you have to leave them alone without players near for them to unload
?stash
Guys, I understand I have the chunk
I pass the Location in my code, what I sent is an example
I just don't want Location.getChunk() to keep the chunk loaded till the next tick
then don;t use it
You don't need to call getChunk in the first place
The thing is - why do you "need" to use "Location#getChunk"?
you already have all loaded chunks you are iterating
calling Location.getChunk is pointless
- the location you get would be the wrong chunk anyway
it would not lol
oh wait you do times it by 16
also instead of using multiplication ( * 16) just use bitshift left 4 ( << 4)
microoptimization
Hi does anyone know how to add a pet menu with the McPets plugin?
Doesn't the compiler do that itself ?
Only the compiler can answer that :p
you are literally getting the chunk, creating a Location from that chunk, then calling location.getChunk
Alright, so what I gathered is that I can not stop the chunks being loaded till the next tick when using the location.getChunk()
I just have to work around it, thank you all
..
again, I am passing Location in my actual code, not the chunk
Then pass both
π
In teh code you posted you are iterating all loaded chunks
man used my ss
You can always call unload on the chunk
yeah
I canβt imagine telling every loaded chunk to unload is a good idea
It's an example bruuh
I would have to send the repo lol
YOUR code, iterates every chunk, creates a location from that chunk, then calls getChunk. Completely pointless
hehe we love I/O operations
can't, don't know if the chunk should unload
I mean I imagine the server is smart enough to not unload it if a player is loading it
β¦ maybe
Why does it matter if it's loaded for a single tick more
my poor 50ms on startup
Because they run it every tick
he's iterating every tick so hes keepign all chunks loaded

π€π€π€π€πππ
gotta LOVE that purple circle on coll's message
best use of a super reaction
LMAO
Hell yeah
valorant an AMAZING game
no
I agree ebic
To be fair the best use of a super reaction is to throw it in the bin
super reaction bin lets go
I thought super reactions were going to be cool unique reactions
lets dump super reactions on my message because cool
Like brand new ones
But no they are just normal emojis with dumb animations
(That donβt even animate on my mobile app)
he deleted his message??
lmao
how dare you
You're tripping
How do I listen for server-side stuff that isn't triggered/spawned by the player? (block changes, particle spawned, mob spawned...)
For example: Block changes. How do I capture all server-side block changes, no matter if they are triggered by plugins, by players, or something else?
events
BlockPlaceEvent doesn't capture block changes made from other plugins, only those that are placed by players.
So true
You'd have to mixin to the server or fork it
Only do this if your plugin is private
:( yeah this won't work for me, plugin is made for public use
Then there is no way
understandable, thank you
I wish we had just a catch all event for when a block becomes air
Or when air becomes block
AirGetBlockEvent
someone asked for scoreboard help
registering an objective
why did you screenshot it π
nerd
shut
love you too son <3
my spacebar isnt the best
Init mate
Chef
bruh
π¨βπ³
you wanna scrap
hey i'm having trouble with the spawnNPCForDefaultPlayer section, I am getting the debug message "failed to wrap player" any assistance would be much appreciated https://pastebin.com/U2yQBgVx
Hello how to make a tablist on 1.12.2 pls
plotAPI.wrapPlayer(ownerUUID) is returning null
do you have any idea how I could fix ? im getting the uuid in the debug message on console
Thats all the code you provided.
Hey I'm using this with Potion Meta to set the potion color to its default type but as you can see the potion type is not showing as the correct color
Server version 1.19.4
Client version 1.19.2
They changed all potion colors in 1.19.4 mightβve caused some issues
Oh it seems they have (not a fan of that lmao)
Thanks π
--gemerate-source puts these in the maven repo, where do I get the output source jar
I hope typo --gemerate-source
it is --generate-source
can anyone help with this
pretty sure --generate-source doesn't create the sources jars. It only creates the files/folders
I've never had either actually create a jar though
They both create .jar files
You probably weren't looking in the right place
They'll be under Bukkit/target and CraftBukkit/target
probably not
actually, there is no target folder under Bukkit nor CraftBukkit
spigot-api and spigot-server have target folders only
Then you haven't run BuildTools yet
There's no way at all there isn't a target folder lol
I just did clan run
clean*
there are target folders, but only in Spigot-API and Spigot-Server
β€οΈ
You're in the Spigot directory
You should be looking at the Bukkit/CraftBukkit dirs in the root
Yes but not officially
how do i use it
carefully
Correct
Anything pre 1.8 has been removed due to the DMCA
So you wonβt find it on any official sites
how did it get dmca
You can use some sketchy reupload or you can stop trying to use an 8 year old api version
any reuploads
?dmca
An unofficial explanation of the DMCA can be found here: https://www.spigotmc.org/wiki/unofficial-explanation-about-the-dmca/
here could i find a reupload
just found a 1.4.6 spigot
can u find me a 1.7
i found it already
We ainβt going to provide you with 3rd party reuploads
can u send me a link
nope
Found my archive. No I'll not send you any
Its illegal to distribute
gpl3 when
They arenβt officially available anymore for a reason
Idk why youβd ever want to use an 8 year old api anyway
I remember it was annoying at the best of times
constantly trying to find a way to work around issues
to make a plugin
...
why does that matter
but why in an 8 yr old api
I can see someone wanting to make a mod for 1.7 but a plugin? Seriously?
that has a percentage of the features we have now
Itβs also filled with bugs and exploits
The only reason it isnβt vulnerable to the log4j exploit is because minecraft hadnβt even started using log4j yet π€
--generate-source only generates the api sources from what I see
ike in the house
what
responding to all possible reactions
yes
is there a way to store an entity with armor and stuff without spawning it?
I guess you could be janky and store it using a structure
yeah that's what im doing xD, but i was just wondering since im storing a class with the information either way
But other than that the API does not have the concept of virtual entities
and it would be way easier to just construct the entity then store it aka private final Entity entity;
ItemCustom vanish = new ItemCustom("Β§lΒ§9Vanish", Material.IRON_HOE, 1, true);
vanish.addKey(plugin, "vanish");
Why I have to use my func here but not in my constructor directly ? https://sourceb.in/iwat0aFfZb
To add the NamespacedKey I mean.
which is ur function?
addKey.
Yes and?
It does not matter, it's with vanish and it's the same thing.
I will fix it btw :>.
u wanna call the function inside the constructor or what's the question?
Hey!
I'm currently having some issues with setting a spectator target.
Basically, what I'm doing is teleport the player to the target and then set the spectator target. The target doesn't move at all, yet as soon as I set the spectator target, the camera seems to always do a 180 degree turn. Does anybody know what could cause this or how to prevent it?
(The teleport as well as the delayed task are to help with larger distances.)
Spigot 1.19.3 / Java 17.0.3
public void setSpectate(Player target) {
player.setGameMode(GameMode.SPECTATOR);
PotionEffect blindness = PotionEffectType.BLINDNESS.createEffect(30, 9);
PotionEffect slowness = PotionEffectType.SLOW.createEffect(30, 0);
player.addPotionEffects(Arrays.asList(blindness, slowness));
player.hidePlayer(plugin, target);
player.teleport(target.getLocation());
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
player.showPlayer(plugin, target);
player.setSpectatorTarget(target);
}, 10);
}
u can view a constructor as a function that just runs when creating an instance of the class with new
I was calling the func in a constructor but it was not working when I was calling from constructor and when I call when I declare the item it works.
do you want to do ItemCustom vanish = new ItemCustom("Β§lΒ§9Vanish", Material.IRON_HOE, 1, true).addKey("plugin, "vanish");
it realistically shouldn't matter whether u call it inside ur constructor or after
yea
Thanks guys :).
sometimes u just gotta recompile everything (:
@EventHandler
public void onJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
FileConfiguration config = plugin.getConfig();
config.set("modt." + player.getUniqueId() + ".enabled", "off");
config.set("modt." + player.getUniqueId() + ".vanish", "off");
}
@EventHandler
public void onLeave(PlayerQuitEvent event) {
Player player = event.getPlayer();
FileConfiguration config = plugin.getConfig();
if (config.getString("modt." + player.getUniqueId() + ".enabled").equals("on")) {
player.getInventory().clear();
config.set("modt." + player.getUniqueId() + ".enabled", "off");
config.set("modt." + player.getUniqueId() + ".vanish", "off");
}
}
Second problem :(, it does not change in my config.yml :
modt:
b6fe2775-5c19-404e-9df3-3c08a237c168:
enabled: 'on'
vanish: 'off'
obviously
you never save ur config object on the server to ur config file on disk
like FileConfiguration is basically a hashmap and it does not write its content to the config.yml automatically
u need to useplugin.saveConfig() iirc
?paste
