#help-development
1 messages · Page 1132 of 1
Yeah ik but
Bukkit has implemented BukkitConfiguration
Has it also implemented Gson?
Huhhh
Right
Does it need extra dependencies?
no
i mean what are you wanting to use this for
do you have data to save or something
do you just wanna make some configs
Yes, but im saving all my server files on yaml cuz idk how else to so like 💀
.
what kinda files
Gson can do a lot of reflection stuff which probably slows things down
like player data or what
But if you write custom adapters for everything that probably helps
serde 
dfu 
That too
More like data f*cker upper amirite
❌
Yeah nah I think im sticking to yaml 💀
gson is easy to use and even more so if everything you save are plain ol java objects, no abstraction and stuff. if you do wanna save abstract objects you'll need custom adapters. not hard either, but for a beginner might be intimidating
LazyDFU:
what does it even do
if you're saving items you'll also need a custom adapter
Makes DFU loading lazy
Aka it only loads if needed to save memory
mhm
Why th would you save abstract objects
Hold up
What the hell are abstract object
I though there were only abstract classes
Do custom Classes and Locations classify as plain ol java objects
datafixerupper
Whos that
Wdym
Btw I just remembered I dont save locations
Just vectors and a bunch of primitives
World isn’t a plain java object
And strings
It’s got a bunch of fancy stuff attached to it
But you can make a custom adapater for it that just saves the uuid or name
Is it cuz its abstract?
Yeah I dont need a location save
I just remembered
Is itemstack plain ol java object
No
You’d need to convert it to base64 or something
Or just the Map that bukkits api uses ig
Omfg what
Why not 😭
Whats plain ol java object
Primitives and strings?
Pretty much
1.) Talking about reflection, does anybody know whether if I already gained an instance of an object and a method and stored them somewhere (or have it pre-cached) and just invoked the method through that object how heavy would this be comparing to calling for example just classinstance.somemethod(); ? I mean I know how it works and that it iterates through all files when trying to gather an object for example.
Question 2 is whether it is possible to create a @EventHandler just from proxy or something like that (so you could for example listen to an event that doesn't yet exist) in older versions and has anyone ever done that? (I don't really need to do that since my project is modular but still I want to know that)
Or objects that are then made up of said primitives and strings
Gson also has support for collections, maps, and uuids
Right
ANYWAYS
Anyone have a commpletablefuture basics tutorial
Or will I need to ask chatgpt
Is there a discord server to get help with protocol lib development
Use packet events fr
no
yeet
ye
Lol
just search for the illus1on s3arch ind3x
alison stench windex
crazy
it depends
it used to be a good idea to cache those
like Method, Constructor etc
but i think there was a jep to make reflection faster
Not sure what you mean by q2
ofc just invoking Class#instanceMethod will always be faster than its respective reflective invocation
And q1, it greatly depends on whether your Method is static final
Or if you use any other invocation mechanism
MethodHandles
Never used it, but heard about LambdaMetaFactory
yes
I guess, aight
After JIT optimizations they are just as fast tho
but sadly LMF gets quite verbose is somewhat cumbersome to use and design around
yea JIT takes good care of reflection as well
(At least that's what I got in the atomic array element operators of MethodHandles)
Have you used it before?
ye
for a poor script /dsl language i made
but it was abysmally catastrophic
(not LMF, but the lang)
kotlin in craftbukkit???
the only thing that should get me banned is this horrific shit
if (!(entity instanceof ITileEntityContainer container) || (atBlock = container.createMenu(player.nextContainerCounter(), player.getInventory(), player)).getType() != type) {
if (atBlock == null) {
return block.defaultBlockState().getMenuProvider(this.world, this.position).createMenu(player.nextContainerCounter(), player.getInventory(), player);
}
return atBlock;
}```
Thanks for response both. With Q2 I meant if I can with proxies somehow attach annotations to proxies for spigot to invoke the method on the given event (that I pretend doesn't exist) but I quickly realised that making the project modular is much more neat than using reflection
w promo
PacketEvents 💪
Kotlin not configured ‼️‼️🗣️🗣️
huge
We're getting D-DOS attacks quite frequently,
so I started this project the get a hold on the situation.
Is is basically a bunch of firewalls based on IPTables and haproxy.
I would love if u could have a look and maybe we can improve on it.
What kind of server plugins are people interested in? any thoughts?
have you thought about a connection rate limiter?
Yes, it has concurrent and connection rate limiters
Anyone know how to fix this? I'm trying install the BuildTools.exe and this happens
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project spigot: Fatal error compiling: error: release version 21 not supported -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <args> -rf :spigot Error compiling Spigot. Please check the wiki for FAQs. If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support. java.lang.RuntimeException: Error running command, return status !=0: [C:\WINDOWS\system32\cmd.exe, /D, /C, C:\Users\Nexcodian\Downloads\BuildTools\apache-maven-3.9.6/bin/mvn.cmd, -Dbt.name=4316, clean, install] at org.spigotmc.builder.Builder.runProcess0(Builder.java:1042) at org.spigotmc.builder.Builder.runProcess(Builder.java:967) at org.spigotmc.builder.Builder.runMaven0(Builder.java:936) at org.spigotmc.builder.Builder.runMavenServer(Builder.java:905) at org.spigotmc.builder.Builder.startBuilder(Builder.java:683) at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)
what does java -version tell you
It's 21
are you using the command promt, or the gui?
did you set your path correctly?
by where it says java executable does it look something like this?
Yes it's the exact same as this
which version of build tools did you download?
latest
I just downloaded it from here
https://www.spigotmc.org/wiki/buildtools/
what is your operating system?
Windows 11
do you mind sharing your screen in a vc?
Anytime!
Hi, I was trying to make a plugin for integrate custom item. My goal is make a command giving an item that can be used everytime with the right click and teleport the player and other stuffs. I didn't find any problem in any of these task, except for the customitem itslef. I don't know how to make the customitem and recognize it in the course of the time: restart, etc..
?pdc
Thanks
good evening everyone
Hi guys! I am learning how to create plugins for velocity and ran into a problem when creating a configuration
[13:29:57 ERROR]: Can't create plugin proxyvelocity
java.lang.NoClassDefFoundError: dev/dejvokep/boostedyaml/dvs/versioning/Versioning
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method) ~[?:?]
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3373) ~[?:?]
at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2555) ~[?:?]
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:299) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:121) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:737) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.UntargettedBindingProcessor$1.visit(UntargettedBindingProcessor.java:54) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.UntargettedBindingProcessor$1.visit(UntargettedBindingProcessor.java:36) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.UntargettedBindingImpl.acceptTargetVisitor(UntargettedBindingImpl.java:52) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.UntargettedBindingProcessor.visit(UntargettedBindingProcessor.java:35) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.UntargettedBindingProcessor.visit(UntargettedBindingProcessor.java:27) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.BindingImpl.acceptVisitor(BindingImpl.java:99) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.AbstractProcessor.lambda$process$0(AbstractProcessor.java:53) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at java.base/java.util.ArrayList.removeIf(ArrayList.java:1672) ~[?:?]
at java.base/java.util.ArrayList.removeIf(ArrayList.java:1660) ~[?:?]
at com.google.inject.internal.AbstractProcessor.process(AbstractProcessor.java:50) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:216) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.velocitypowered.proxy.plugin.loader.java.JavaPluginLoader.createPlugin(JavaPluginLoader.java:129) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.velocitypowered.proxy.plugin.VelocityPluginManager.loadPlugins(VelocityPluginManager.java:168) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.velocitypowered.proxy.VelocityServer.loadPlugins(VelocityServer.java:369) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.velocitypowered.proxy.VelocityServer.start(VelocityServer.java:240) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.velocitypowered.proxy.Velocity.main(Velocity.java:71) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
Caused by: java.lang.ClassNotFoundException: dev.dejvokep.boostedyaml.dvs.versioning.Versioning
at com.velocitypowered.proxy.plugin.PluginClassLoader.loadClass0(PluginClassLoader.java:87) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at com.velocitypowered.proxy.plugin.PluginClassLoader.loadClass(PluginClassLoader.java:64) ~[Velocity.jar:3.3.0-SNAPSHOT (git-4eb02c8d-b434)]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
I don't understand what's going on, but the import class is dev.dejvokep.boostedyaml.dvs.version control.Version Control
Not in my project at all
Ensure that BoostedYAML is properly included as a dependency in your pom.xml
And shaded
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<relocations>
<relocation>
<pattern>dev.dejvokep.boostedyaml</pattern>
<!-- Replace this -->
<shadedPattern>me.plugin.libs</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<dependency>
<groupId>dev.dejvokep</groupId>
<artifactId>boosted-yaml</artifactId>
<version>1.3</version>
</dependency>
is everything right?
How do I detect when player is about to die and make them go to spectator at the same location, preferably skipping over the death part? I had been using EntityDamageEvent and canelling it if hp < 0 but the amount of issue thats caused is crazy
in the damage event check if health - finalDamage <= 0
if it is cancel the event and set spectator
Final damage?
getFinalDamage
Yeah thats what ive been using i think
And
It doesnt register when people take token into hand at last second
For ?? reason
And it doesnt work when another plugin modifies damage later
token? you mean a totem?
if they equip a totem they will not die
you need to be listening late to allow other plugins to modify damage
Priority High
Totem yeah
And appearantly if they take it in their hand last second it breaks
And doesnt register
Is there some inventory update time or smth
Wouldnt that execute first
If they equip it just before the damage hits they will not die
Appearantly they do
🤷♂️
No High goes after normal
Lowest Low Normal High Highest Monitor
Right
That doesnt really matter tho
it does
I need to fix the totem bug and idk how
if you listen on normal but something modifies on high you wont know about it
If they equip a totem before teh damage there is nothing to fix
The totem gets used and they don't die
Does damage and death occur on same tick?
probably not
does checking event.getFrom().equals(event.getTo()) in player move event exclude the cases where the player moves their head
Okay, another question
how many times
does the event run a second
20 times, right?
o
it can be hundreds
no
there is a minimum delta for it to fire
in fact, if you move in very small amounts, the event won't fire at all
Guys, does totem check occur on entitydeathevent or entitydamageevent?
And if its deathevent, does it run on the same tick as damage event
you can easily check yoruself. sysout in each event
Hm
Okay then tell me this
If someone dies
Nvm actually
F this
How do you do command cooldowns in plugin.yml
You don't
?cooldowns
plural
Fak
When a player dies
Can I respawn them and do stuff with them at the same tick
no
lol
hello ~ ,I'm trying to find an event that listens for when a player uses a brush on a block in Minecraft. Is there a specific event for this player-block interaction?
interact event
thx,but I tried it interact event can only detect the first time a player right clicks on a block, not when he brushes the block.
and it seems that when the player keeps right clicking on the block it only triggers the interactEvent once.
what does brushing entail besides the initial interaction, keep pressing down the mouse button?
I'm asking since I don't play newer versions so I don't understand the concept of brushing lol
I can honestly say I've never brushed a block
I know it is a new thing but idk what it does nor if the server sends a packet regarding more than the initial interaction tbh
let me check ig
Real
Continuous brush generates some particles ,
Since I'm trying to make a Dark Souls-like message system, I wanted to use Brush to do the reading of the messages
it is similar to breaking block animation, there must be a packet sent
How do I switch to paper
It doesn't look like Spigot offers a more convenient way to listen to this event...
you can add the block to a list of blocks, or a Map<UUID, Block> to track the player brushing, and then continously check the dusted state in a repeating task
yes
might be worth asking in paper instead
?whereami
I'm following your hints to try and use ProtocolLib to solve this problem
guys
my sister gave me a ticket for minecraft the movie for my birthday
I just turned 30
refund it. Don't let anyone profit from that trash
but , I heard this film didn't get very good reviews.
how do i prevent Entity.setLeashHolder(null) from dropping a leash item
listening to some event probs
promotional video~
which is?
good question
the interaction is completely server sided it seems, the brushing is handled on the nms.ItemStack#onUseTick
so, there's just no event to handle that, but there could be one
make an issue in the jira about it
what does this mean
Guys, only the knockback itself is cancelled on entityKnockbackEvent but everything else is on entityDamageEvent (like particles and entity turning red) right?
you want to disconnect the leash holder from the leashed entity, without the leash dissapearing?
i think he just wants it not to drop
so I assume just make the leash disappear
yes
but for this kind of thing you want to https://tryitands.ee/
Like I said yesterday or whenever it was I responded, it's probably a CraftBukkit bug that can be fixed. We've fixed a lot of method calls dropping lead items when they shouldn't
It was yesterday, #help-development message
should it not tho, the default behavior is for it to drop, isn't it?
ig if you wanted it to drop then you could just drop it yourself
choco
Paper has an event to define that behavior it seems
i am STARVING of doggo pics
Best doggo ever. RIP Jan 2024
Very fluffy
nooo poor baby
She was 17.5 years old though
without the leash item dropping
yep
you better know we will be forcing you to send daily doggo photos
How can I make the world I created so that all the changes that were in it are not saved? and so that blocks are not updated like the gravity of blocks is not a purely zero world
I even tried through NMS and it was useless!
private void noSaveWorld(@NotNull final World world) {
final ServerLevel serverLevel = ((CraftWorld) world).getHandle();
serverLevel.hasPhysicsEvent = false;
serverLevel.noSave = true;
}
Just clone the world you wan to default to, and on start delete the copy, and copy it again
Can you give us an example or something?
and the standard APi doesn't seem to have a copy() option
You just copy the directory and then create the world with the name of that directory
does Inventory.getContents() get a snapshot of an inventory or like a pointer or smth
like can it change after you get it
why is new TranslatableComponent(mobOrder.get(0).getTranslationKey()).getTranslate() not giving me the translate?
you have to send the component
the server has no idea what the translation is, the client translates it when it recieves it
as a TextComponent?
iirc you should be able to just send the translateable component directly
Player#spigot().sendMessage
Hi, does Spigot integrate some kind of command parent system?
Like /mypluginprefix <command> <args>
sub commands are entirely up to you to create
ok, thanks
can the contents of the itemstacks change?
Is this the only way? I'm just using NMS, maybe there's a way to do it through it?
And if you change classes through javaagent?
What
just delete and copy the folder
Actually wait spigot deprecated the built in Apache commons didn’t it
You can still just shade it yourself tho
yer
been having that on my plugins, keep forgetting about it then I go to build and fwomp I gotta go shade it
And with that you can use FileUtils#copyDirectory
Minecraft still provides it iirc
Wat
So like mark the version they use ad provided
No it doesn't
Unless md patched out where they use it I'd be unsure to say it's gone
It's in their library list iirc
Just check the pom smh
I just remember it being in my server sofrware project and was confused cuz I swore spigot didn't have it
Maybe it's just unused in internals and md cut it
Seems weird for Mojang to just leave it around
But I guess they’ve done weirder things
They do it with so many libs lol
It's so weird
Like they recently bundled asm??? And jackson
Like wat
I don't think so could be wrong tho I haven't looked into it fully
minecraft performs no reflection, let alone runtime code generation
asm and jackson are a transitive dependency of some microsoft library
that they use in.. like... three lines of code
does anyone know what it means here by 'path not found'?
dont forget we have azure in mc now
whos tracy
daddy's little girl

What is Tracy for even
It’s a debugger
Ah
Ask her
/ performance analyzer
Ok will do
Think like, spark but for the client
I guess
OrdOrOrOrdOrdOrOrOrdOrdOrOrOrdOrdOrOrOrdOrdOrOrOrdOrdOrOrOrdOrdOrOrOrd
Ord
Average dfu class name
true
Poor John Codec<A,B,C,D,E,F,G,H,U,J,K>
How many generics is too many generics
872
No such thing
Quadlet<Triplet<Pair<A, B>, C>, D>
doesn't it also work on the server
How many Pairs is to many pairs???
iirc only the client has an option to bootstrap it
Hey guys I am spawning armor stands like this successfully
public static int spawnEntity(Player player, Location location, EntityType entity) {
// 0x01
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.SPAWN_ENTITY);
int id = intRange.getRandom();
packet.getIntegers().write(0, id); // VarInt
packet.getUUIDs().write(0, UUID.randomUUID()); // UUID
packet.getEntityTypeModifier().write(0, EntityType.ARMOR_STAND); // VarInt (StructureModifier<EntityType>)
packet.getDoubles() // Double
.write(0, location.getX())
.write(1, location.getY())
.write(2, location.getZ());
packet.getIntegers() // Angle
.write(0, (int) (location.getPitch() * 256.0F / 360.0F))
.write(1, (int) (location.getYaw() * 256.0F / 360.0F));
protocolManager.sendServerPacket(player, packet);
return intRange.getRandom();
}
But I can't put a diamond block on the armor stand head for example
public static void setEquipment(Player player, int entityId, String base64) {
// 0x5B
// TODO(): Unfinished
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.ENTITY_EQUIPMENT);
packet.getIntegers().write(0, entityId);
List<Pair<EnumWrappers.ItemSlot, ItemStack>> list = new ArrayList<>();
if (base64 != null) {
System.out.println("jpg");
list.add(new Pair<>(EnumWrappers.ItemSlot.HEAD, new ItemStack(Material.DIAMOND_BLOCK)));
}
packet.getSlotStackPairLists().write(0, list);
protocolManager.sendServerPacket(player, packet);
}
Theres no errors, whats wrong
where does the getSlotStackPairLists method come from
protocollib
that isn't a method of PacketContainer though
public StructureModifier<List<Pair<EnumWrappers.ItemSlot, ItemStack>>> getSlotStackPairLists() {
return this.getLists(BukkitConverters.getPairConverter(EnumWrappers.getItemSlotConverter(), BukkitConverters.getItemStackConverter()));
}
How am I getting it then thats strange
oh nvm it is from AbstractStructure, which PacketContainer extends
Yea
hold my
only choice is to debug it ig, you sure that method is being called?
also, try it on a real entity instead of a fake one
wait
you're using a random number for the entity id
you shouldn't do that, it could pick a number of an already existing entity
use Bukkit.getUnsafe().nextEntityId()

🤔
GET THIS EMOJI FROM
PurpurMC
it'd be the same on paper lol
my favourite purpurmc emote
that is a paper feature is what hes saying most likely
I already questioned yesterday why they're doing client-side entities at all but who knows
I am saying it would only be the same on paper
sendEquipmentChange also exists on spigot no?
nextEntityId() is paper-api only
what is the message directly before he sent the paper emote

that's crazy 🐢
I always forget to look in spigot javadocs when chatting here
stay in paper 👍
not that, imo, that is a smart method anyway. PL should supply something
protocollib has a method for that
in a different note, it kinda surprised me to see how the packet is encoded
I wouldn't expect Mojang to write code that cares about bandwidth to this extent, though I don't know with what frequency the set entity equipment packet is sent
a good amount of times. The packet is sent whenever like durability changes e.g.
that makes sense, good that they're saving that one extra byte then
Yea 
tbf I wonder if they could improve that and potentially only send like, a DataComponentPatch
instead of the full stack
aside from checking the count, it just checks if the component maps aren't the same when checking if there were equipment changes, so you might be right
do component patches have a codec tho
what is this nms nerd talk 😭
i mean ill try it but the first method returns the entity id which i then use in the second one
ill try what u said tho
wait bruh i was calling the random function again at the end
thats prob why
well i meant to return id, which i do now but still nothing
well yeah the method is being called
maybe something here is wrong?
public void spawn(Player player, Location location) {
int id = PacketEntityUtils.spawnEntity(player, location, EntityType.ARMOR_STAND);
PacketEntityUtils.setEquipment(player, id, ConfigValue.Wardrobe.LEFT_BUTTON_SKIN.getValue());
}
it doesn't matter, if it is the same entity id as an existing one, that'll cause issues (though I think adding an existing entity id will cause a warning in console)
also, did you try setting the equipment of a real armor stand, or just a random mob?
nah but i was passing in a new id to the equipment packet
the armour stand was spawned using packets too
doesn't matter, I'm trying to see if just sending the entity equipment packet is working properly
since the spawn entity is in fact working properly
spawn an entity the normal way
kk
Hi I have some problems with this lines 😄 Can someonehelp me?
package de.stauder.test.listener;
import org.bukkit.GameMode;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerGameModeChangeEvent;
import org.bukkit.plugin.Plugin;
public class GamemodeListener implements Listener {
@EventHandler
public void onGamemode (PlayerGameModeChangeEvent event, Plugin plugin) {
if (!event.getPlayer().getGameMode().equals(GameMode.SURVIVAL)) {
event.getPlayer().setGameMode(GameMode.SURVIVAL);
}
}
}
then use the id gotten from Entity#getEntityId to send the packet
yeah ill try that
well, what's the problem in question
It wont activate the plugin if i start the server
also, you can just cancel the event instead of setting the gamemode to survival
what does that mean, do you get an error in console?
yep
i changed it now to: @EventHandler
public void onGamemode(PlayerGameModeChangeEvent event, Plugin plugin) {
if (!event.getPlayer().getGameMode().equals(GameMode.SURVIVAL)) {
event.setCancelled(true);
}
}
}
why is there a plugin parameter in the method
would you look at that, the entity spawned using World#spawnEntity does have the diamond helmet
the error code is too long for discord
I'm placing my bets on the entity id being wrong, though I can't be 100% sure
so how can i also allow the packet armor stand to hold the helmet
well look what im doing now
send it in the paste service I sent above
public static int spawnEntity(Player player, Location location, EntityType entity) {
// 0x01
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.SPAWN_ENTITY);
int id = Bukkit.getUnsafe().nextEntityId();
packet.getIntegers().write(0, id); // VarInt
packet.getUUIDs().write(0, UUID.randomUUID()); // UUID
packet.getEntityTypeModifier().write(0, EntityType.ARMOR_STAND); // VarInt (StructureModifier<EntityType>)
packet.getDoubles() // Double
.write(0, location.getX())
.write(1, location.getY())
.write(2, location.getZ());
packet.getIntegers() // Angle
.write(0, (int) (location.getPitch() * 256.0F / 360.0F))
.write(1, (int) (location.getYaw() * 256.0F / 360.0F));
protocolManager.sendServerPacket(player, packet);
return id;
}
Now the id cant be wrong
i pasted it there but what now? 😄
lol it says it cannot find the main class but i didnt changed it xD
it cannot find the main class but i never changed it i think
cause this started as a test 😄
also, make sure there isn't a typo or something
no idea man, the client is doing you dirty lol
let me check the client code, maybe it is disallowing the change of equipment from non-existing entities, though that doesn't make sense at all
Aye, ive definetely seen this done before, there must be a solution
i cant send pictures here
a typo? what is this? 😄 im german btw
https://imgbb.com/ or verify your spigot account on the verify channel lol
(they sent it in DMs, putting it here for context)
@opaque cove this main class is called Main, not Test lol
check if the DamageSource#getEntity is an evoker spell
how can i make the memory usage profiler with spark?
maybe theres a way to spawn a real armor stand but just hide it from everyone except one player instead of using packets @sly topaz
i tested several de.stauder.test etc pp things but it still cant find it
you don't have to do that with packets, you can just do Entity#setVisibleByDefault
or Player#hideEntity if it is already spawned
kk ig ill do that
yeah but i need one player to see it
doesnt that hide it for evrryone
no, that hides it for the player you call it on
so, you'd have to do it for everyone but that player
kk
what are you doing with this armor stand by the way
gonna make it like a button
ill add a custom head with arrows
and then like invis potion
could just use display entities instead
not on latest vers
wait
display entities exist on 1.19.4 right
thats my version
yes
nice and i can spawn custom heads and listen to when theyre clicked ye
you'd have to spawn an interaction entity since they don't have a hitbox, but yes
honestly, if you want the interaction it might be worth to just use the armor stand lol
but idk, use what you feel is the best
ah ok
just add an Interact entity as a passenger to a DisplayEntity
whats the display entity for a block called
use Display Entities. BlockDisplays are a pain
it's all the same, and if they need to display a block they have to use a block display lol
or a transformed item display but eh
does replacing a plugin jar of a plugin that is currently being used in the server affect the plugin's functionality
My code doesnt seem to work ._. I created a new project so it can finde the main class etc but my code wont cancel changin the gamemode
Sometimes yes
will fuck with classloading for classes that aren't loaded yet
uhm
does it
can it*
result in a bunch of NPEs, tab completers and events breaking?
yes
uhm
why are you doing that anyway
I may or may not have just cooked a 70 player server
well basically I thought it doesn't affect anything
Blame it on Mojang and promise a server wipe with the next update
appearantly it does
Pls help me ._. this code wont stop me from changing the gamemode
public class GamemodeListener implements Listener {
@EventHandler
public void onChange(PlayerGameModeChangeEvent event) {
if (!event.getPlayer().getGameMode().equals(GameMode.SURVIVAL)) {
event.setCancelled(true);
}
}
}
did you register the listener
get teh mode from the event not the player
ah, that too
oups forgot that
ive done this, what would be the best way to listen for an interaction, just a regular event? thanks
yes
awesome
an error for buildtools on 1.21.1, windows. any workarounds so far?
My testing server is crashing with this code ._. I want to interrupt all commands that puts u in another gamemode other than survival. and if ur in another gamemode then ur going to be in survival by the plugin. how can i do that?
@EventHandler
public void onChange(PlayerGameModeChangeEvent event) {
if (event.getPlayer().getGameMode().equals(GameMode.SURVIVAL)) {
event.setCancelled(true);}
else {
if (!event.getPlayer().getGameMode().equals(GameMode.SURVIVAL)) {
event.getPlayer().setGameMode(GameMode.SURVIVAL);
}
}
}
}
event.getNewGameMode() !=
why the != ?
whatever == or != depends on the logic you want
You currently are checking the players current game mode, not the new one trying to be set
but im already checking it by getting their gamemode with event.getPlayer().getGameMode()
if (event.getNewGameMode() != GameMode.SURVIVAL) {
event.setcancelled(true);
}```
You are calling setGameMode in the game mode change event
Which calls the event again
to infinity and beyond
hey so my command doesnt work, can someone help with this?
public class Mace implements CommandExecutor {
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
if (commandSender instanceof Player player) {
ItemStack mace = new ItemStack(Material.WOODEN_SHOVEL, 1);
player.getInventory().setItem(1, mace);
}
return true;
}
}
getCommand("generatemace").setExecutor(new Mace());
displayname
Bukkit#getPlayer or getPlayerExact
Thanks
getExact >>>
I feel love getPlayerExact does what most people think getPlayer does
Exact is exact getPlayer is the weird one
Boo
I'd have to reread the java doc to remember what it does
I want it at least case insensitive
?jd-s
TIL matchPlayer exists
getPlayer just looks for the closest match
I know essentials uses it for their commands
Can be pretty convenient sometimes
matchPlayer does the same, but the name isn't confusing
Fr
matchPlayer returns a list
What if it’s empty
😭 I can't believe I gotta still do brig integration

