#help-development
1 messages · Page 1210 of 1
any help?
?paste
Make one
what should this file contain?
hello, i have a question on using custom item for a custom recipe ONLY. how can i make it only works on custom recipes those r using this custom item and not other vanilla recipes? it looks like only checking the Materials / tags but not PersistentDataContainer? i tried ExactChoice and it doesnt work as expected.
most vanilla recipes are based on materials so youd have to use a craft event
The PrepareItemCraftEvent ?
yeah
then i do checking there ?
yes
ah, alright thank you
ehm, but then is it 1 PrepareItemCraftEvent per recipe ? and how do i get which recipe is it preparing, as i remembered when i tried to System print the name of the recipe it got, it doesnt have a name or at least that looks random to me
i have a problem
i get a json in String type and i want to get the values. How can i get those value from a key
i used org.json and the JSONObject is require Map now. All the tutorial i found online can just put string into the JSONObject
What i found online
And this what i got
if you're asking that question you probably know the answer
yeah but I don't see a cleaner way to organize this
You could probably use gson
I've reached the point where I'm repeating so much math with generics that I need to resort to this

can prolly de-duplicate half of it tbf
why does this exist
currently making a funky attribute system and I cba making different "stacking policies" for different generics of numbers
So I can do something like
StackingPolicy<Integer> policy = StackingPolicies.sum();
int result = policy.apply(5, 10);
It's a bit like mojank's attribute system but it works for generics and you can make custom "stacking policies"
Like overriding the previous value
Using "InventoryClickEvent" how does one check what item was placed into a slot
Did you read docs?
declaration: package: org.bukkit.event.inventory, class: InventoryClickEvent
iiii did but i may have missed something
getCurrentItem()
oh. i tried it but it returned air i think or smh, lemme check
Yeah, getCurrentItem() gets what was in the slot before the item was placed, I think what you want to do is get the slot id, then wait 1 tick, and then check whats there.
ohh, so there is no actual method to check for the item that was placed without doing this?
damnn
There is getCursor, which gets whatever the mouse is on.
The wait 1 tick thing is ugly
ye
Basically you need to predict and do a million checks
For example, in a regular click the item goes from the cursor to a slot
but then the item in that slot gets replaced with the cursor
yes, that
Basically the event fires before the item is put in
If you're shift-clicking you need to find the first item that matches your thing in the opposite inventory
But i've seen people do it though
I should make an API abstraction for slots
leads to dupes
yeah ik lol
im gona sob my soul out😭
i dont understand a single thing you said
ohh I think i've sene someone do:
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
switch (event.getAction()) {
case PLACE_ALL:
case PLACE_SOME:
case ... // basically the place ones, not the uh "take"??
Inventory clickedInventory = event.getClickedInventory();
if (clickedInventory != null) {
ItemStack itemPlaced = event.getCursor(); // Item on the cursor is here
I remember making a plugin for putting custom items in beacons and it was a pain
This wasn't 100% accurate, pretty sure I still had to handle shift clicking and offhand switching
hey illusion do you by chance know wheres a anti-dupe plugin for the current dupe is? i havent gotten around to start on my own yet
what current dupe
what is this😭
drop/place at once when your connections shit to duplicate blocks, aka, shulkers
well what is your area of expertise? i just know i see you here a lot lol
I don't really run servers so I don't know much about general server setup / what the best plugins are
I do code a lot so you can ask me about network infrastructure, nms hella stuff
made procedural dungeons the other day
finally ported my ECS to java :3
do you know why the particle rendering nonsense caps itself
client has a particle limit
it's either 16k or 64k and iirc it depends on the client version
🤦
of course
an average pc would explode form that
urgh my issue is that i dont want to use rps
i dont think you should use 16k particles😭
no, im using them to make geometric shapes
also keep in mind that bandwidth is a thing outside localhost environments
yeah those can be culled
hm, ill look into it. do you know by chance which color supporting particle is best for making shapes?
this is dust
Haven't really messed with particles enough to give you a concrete answer
dust is the standard
alr ty
also im totally not rewriting this thing from scratch atm lol
oh, did you ever do work on structures?
2nd
i need to detect if a block is part of a structure in which it serves as the anchor point. best solutino i found so far is shade RedLib and use that
but well, thats still depending on one extra library
found it
ah ill put a pin in that
I have some code for both scenarios
when you know the anchor point and when you don't
(when you don't it just brute forces the fuck out of it)
useful for portals and detecting when ppl build dicks out of dirt and stone
brute forcing is a lot slower
no, this is for specific structs. see the gem/amethyst build below? i KNOW the anchor is in the center, top layer, just not of which structure
then you just loop over every registered structure and see if it matches
you can multi-thread it
it's how I do my "any-portal in any-rotation" logic
bleh i need to look into how to merge threads back into main, but thats not a topic for right now kek
CompletableFuture.allOf(futures).join
I wouldn't join, but instead make an executor that fires to main
bleh
yea thats probably a better solution than a 1-tick scheduler that checks if all threads have stopped lol
so hows your scan work?
(side note. can this complete in the same tick it's called, and start running further code in said tick?)
Depends ™️
like, how i do the jump back to main you mean?
the futures run on another thread
running allOf waits for every future to run and completes on whatever thread
you jump back with the bukkit scheduler
if its code inside a method you can wrap it in {} and click on the arrow that makes
doesnt that always delay by 1 tick
it does
but you're multithreading who cares
the point isn't about latency it's about not blocking the main thread
is there a way to check how much processing time is 'left'?
like
the time in ms that main is on wait()
No, you'll have to make your own logic for that
and main is not on wait
you schedule the futures on another thread and when they're done they'll schedule a task to run something else on main
main is completely unblocked while the futures run unless you join them
In which case the main thread is blocked until every future is done running
You can't really predict things, we're not fortunetellers
ah, thats not exactly what i meant
if a ticks processed it goes liek 'process world -> process plugin events -> wait until next tick'
i thought that as long as theres no TPS lag, theres no reason to multithread the scan
hence me wondering if i can check how long last tick's wait was
🤦♂️
i dont suppose i can interface with nms to grab that info
illusion, if you find that scan code, can you PM it to me? i need to buy groceries
how can i spawn a npc using this packet
the brute forcing code lets you do both ways
will send after work it's a bit sus rn
thats fine, im busy with... sooooo much other code atm lol
I don't think I've made a non-generic class for the past maybe 3 hours
There are different ways of doing so
but all you really need to do is provide all those params of your npc entity
what kind of params
The ones in the screenshot
the thing is i cannot spawn a player since there isnt a place to let me put the gameprofile
isnt it the entity have to be created first
hm? wdym
the player name skin are stored in an entity right?
so i have to create an entity first so i can spawn it
That's another packet
PlayerInfoUpdate?
One packet to tell the player about a new player (npc)
One to spawn it
One to set metadata
yes
well which would u recommended to make it on protocollib or nms
both will work if you send the right data
i cant find any tutorial on how to do that right on nms
protocollib too
all i do is print the packet.getModifier().toString() and see what can i put into it
doesnt NMS have the massive issue with breaking with every minor version
I literally have tutorials on both
not so much with mappings
oh true
thats why all tutorial are outdated
Not really
the params are different on every update
not if you run mappings
^ I really do hope you're not using unmapped nms 💀
You can just use Citizens
or packetevents
well
well can someone explain whats the correct params for player info update
PacketContainer packet = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.PLAYER_INFO);
List<Object> list = new ArrayList<>();
list.add(uuid);
list.add(getProperties(player.getUniqueId()));
packet.getModifier().write(0, EnumSet.of(EnumWrappers.PlayerInfoAction.ADD_PLAYER));
packet.getModifier().write(1, list);
ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet);
This is the code
and the error
Yeah that's not right
Don't use a list of objects
wild
One entry in that list is supposed to be one player
i followed this
Yeah
and what you did does not match that
Anyways ProtocolLib has a wrapper class to help you out
It is a list yes
by this I meant the Object class
Protocollib matches nms' signature, not wiki.vg's
nms encodes to wiki.vg's signature but the fields might not match
what should i put
PlayerInfoData
Pray on god
Cannot cast com.comphenix.protocol.wrappers.PlayerInfoData to java.util.List well
plib moment
how can i solve it
Hi, display entity issue!
They're spawning on the corner of the block
Won't center on the player it is supposed to teleport to
Tried adding 0.5 to x and z and it teleported to the block next to the player...
Trying to center it on the player as the player moves
Any advice?
did u do getX or getBlockX
getX
PacketContainer packet = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.PLAYER_INFO);
WrappedChatComponent component = WrappedChatComponent.fromText(wrappedGameProfile.getName());
PlayerInfoData data = new PlayerInfoData(wrappedGameProfile, 1, EnumWrappers.NativeGameMode.CREATIVE, component);
packet.getModifier().write(0, EnumSet.of(EnumWrappers.PlayerInfoAction.ADD_PLAYER));
packet.getModifier().write(1, data);
ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet);
I tried to make List.of()... doesnt work 😦
u did entity.teleport() ?
yeah
u using nms?
no
u can try install nms
and try this
public void teleport(Entity entity, int x, int y, int z) {
CraftEntity craftEntity = (CraftEntity) entity;
craftEntity.getHandle().setPos(newX, newY, newZ);
}
help
hello mee6
HI
well i think its time to go back nms
All that when display entities have a teleport method?
when u want to teleport something
also did u tried teleport manually using command
if command work
this will work
Display entities have transformation and rotation data so their location in the world may not always be the center of their bounding box, it sounds like you misunderstood that
can you show the code that spawns the display entity?
When you enable hitboxes F3+B , I believe the blue line will always begin from (x, z) of the entity's location, and y will be entity's location Y plus their eye height
for example, this command ```
/summon item_display ~ ~ ~ {Glowing:1b,interpolation_duration:20,Tags:["test"],transformation:{left_rotation:[0f,1f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,25f],scale:[50f,0.5f,0.5f]},item:{id:"minecraft:diamond_block",count:1}}
Try spawning one without `translation:[0f,0f,25f]` nbt data and see the difference
im so happy ;-;
can I make the frozen health bar just as an display without the player freezing?
probably using nms
You can cancel the damage
Alternatively just send the packet
not without the screen shake and overlay
What's a reliable way to determine if a block (or Material) is passable through by players? what I mean is solid blocks such as stone, dirt, wood you cannot go through them, but grass, flowers, cobweb, vines etc you can
without the need for a giant switch statement of course :)
It works nicely for the blocks I tested it for thank you very much!
Anytime!
Hi, I have problem with updating gui title view InventoryView#setTitle() when I perform that method gui start to be really glitchy
public void updateTitle(AssortmentChest assortmentChest) {
for (HumanEntity viewer : this.inventory.getViewers()) {
if (!(viewer instanceof Player player)) {
continue;
}
String title = "Skrzynia " + assortmentChest.getUsedWeight() + "/" + assortmentChest.getWeightCapacity() + "kg";
player.getOpenInventory().setTitle(title);
}
}
@ y2k
but yea, don't use that method
so how can I update it? on 1.19.3 I tried with packets and it works the same I updated to 1.19.4 to use inbuild method and still works really bad
updating a title requires opening a new inventory
yea but then the position of cursor is reseting
correct
can I avoid it?
Are you calling that directly in the click event
yea
I remember I had some project too where I needed something like this and then I went:
"Nah, this is fckn stupid"
Is it possible in 1.8 to reduce the amount of hunger players lose?
yo guys do i have to master java for spigot plugin development? or basics will work?
not master, but you should have a solid fundamental
so should i watch a full java course and learn?
Probably yes
okay!
Make sure to follow along with the examples and test things on your own
ok
if I have a common module, and would like each platform-specific module to include the common in it, isn't this how I could build the classes of both?
(This is in the platform-specific module)
and uh, it doesn't build the common module
are you just trying to shade it or what
I mean, basically, ye
yeah but like
...it doesn't build
that will build the dependent projects
yep, still
what is the output of :Spigot:build
only these classes
and what do you mean it does not do it
is it not getting included in your jar or..?
the common module
that is not a valid response to that question
none of this
well Spigot:build includes only that very module's classes
and so does common:build for it's own classes
and are you sure you are actually running shadow
ah I'm supposed to do that
nice
-1 social status for me
okay, shadow works perfectly
sorry xd
So I have a .json file with my custom loot table, but how do I add to my mc server?
I'm trying to create an itemdisplay of a mineraft iron sword, that is facing in the direction of a psecific vexctor, but I can't get the transformation correct, could someone help me to understand how I can achieve that?
Its an Entity so you don;t need to use Transformation at all
just set the direction
I'll try it out, one second. Thank you
It doesnt really work, probably because the txture of the iron sword isnt a vertical line but has an angle
an angle?
yeah, the sword texture goes from the bottomn right to the top left so if i create an itemdisplay using the texture it will have that same texture. I want to rotate it so the tip faces the given direction
ah
then yes you are going to have to mess with Translations
two rotations
Transformation transformation = entity.getTransformation();
// rotate here around Z or X to raise the tip...
transformation.getRightRotation().rotate...
transformation.getRightRotation().rotateY(rotation);
entity.setTransformation(transformation);```
Thanks a lot. And how exactly would I translate the direction vector, should I just mess around with it and try it out?
Ok, thank you so much I'll try it out later
so when I try to generate my custom loot table with this command: give @s chest[container_loot={loot_table:"jef:chests/small_dungeon_chest"}] It generates an empty container
Hey, is worldedit the fastest way to set blocks or there a possibility to use nms? I know you can do it via nms but trying to work out the best method is a bit tricky.
how do you add your loot table ?
FAWE certainly is the easiest
my resource pack for items with custom model data randomly stopped working when I updated to 1.24 1.21.4 and I cant get it to work again
this is the pack: https://www.dropbox.com/scl/fi/9eze705n3soe9oivtr16h/Wicklow2.zip?rlkey=leltyficcg2m22r2v87tq4cdh&st=n3q7m76q&dl=0
items that have custom model data 5 in their meta do not appear with the custom texture when I have the resource pack equipped
custom model data did change a bit
Look at the changelog for the version (also, 1.24 does not exist yet)
There were major changes
- I would recommend not using custom model data for simple models anymore, use the new component
https://minecraft.wiki/w/Data_component_format#item_model
old custom model data has been effectively replaced with item_model yeah
by simple, do you mean creating a texture without a custom model?
I need to retexture the item, then do something like this to set how it looks when held:
{
"parent":"builtin/generated",
"textures":{"layer0":"items/coal"},
"display": {
"thirdperson": {
"rotation": [ 0, 90, -35 ],
"translation": [ 0, 1.25, -3.5 ],
"scale": [ 0.85, 0.85, 0.85 ]
}
}
}
is this still going to be possible?
by simple I basically mean anything you would do before this change
since custom model data can now do much more than before
Hello does anybody have experience in obfuscating Spigot/PaperMC Plugins using ProGuard?
I am trying it for two days now and it seems like I can't get it to work, would rlly appreciate a helping hand.
I don't wanna get into how to create a new custom model for an item 'cause I myself don't fully know, just look at the wiki
I believe it should be fairly well documented there
Use item_model for your case
@earnest girder If you need any help with it, the Minecraft Commands discord is probably the best equipped for this.
Just create a thread and I'm sure ppl will be happy to help there.
thanks
BlockDisplay display = hider.getWorld().spawn(loc, BlockDisplay.class);```
I was hoping this would spawn it at the center of the player
a BlockDisplay spawns with its corner at the location. A player is centred on the location
if you want the BlockDisplay to spawn AT the player then subtract 0.5 from X and Z
I put it in the datapcks folder in my saves > world > datapacks
Works ^-^ Thank you so much!
So through a datapack
Are there any datapack load errors in the logs ?
the datapack loads now, but when I execute /give @s minecraft:chest{BlockEntityTag:{LootTable:"jef:chests/small_bronze_chest"}} it gives the error expected whitespace to end one argument, but found trailing data
wait- "saves"
Are you not even on a server ?
What are you doing on this discord lmao
what version are you on ?
This doesn't work for over a year
the first one you sent looked like it should work, provided there are no mistakes in the datapack
im on 1.21.1
yes, so this command will not work
try to use the one you sent before
still gives an empty chest
the folder is called loot°tables though, should it be loot_table?
what folder
datapacks > jef_datapack > jef > loot_tables > chests > small_bronze_chest.json
I don't know in which version they renamed the folders, but at least on latest it is indeed "loot_table"
so I say give it a try
And I'd recommend going to the Minecraft Commands discord server for this kind of issues in the future.
I can see you are in there as well.
I don't know why you're here, this place is for spigot plugin development mainly.
It is for a spigot server
But Im first testing it in a singleplayer world
But you are making a datapack.
And if you're testing it in singleplayer then that is more of a reason to go to MCC discord.
They will be able to help even more/better.
Alrighty
I'm trying to make a custom world generator, but it uses the vanilla one instead, how do I fix that?
this is my plugin.yml btw: yml name: Void_SkyBlock version: '${project.version}' main: Lazy.VoidSkyBlock api-version: '1.21' worlds: world: generator: Void_SkyBlock
this is the custom ChunkGenerator class: ```java
public class VSBChunkGenerator extends ChunkGenerator {
@Override
public void generateNoise(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull ChunkData chunkData) {
if (chunkX == 0 && chunkZ == 0) {
for (int X = 0; X < 3; X++)
for (int Z = 0; Z < 3; Z++) {
chunkData.setBlock(X, 0, Z, Material.BEDROCK);
}
}
}
}```
and this is the main class: ```java
public final class VoidSkyBlock extends JavaPlugin {
public static VoidSkyBlock vsbPlugin;
public static Material[] baseItems = new Material[] {Material.OAK_PLANKS, Material.STICK, Material.DIRT, Material.IRON_NUGGET};
@Override
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
return new VSBChunkGenerator();
}
@Override
public void onEnable() {
// Plugin startup logic
vsbPlugin = this;
getServer().getPluginManager().registerEvents(new VSBPlayerJoin(), vsbPlugin);
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
}```
pls help
okay, now what?
Depends on what you want to do
Are you going for maven central? or do you want your own repo
just upload my an api of my plugin to maven central
wait, what's the second option?
You can self host your own repo using something like Reposilite
Would look like this: https://nexus.sirblobman.xyz
free of charge?
but seriously using var and static imports kinda makes your code more readable if its not too long
wdym?
Like somewhere to host it
i only use static import for something that is repeating too much
Import aliases when pls
no 🔫
Imho its better to make your code less verbose in syntax way so that you expose only the the logic that needs to maintained so i see such things as a win in terms of maintainability overall
What will happen is that bpeople alias the same import to different things
laughs in kotlin
no 🔫
import com.sk89q.worldedit.world.block.BlockState as WEBlockState
// OR
typealias WEBlockState = com.sk89q.worldedit.world.block.BlockState
nexus.sirblobman
Yeah I know
import com.sk89q.worldedit.world.block.BlockState as WEBlockState
Thats a thing? Wtf? Javascript confirmed?
get that as out of my java im offended now
how dare my java have proper grammar
thank god i got scared for a moment
It's kotlin
what is the current up to date way of adding an attribute modifier to an item?
AttributeModifier constructor is deprecated
should have some helpful info hopefully
why the fuck are you using overwrite
one of them is not ::)
and why is it called WeeHoo
thx
already fixed it tho...

What is the best way to prevent creeper damage to players?
im so obsessed with context driven naming and syntax right now tbh
i dont really get it why people dont use var or static import more often
isnt your code supposed to be so readable that you can read it straight from git repos without knowing much implementation details
In Java most don't know what a static import does and most experienced Java devs prefer readability over the use of var
var is pretty meh if you overuse it ngl
i dont see how type names improve readability, in very niche cases it does, for example primitives or something.
sure you do know a type, but you will still need to know how to apply it, and usually type names are kinda long, so it induces cognitive load for no reason
if you're reviewing PR you're reviewing a logic of the code, not the types
that's the job of the compiler to review your types
Like, I look at code I haven#t read in a year. I see a var and something calls .iterator on it
the method is call fetchResults
is that a list? can i index by int
a set? should I worry about duplicates or not?
somethingList is terrible
why use var when you can press 2 keys and autocomplete it
like, you just made it worse
now the type is just encoded in the variable name
but you also have var
static import does the same thing as calling the static method or class however there is a very slight difference when it comes to compiling wise in where the compiler is not guessing what it was you wanted.
for long type names, I really just want type aliases. especially for long generics
sure if your method is long, var is kinda not practical
but at the same time if you're method is long, isnt that a problem overall
a super easy way to give a name to a generic type with specific params would be very handy
if your method and class is short and concise you will see what var is being declared to
or you could not use var and see instantly what it is
Not the biggest fan of splitting methods just for the sake of keeping it so short I can use var
only time I don't mind the usage of var is if its in some small method
its not because of var its indicator that its too long either way
Well, but var like does make it even worse 
I am with frost on that end, if it is a dumb small method doing a single assignment or whatever
sure
but overusing it in code becomes annoying quickly for anything that isn't the developer in the current moment
but like, if that isn't the case for you, go for it lol. I can 100% see how it has its upsides
my general rule is that if you method doesnt fit in like 32 lines of code (or when its too big to understand properly), its too long
bro what
o.O
I just don't like looking in a class that has var all over the place and having to constantly scroll to figure out what is what lmao
that sounds like you just read that "Clean Code" book or whatever and are now part of the cult
kinda, i just like the idea of contextual syntax
this guy is coding with minecraft max stack sizes
where assignments and declarations themselves present you what the code does
That is like
not a statement
assignment and declarations are 66% of everything code can do
add comparison and you are done
Sure 👍
doesn't this also require your own hosting?
no
okay
it is
Then go for it
You can read this https://www.freecodecamp.org/news/how-to-upload-an-open-source-java-library-to-maven-central-cac7ce2f57c/
Contains steps for how to signup and create a ticket to get your project added
I am so lost
jira no longer seems to exist
all of these link to 5 different ways of publishing and I am no longer sure whether they were supposed to be connected or alternatives
Personally I'd just host my own Reposilite repo
Yep
the sonatype one
where would you host it?
ah yeah looks like the jira was shutdown
It does lead to some useful info
anyway
is this how I'm supposed to initially release it?
and then link the credentials to some publish system?
Yeah I can't help you with that part
Haven't done it before
publishing to maven central is kind of unnecessary tbh, I've only published to my own and Brawls' repo and it works
Has step by steps for everything
https://central.sonatype.org/publish/publish-gradle/#metadata-definition-and-upload what is this tho?
hm? That's just project metadata
am I supposed to give them a jar?
this api uses classes from my much larger plugin, how can I upload them as well?
I don't know what menu you're in
but you're normally not supposed to upload the jar directly like that
You should let maven/gradle handle it
so what am I supposed to upload?
Do you even need to
how?
Like this
(if it's a gradle project)
The sonatype guide shows how to make a custom task
I assume so you don't accidentally run it
Also signing and such is more strict on central
I assume the bottom two are the ones I was supposed to insert into settings.xml during token gen, but what about the upper 3?
So you're using maven?
Wait which settings.xml then
so what about the upper 3?
I have a feeling you don't use buildsystems much
settings.xml is the maven settings file, you need gradle.properties
have both
how do apis like citizens provide ai to their npcs?
you make use of the pathfinding goal
in that case you do pathfinding without the goal
you can look into A* pathfinding and similar
but you would utilize tasks though
and you just need to determine how it is you want them to move around
ty
You could also just use another mob type and then tell clients it’s a player
can someone help
my server keeps saying in console
A fatal error has been detected by the Java Runtime Environment:
SIGSEGV (0xb) at pc=0x00007acd73497726, pid=1, tid=72
JRE version: OpenJDK Runtime Environment Temurin-21.0.5+11 (21.0.5+11) (build 21.0.5+11-LTS)
Java VM: OpenJDK 64-Bit Server VM Temurin-21.0.5+11 (21.0.5+11-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
Problematic frame:
V [libjvm.so+0xc97726] MethodData::clean_method_data(bool)+0x56
Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/container/core.1)
An error report file with more information is saved as:
/home/container/hs_err_pid1.log
If you would like to submit a bug report, please visit:
https://github.com/adoptium/adoptium-support/issues
[error occurred during error reporting (), id 0xb, SIGSEGV (0xb) at pc=0x00007acd73da99a2]
container@pterodactyl~ Server marked as offline...
[prism Daemon]: ---------- Detected server process in a crashed state! ----------
then it crashes and rolls back the server a bit
what plugins
a lot
BasicVanish-1.0.1.jar
10.16 KiB 1 day ago
Broadcast-1.0-SNAPSHOT.jar
5.15 KiB 1 day ago
CauthonMaintenance-1.0.0.jar
5.77 KiB 1 day ago
Chunky-Bukkit-1.4.28.jar
286.28 KiB 1 day ago
ClickVillagers-0.5.1.jar
57.89 KiB about 9 hours ago
CoreProtect-22.4.jar
812.52 KiB 1 day ago
CoreProtectTimeLapse-v1.0.4-all.jar
696.64 KiB 1 day ago
CoreProtectTNT-2.3.1.jar
13.11 KiB 1 day ago
HealCommand-1.0.0.jar
2.98 KiB 1 day ago
instantrestock_2.4.3 (1).jar
1.31 MiB about 7 hours ago
InvSee++.jar
1.36 MiB 1 day ago
killpoints-1.0-SNAPSHOT.jar
30.23 KiB 1 day ago
KillsTracker-1.0-SNAPSHOT.jar
11.89 KiB 1 day ago
KnockbackSync-1.3.2.jar
6.29 MiB 1 day ago
LuckPerms-Velocity-5.4.145.jar
1.41 MiB 1 day ago
luckprefix-modern-2.0.0-BETA+7.jar
23.44 MiB 1 day ago
ModMode-1.0-SNAPSHOT.jar
8.9 KiB 1 day ago
simplefeed-3.1.jar
4.99 KiB 1 day ago
SimplePlayerFreeze-2.2.0.jar
47.69 KiB 1 day ago
SingleMace 1.0-SNAPSHOT.jar
5.46 KiB 1 day ago
Sudo-1.0-SNAPSHOT.jar
5.96 KiB 1 day ago
voicechat-bukkit-2.5.27.jar
1.5 MiB 1 day ago
Pterodactyl® © 2015 - 2025
some are custom coded but where tested on a different server and i had no problems
some memory access violation there, dou have the full stacktrace?
tho thats prob hard to make use of
idk what that ia
how can i get that
it happens randomly every few hours
one of ur plugins is trolling you hardcore im afraid
but its rly guesswork if u dont know what every single plugin does on a detailed level
all the custom plugins where created by me, could i have accidently done that?
yea sure enough
what can i like search for in the code
cause idk what that means
im not very experienced
dou know if any of ur code invokes functions that manually manage memory?
i wouldnt say so, i mostly used youtube videos and spigot documentation for the code
but
all of it worked fine on the test server
so idk why its happening on the main server now
i did install some new plugins so it could be those
i mean for all i know it could very well be a server software bug when it interacts with a certain plugin
idk, these problems are always hard, even if u have a full stacktrace sitting in ur logs
what should i do
update to latest server software, check if ur plugins r causing it, then start checking other plugins
is there a way i can check which plugin is causing it
i mean maybe if u have any errors in ur stacktrace
like if the log shows which function throws it
if it crashes again ill copy the entire error code and stuff and ill send it here
aight
thank you
@ivory sleet ia it possible someone could be messing with the server
like using a hack to crash it
you would need a lot more then some simple logs to know this
more specifically you would need to have a network capture at the same time you have a profile capture
im tryna do that rn
how would i do this ive been trying
what do i listen for?
Is there a way to get all the persistent data on an ItemStack?
?jd-s
declaration: package: org.bukkit.persistence, interface: PersistentDataContainer
Gotcha, so no
Well the only way to access it is with the key and type, and the only method for getting all the data is just the keys
🤔
Unless I missed something, which is possible it is 2:30 am
Loop the type too maybe?
I've thought about that but it seems kind of hacky, if I had to go that route, for efficiency, I would just start implementing the major plugins that use custom data. Just thought there would be a method to get the keys and type...
You could check using has(key, type) first
I don’t think there is a method to get the type yeah
lowkey ik im new but does anyone know how how I might go about developing a plugin for beta 1.7.3, I know how to program in java I just don't know wtf I need for that lol
any help is appreciated ty
wasn't beta 1.7.3 still hMod days?
i have no idea lmao
i think there is a version of bukkit, but idk how to get the dev tools etc
I would just find the jar for it and import that
Is there any reason that a conversation would be receiving null as an input immediaitly after starting the cnvo?
https://pastes.dev/5BTsf218H6 that's my code and it just receives null right away
I've messed with the conversation api before and it's not great to be fair, you'd be better off tracking state throughout chat events imo
seems like an ?xy
?xy
Fair, I think I found a solution for it with Paper, ty though
That's accurate
Changing from MessagePrompt to StringPrompt fixed
how to get an entity by entity id. the int entity id not uuid
probably an nms method for that
is it craft or server
server
ServerEntity?
seems like an xy
Assuming it's NPCs again
im trying to get the entity click event
just do your own tracking
I was hoping that if I read the code of a 10 year old project I could replicate it, but I've never been so deeply wrong.
this so hard
SpigotConversionUtil#getEntityById if you are using packetevets
where this from
packetevets
im using protocollib
i have the id i just need to turn it back to entity object
Does it have one?
it have but
now im trying to get the packet when a player use entity
[4113662, net.minecraft.network.protocol.game.ServerboundInteractPacket$1@77c430a7, false]
this is the packet i got
the first number is the entity id
You can just track what npc id belongs to your npc entity
If the entity is spawned in a way that the server knows about it then you can use the servers lookup
if not keep your own
public Entity getEntityById(int entityID) {
return Bukkit.getWorlds().stream()
.flatMap(world -> world.getEntities().stream())
.filter(entity -> entity.getEntityId() == entityID)
.findFirst()
.orElse(null);
}
I have do it now, but this can work if you want get Entity by entityID
i know but he want it
You do not need to filter every entity in the world multiple times per tick
Asynchronous Chunk getEntities call!
...
should i do it in a runnable
No you shouldn't be using that
you have store in a map the entity when you spawn it
and when the server stop you delete the entity
and when the server start you spawn it and restore the new entityid
@viral halo
only at the spawn, you have not to store it in the .yml
why not
just track this yourself
entity ids are not persistent
only their uuids are
Also ideally you'd claim an id for your entity so something else doesn't use it
but you could just put a very large value and hope that many entities aren't spawned between restarts
i have another question, im making npc and use spawn entity packet to spawn it. isnt the npc is just a fake player only appear in client and does not show in server?
I believe you can also do negatives
is only client side if you use the packets
I don't think the client does any kind of filtering, it just accepts it afaik
But then again you could also just use citizens and be happy
^
so i can reuse the same entity id?
you can reuse entity ids yeah
i made the id random on 7digit
client doesn't track ids because it'd be a huge memo leak
yeah, they can just be negatives
yes but with no sense
wait is the eid a varint or u32 or sth
Just no point in storing them in a file to persist during restarts
dunno why we communicate the entity UUID to the client either
They start again every time the server restarts
I usually just pick a number starting from like 100k
if you wanna be extra sure, -100k
i read my code again and found out the entityId doesnt store in a Entity object
?paste
if im making a map to track it is that mean i have to track the entityId also?
send here the code ^
which part
spawn and interact, npc class
oh, yes 
this system is ok, now in NPCCreate, do a getByEntityID like or something like this and do the action that the npc do
npc ecs :)
since the npc is not exist on server theres no point to get the entity object anymore
but i encounter another problem
which?
when im listening the use entity packet, left click will receive 1 packet but right click will receive 4 packet
and it will run the code for 4 time if player right click
im pretty sure i click it one time
i am joking
?paste show code
@eternal oxide
in the NPCClickListener class
could be a polling issue
i feel like right clicking is /faster/ in mc for some reason
but it always 4 packet
[18:24:52 INFO]: [4113662, net.minecraft.network.protocol.game.ServerboundInteractPacket$InteractionAtLocationAction@4d6531d3, false]
[18:24:52 INFO]: [4113662, net.minecraft.network.protocol.game.ServerboundInteractPacket$InteractionAction@772b1f36, false]
[18:24:52 INFO]: [4113662, net.minecraft.network.protocol.game.ServerboundInteractPacket$InteractionAtLocationAction@32789215, false]
[18:24:52 INFO]: [4113662, net.minecraft.network.protocol.game.ServerboundInteractPacket$InteractionAction@55280ed9, false]
those 4 packet
seems fine to me
instead of prevent it
although I generally use a standard listener
I've not listened to packets for NPCs so can;t tell you which packets do come in, but from those packet ids it looks to be two actions
Does the BlockBreakEvent get called for removing blocks using (FA)WE?
Is there a way to increase speed of Phantoms. I tried Attribute movement speed and fly speed but both dont change their speed.
why would you wanna do that to your players
torture
Real
when running a server in debug mode from your IDE, is it possible to tell it to run a function, or does it need to be wrapped into commands?
commands it is
well the thing is that i dont want evaluation, i want to run functions on the server
evaluation can only read
that is exactly what that is
Apparently there is no fix to this. But i found a better torture method. Just instant Teleportation when a Player is targeted.
Do you not want players on your server?
working on a library for that atm but nothing concrete, sry
my approach is to chain vectors and cache the locations that vector hits, then spawn particles at those locations
hi whats the difference between creating a new java thread vs calling Bukkit.getScheduler().runTaskAsynchronously()?
according to the forum scheduler uses a threadpool and therefore is easier to create for the server
alright
Create a thread if it will be running for a very long time (up to permanently), use thread pool if it's short lifed
oh, in that case, ill use a thread
its a permanent task
side note, according to a different forum thread, Schedulers are dealt with by the server on shutdown, but im not too sure how relevant thats for you
basically, what i am doing is i am running a binary program (with java Process) when there are no players on the server and that programs runs until shutdown
then you don't need a thread
just don't call waitFor on the process builder and just ask the process to shutdown once onDisabled is called
wait does processBuilder.start(); create a thread automatically?
if so, then you are right
it doesn't, because there is no need to
it just creates a different process
and won't block the current thread unless you call .waitFor()
okay i see
does anyone know if I can use protocollib 5.0.0 to change the skin of a player who entered from a non-premium launcher?
Check how SkinsRestorer does it
if i want to make a 1.8.9 plugin i need buildtools, but when i set buildtools up should i download thbe latest version of buildtools? will the latest version work wih 1.8.9
yes
also buildtools isn't required to make plugins. You can use the maven/gradle api dependency
(or just grab the api jar)
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
@chrome beacon Any cance you can help me with this? i have tried my best to follow this guide
https://www.spigotmc.org/wiki/buildtools/
https://prnt.sc/KGA9KU_mU8-j
i have git installed but which version should i write? and is this .bat file better than doing it with git? because i dont know how to do it with git
1.8.8
thanks
so exacly does buildtools work with the plugin? it created a folder with a new BuildTools.jar file but how do i use buildtools in a plugin?
okay thanks
So right now this is what my pom.xml looks like
` <dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>``
so what should it be insted?
and when im trying to create a plugin i can choose below 1.18 or something so should i edit the pom.xml to make a 1.8.8 plugin or should i do something else insted?
(or set it to 1.13)
okay thanks alot, only issue right now is that 1.8.8-R0.1-SNAPSHOT is red, is there anything else in the dependency i should remove
reload maven
thanks
uhmm... do you know why it has problems with extends JavaPlugin?
import org.bukkit.plugin.java.JavaPlugin;
public final class Main extends JavaPlugin {
^ do you know why?
you don't need to remove the api-version, it will be ignored in versions before 1.13
So if you are writing against 1.8 just set teh version to 1.13 and it will work on every version... so long as there are no breaking API changes
While you don't need to I recommended doing so otherwise the plugin will only work on versions < 1.13 or 1.21.4
(assuming that's the version set)
if he sets it to 1.13 it will run on all versions, and no nag warning on newer versions
also true but you will have the compat features for old versions disabled
yep
so what would be the best to do?
somehow it cant find bukkit, (org.bukkit) so it cant load javaplugin
?paste your pom
im nly going to run on 1.8.9
then set java 8
but i have downloaded java 8 like an hour ago
your pom says it wants java 21
alr thanks
do i need to change all these things every time i make a new plugin?
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
depends what you want it to run on
it still dosent want to work
https://prnt.sc/DNU1eldY2EV8
What IDE are you using?
did you click the refresh icon in teh Maven tab?
Yup, i already did that and it has refreshed
right after he refreshed it didnt give and error but 10 seconds after it was done refreshing i got red againb
wish we had a file.toString
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
struggling to get the dependencies of this specific nms module to work dont know why even if i have the right corresponding jar
https://cdn.discordapp.com/attachments/731716941022101627/1330540157446651965/image.png?ex=678e5995&is=678d0815&hm=5ab2fe5c7c1bbe7378902005941258d8f2a45f8b8aa46fe3e72c7ed5d4b047d5&
https://bytebin.lucko.me/HmfqDnNZQN
Files.readString?
but like yeah if you go and show the most contrived example things are gonna look obtuse
Could you send your pom
how do i make a file where i can write the permission and use it in the plugin so when you update the permission it also updates ingame with the new permission
doesnt accept a file, only a path. can i assume bukkit paths work for that then?
file toPath()
ok wtf
lol
?
I guess it doesn't like the missing braces?
it does not
I mean the compiler won't either so lmao
its now saying that i should log better
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
yeah thanks
unrelated, but can i pause as i would with a breakpoint without having a breapoint set? theres some things i need to test but i dont want to make a command specifically for that
aka unit test
i have a parser method and want to check it withouthaving to add other possibly erronious code
well my idea was run the server pause it and run it from console
coz its public static
ig that would work
well crap
Just breakpoint something
There is one thing i dont understand.
How is it being saved, im a bit confused abut what it says, should i save it every time or after i add something to it or something?
And if i want to add a value to the config to the file can i do that with a line or do i need to do that manual?
And when i have done something with the config should i save it every time after?
what
config values exist in the config file on the drive, and in memory in the YAMLconfig
you need to save whenever your plugin or the server shuts down, though it might be a good idea to do so sooner
I added the build.gradle.kts files and etc by hand
and intellij well
did this
also the shadowJars do not include my very own source code
tbh I'm not sure which shadowJar is even the correct one
so waht do you exactly mean with that? where in the plugin should i write a line that saves the yaml file?
onDisable is good
yeah but like, is it the only place where i should save? im just curious since they dont wrinte it in the config toturial
where can i download the 1.21 spigot?
well, my recommendation is to immediately save. ondisable can interfere with administrators trying to edit it
look up buildtools
how do i listen for packets from specific entities?
do i need builttools.exe or .jar?
so if i want it to install it in my server i need .jar?
how do i make a regular vanilla server a spigot server then/
buildtools creates a server jar
The people at WorldGuard Discord refused to help me because I'm targetting old version of Minecraft. Perhaps I'll have better luck here.
I'm first time trying to use WorldGuard API. And everything is ready to go. No warnings, no errors.
But when I try to compile I get:
cannot access com.sk89q.worldguard.WorldGuard and nothing else.
pom.xml:
https://gist.github.com/Pilvinen/865dd283d5b1e3544fd6650b8e8f1d35
code:
https://gist.github.com/Pilvinen/41c92f199011ec3e59fc69ffabee8e29
how do i listen for packets from specific entities?
protocollib might have what you need
I have to create a code that doesn't make me hungry and doesn't make me take damage, how do I do it?
im using it, but could you give me an example?
Hook up to damage and hunger events and cancel them.
how?
i was saying that lib coz i remember it being written to not have to use nms, i dont actually know how to interface with it properly
oh
i need to make a listener ?
You ignored the outdated java version hint... newer wg versions are not compatible with Java 17
thx
Hmm. The WorldGuard seems to be working on my server, though 🤔
i got this error
like this?
@EventHandler
public void onHurt(EntityDamageEvent e) {
`package me.machetifumi.czhub.listeners;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
public class PlayerEventListener implements Listener {
@EventHandler
public void onEntityDamage(EntityDamageEvent event) {
if (event.getEntity() instanceof Player) {
Player player = (Player) event.getEntity();
event.setCancelled(true);
if (event.getCause() == DamageCause.STARVATION) {
event.setCancelled(true);
}
}
}
}`
What java version does your server use?
yeah like that
Oh, actually. It seems to be on Java 22.
tanks bro
Target java 21 then...
anyone know how to fix this error?
?paste
fixed
what is the best way to check if the player has any permission?
Im doing a gamemode plugin
and this is what its currently looking right now
https://paste.md-5.net/esisezikad.java
But i need help with how to make it better and to setup the config file and when to save it
Main class:
https://paste.md-5.net/jopotecome.java
Excellent top notch 100% advice, bro. The project compiles. Would recommend 👍 ✅ 🤑 💰
Thank you!
now i get this error
@chrome beacon can you please help me with this
Send the error log
this is the only thing i get in my screen
Should be log txt in the folder where BuildTools is
?paste
it says something the wrong java but i have java 21
Calling hasPermission is what you need to do
On the options tab at the bottom right override the java it's using
is this beter? my problem is just how do i get an value from the config file? becuase how to i save it?
https://paste.md-5.net/isodudamuy.java
On the website its saying something but its confusing me and i dont understand when the config file should be saved
And should i write the values manual or with a line?
idk if this is how you should listen...
You have Java 8 selected
also is that a 32bit Java 8 install 💀
@chrome beacon Any chance you please can help me with this config file and this saving thing?
Config needs to be saved after you've modified it with code
but where do i do that?
is it onDisable?
or anytime i use something from it or what?
You save it when you want it to be saved
In the code you've sent you don't need to save anything
because you haven't made any changes
and what exactly is a change? is it when i use a value from the file should i save after that?
or is it only when i add something to it?
and should the file be saved in onDisable?
No
When you add or set a value
Save it when you're done adding to it
okay thanks
do you know why i cant add anything to the config from the main class? when im trying to use getPermissionConfig i just cant then im getting this:
public File getPermissionsConfigFile() { return permissionsConfigFile; }
and if i dont tab it its just red
it keeps giving me the same error
can someone help rq
https://paste.md-5.net/oqavurinow.java
i installed java 21 and it only detect 8
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Also I suggest you start a bit with Java before using Spigot
You'll have to manually point it to the java.exe
hey guys i asked chatgpt a java question and it took over three minutes to answer
java's shit to code in even for AI apparantly lol