But before that even I gotta do plugin loader shenanigans
Welp ima stay focused on inventory for now and cope later
See, if you manage to get that merged, at least you could always be proud of the person that initiated softspoon
wait, why is matchPlayer deprecated in paper I was looking at the impl method lol
Sometimes progress has a price
Facts 🙏
Player player = Bukkit.matchPlayer(name).stream().findFirst().orElse(null);
Beautiful
next coll finds out about guava iterables
Plugin loader shenanigans are low on my list of priorities worry not.
Well not like yall care kekw
Iterables.getFirst(Bukkit.matchPlayer("SuckMa"), null)
Who is suckma???
wish List had a getOrDefault
wtf is this third party library
I only use pure java
probably commons
With Lombok of course
It's guava my friend
transitive spigot library
you fool
Yea google commons iterables
Commons is dead I killed it with my own two hands
That’s
ah right, commons utility classes end with Utils
Giving some really weird vibes
Coll only writes bytecode for maximum jvm speed
Ah yes of course
INVOKESPECIAL Coll1234567
Raw ASM is too fast for me but I still like to get a similar flavour
I knew this about you 😏
ASM has the perfect language design
funny how that could be taken both as an insult and a compliment
It'll keep you guessing perpetually
I’m special :D
Or are you special??
Who knows
My mum said in all the kinds of special

How many flavours of special are there?
Who knows
i love the fact that mum is meant to be british version but i dont know any british person who uses it
only americans
I am restraining myself from making an autism joke
probably meant to send this in #general lol
very development indeed
is there an alternative to GameProfile in spigot
actually just a mojang library, but it is internal as well 
yep
I hate how nms became synonymous with internal classes in the bukkit community
i use that but when i apply the textures from the profile to a citizens npc, nothing happens
it was working with GameProfile BUT it was applying the wrong skin
PlayerProfile profile = Bukkit.getPlayer(owner).getPlayerProfile();
Set<ProfileProperty> properties = profile.getProperties();
String value = "";
String signature = "";
for (ProfileProperty property : properties) {
if (property.getName().equals("textures")) {
value = property.getValue();
signature = property.getSignature();
}
}
the value decoded is valid but the signature is just random characters
but i believe thats normal
idk'
Hey spigot used to repackage everything under net.minecraft.server
Well not the external libs but shh
Can someone help fix my command?
did you register it in plugin.yml
Yep
what doesn't work about it
It doesn't show up on the command list, I think there's a word for that
are you sure your plugin is being loaded?
also, even if it doesn't show up there, is it being executed properly when you use it?
oh ok i see it now
- its not being loaded but the file is in the plugins folder
- theres no .jar file with it in the plugins folder
why am I getting this error
[Server thread/WARN]: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_21_R1.inventory.CraftMetaItem cannot be cast to class org.bukkit.inventory.meta.SkullMeta (org.bukkit.craftbukkit.v1_21_R1.inventory.CraftMetaItem and org.bukkit.inventory.meta.SkullMeta are in unnamed module of loader java.net.URLClassLoader @77a567e1)
are u casting ItemMeta to skull meta ?
https://paste.md-5.net/axejiyerif.java
I took this from CraftServers createWorld(WorldCreator) method, I need help as i'm getting an error that I have no idea is causing it
java.lang.NoSuchMethodError: 'net.minecraft.core.IdMap net.minecraft.core.RegistryAccess$Frozen.registryOrThrow(net.minecraft.resources.ResourceKey)'
Line 148 - edited
Any help would be appreciated, 😛
yeah
that itemmeta u are casting is not instance of SkullMeta
?nms
I'm using nms lol
me when i dont even open the link
do you have everything that that guide tells you to add
I compiled purpurs source code, used "build" and all classes load and I did minecraftserver.log and it worked
you arent remapping is my guess
^ that is most likely the issue
why are you duplicating the createWorld method
making it less sync
fork of spigot/paper or just a plugin?
fork
I'd recommend just forking if you are attempting to do that
though it isn't an easy one still
its just one method though
im removing weird functions like customdimensions
in the world creation
that doesn't matter, it is a long method that access many parts of the server
the reason it hasn't been done yet is because if you want to do it properly, it is kind of a pain in the ass
if I fork it i would have to change so many classes, Im ujst changing one method
whats not proper about that
I mean if it works for you, godspeed, not going to stop you there
so any reason for the error?
yeah, this kind of thing is kind of glhf, you're modifying server internals so only people that have deal with internals to this extent would know
besides that looks weird
why do you have a separate class for the method, where are you implementing this
in my plugin
my server loads 3 worlds in 1 method, (its a speedrun server) so it needs to be async
which is very difficult ik
why not just load the worlds on startup
it makes a world under the players uuid_NETHER, uuid_THE_END, uuid_NORMAL
actually last one is just uuid
and the seed changes too
so that
so you make a world per player that joins? That doesn't sound sustainable at all lol
welp, good luck
ty
if the worlds are cleared after a certain while, for a speedrun server thats actually not a too bad idea
thats good, sounds pretty sustainable
but the problem is world loading lags the server a shit ton
like 3000 milis
but the server can handle after it loads
the plugins all coded i just gotta fix world generation
why not just disable spawn chunks, when creating, that's what causes the lag spike for the most part (since it has to generate those)
already did
TRISTATE.FALSE
i remember that since it took me a hour to figure out that slightly fixes it
you probably want to look at https://github.com/InfernalSuite/AdvancedSlimePaper
I saw that but they dont accept seeds
atleast not what i looked at it before
also its not 1.21.1
how do I send files along with http requests
Similar to this, in python
Found this example:
But this sends a url instead of a file
nvm
is there like no way to do this asynchronously??
Because making a fork is not an option for me
paper
or use mvworld they do it a bit faster
im using purpur
otherwise cancel spawn chunk generation
that will save up a lot of time on world generation
already did
in the code in the video its set to false
it says it takes 2 ms but does it really??
theres gotta be some functions taking up thread
no idea what keepSpawnLoaded does, but i always cancelled the event
could do the same but no idea
you could spark it and see what takes the most time
yeah just put it on your server, start the profiler, do your world generation, stop the profiler and it will spit out a link
you can just post it and we have a look together
I made a new speedrun and thats what spark pooped out
also it thinks odilitamenus is at 30% cause im using it as an api for inventory creatoin
everytime i follow the high percentages it ends up in native lol
oh like java source code ? lol
i mean im not that good at analyzing spark either, but this looks not normal to me
ah
aikers flags
I just looked on reddit, i think thats normal
wish I could do another linux java thingy
aight
Neither of those are deprecated
?whereami
read the documentation then
crazy
but Im rarely using purpurs classes so I doubt it matters
or papers
I'd recommend to look at why they are deprecated first
read the javadocs
- @deprecated use {@link #keepSpawnLoaded(net.kyori.adventure.util.TriState)}
told u
i was right
the tristate is correct
So just use that method instead
and I need help with a spigot problem
ive been using that method
the problem is my world loading is laggy
Did you set a fixed spawn
How is that a tri state anyway
Well, I've seen things like that a few times before, but from what I can see it's just excessive multi-threading going on. I believe spark has an option to enable to profile ALL threads and not just the main thread - so check that out
What does having it unset do
its just a boolean
default to config on UNSET
oo
What config
a paper config
Ah one of your cringe files

So you're running paper 😏
ur bandwidth
Yeah everyone knows the config gets sent to the client
Controls if a world should be kept loaded or not, default (NOT_SET) will use the servers standard configuration, otherwise, will act as an override towards this setting
Yep
Well not anymore
One would hope I recall that javadoc, I reviewd that PR 
no from when you have to sftp onto servers to modif ythem
Who does sftp tho
I think I have only reviewed a single paper PR - maybe two.
In what, two years? - and now I've not done minecraft modding in two years, so that was 3-4 years ago, if not more
no the real question is who does ftp
I use sftp, what else?
ftp
scp 
The government can spy on my config files and bad code all they want!
fuck the police 
Well it is kinda my job xD
Well, gradle doesn't support any of the three anyways lol
Yea the gradle task are pretty ass for that
Pretty sure gradle is an SCP
I have no idea what scp is tbh
But if it requires a private-public key pair, it probably doesn't support it in a decent manner (or it does, just with a bunch of Asterisks that make it kinda not worth it sometimes)
No it requires several D class personnel though
lol
Don't worry, my mixins will handle the job
Otherwise if all stricks reißen, I shall use ASM.
Alle Stricke reißen never
so noone knows another method to make the world load faster?
It's teleporting a player to an unloaded chunk
other than using a fast ssd and cpu? tough
its a old server
like 2012
(dedicated)
also what do I do about teleporting the player to a unloaded chunk
should I load the chunks before I teleport the player?
wait
how would I load it slower
oh wait nvm
im stupid
🤓
ill use bukkit scheduler
Hi! I'm programming mobs with MythicMobs and so far everything has been correct, but I have a question that maybe someone can help me with. I’m creating pillagers that, instead of having crossbows, have bows (so they have the same attack range as players). However, when I give them the bow, it seems like they can’t use it and remain passive. If I remove the - BOW HAND argument, they revert to using crossbows and attack without any problem. Does anyone know what I might be doing wrong? I’m new to this and feeling a bit lost. Thanks in advance! I’m including the code in case it’s useful:
Execrat:
Type: PILLAGER
Display: 'Execrat'
Health: 30
Damage: 5
Equipment:
- LEATHER_HELMET HEAD
- BOW HAND
Options:
PreventOtherDrops: true
AlwaysShowName: true
Despawn: true
Glowing: false
bro just made a discord account to join this server
I already had one but redirected me to create new one (i'm a boomer, my bad). I don't know if I posted this in the correct place, sorry if I didn`t! I just clicked de discord link in the official plugin web. Didn't want to bother anyone, sorry!
you probably want to go to the mythicmob discord for that
Oh! Thanks so much!
is someone willing to help me in dms Im trying to send a .txt note of my code in here but i cant attach. Please msg me in dms if you can help
?paste
Hello there! I am working on a project making a Multi-Sports Network on Minecraft with multiple different sports! I am in need of a Coder / Developer that can create plugins for different sports such as, American Football, Baseball and many more! If you are interested in helping out with the project, please DM me and we can talk more about it! I can give any information and details about the project if you would like to know any other details about it!
Thank you and have a good day!
@ancient forge use paste
alright
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Thanks
lmk if this works i added 2 classes to it. I added my listener and my cmd class
So the error that im getting is that the world is null
and the if statements leading up to the teleport(lines 50-63) no message is sent
what about the world issue??
You know location is directly configuration serializable
I believe there’s even a getLocation for convenience
Well i have the location saved, but i do not understand why it is having issues. If i look in the warp file that is created for each warp it has to world and the name is just world. I check the world name and all it is, is world, so i do not understand why I cam getting null
design wise, it it okay if an object interacts with it's manager?
like if i call cancel on an object, it's okay to remove itself from a map in it's manager?
generally you would want to cancel it through the manager
like it's fine to do, just doesn't follow SRP
the exact lines that are causing issues are World world = Bukkit.getWorld(worldName); and player.sendMessage(String.valueOf(location(player, warpName)));
anyone help me please??
then i have to do everything through the manager and the object itself should only handle state?
that seems so roundabout tho
but also cleaner in instances
imma do what feels right ig
the idea behind it is that if that object were a child component of a shared parent class, you woulnd't have to reimplement the functionality for each implmentation
thats if it utilised OOP
i see
just feels wrong putting a addScoreToGame method in a manager
rather than in the game class itself
whats the context?
a running minigame. basically alongside a regular server, not a dedicated minigame
players get score by killing entities
i need to check on each score add if the score has reached a threshold
and then do something if it does like end the game
What does the stacktrace look like?
like the entire error code?
Nvm found your issue
You forgot . at the last of the paths
So its world but should be .world
ist meant like that becuase the world for like home 2 would be
2world :
i adapted to a mistake
You misunderstand
String worldName = config.getString( "warps." + warpName + "world");
At the end it should be .world
Same for all the other paths
2world: world
2x: -151.3256430023556
2y: 76.0
2z: -54.476496705921825
2yaw: 99.499916
2pitch: 17.722551
2admin: false
this is how it saves
Ok saving is not your issue
im still calling it wrong?
@drowsy helm
incase u missed
Making the path incorrect
What confuses me is for a normal /warp it works and i dont have the . in the paths
I think removing it from inside the object is fine
As long as it’s not too convoluted
Probably because of caching
im still getting name cannot be null for the 2 lines i stated
But then ill have to call a method from the game manager via the game class
All the paths in that method need fixing
should i change it for the saving as well then and try that?
Probably
Because without that . Your path is actually warpnameworld
When it should be warpname.world
Well lets see the stacktrace and the updated stuff now
Ok lets see the stacktrace
Ok well that is not an error with location. That is a problem in your listener with some kind of name
So in onClick your conditional checks are setup incorrectly where the bottom portion doesnt check if warpname is not null
is there any way to add cooldown to items? is it possible with packets?
well when i click in chat i set it so it would print the warpname and it prints as shown
Well for some reason that bottom portion is not getting the warpname because it gets set in the first if but only if that first condition runs
But when that first condition doesnt run but the second one does. Warpname is set to null since nothing changed it
I can only tell you what the error is saying
Your conditions need to be restructured to avoid that scenario
Player#setCooldown iirc
It’s per material tho
Java counts from zero, is there a better way to make it 1?
if (this.getTaskAmount(uuid, task) >= taskManager.getTasksRequirement(task).amount() - 1) {
Java indexes things from 0
It does not count from 0
A list with 1 item will have a size of 1
but for java it's "0"
I know but say i put that the amount is 5
Diamond_block broke: 1
Diamond_block broke: 2
Diamond_block broke: 3
Diamond_block broke: 4
Diamond_block broke: 5
Diamond_block broke: 0```
i always have just did what i need - 1 xD
if (this.getTaskAmount(uuid, task) >= taskManager.getTasksRequirement(task).amount() **- 1**) {
}```
k
k

