#help-development
1 messages Ā· Page 1104 of 1
deal more damage
In the damage event check for https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDamageEvent.DamageCause.html#DROWNING and increase the final damage
i meant more like
taking less time to reach default final damage
idk how to explain myself
ohh ok
š¤ how would I rotate it a lil more to make the center face the target instead of the corner
don;t target the location of the player, but center it
the Player#getLocation is the players corner
I thought it was. same as blocks
With blocks it's understandable because locations get floored
blocks also have a BB
I believe the problem comes from display entity rotation being applied from the corner
Yeah player location should be the center of the lower bounds of their bounding box
okies
elgar spreading misinformation !!
yep, sending everyone off in the wrong directions
I should start charging you 5 bucks every time I correct you
I'd start using an alias
So this issue is just @echo basalt being bad at math then š¦
how would i like remove colors from a string
ChatColor.stripColor
can i do it in an if statement
with a . thingy
if (meta.getDisplayName()..contains("Pig Head"));
lol
i would like to do that but the item i want is colored
yes
?pdc
if (ChatColor.stripColor(meta...).contains)
there's no good reason to do those checks. ever
why
because we have a proper solution for identifying items, entities
too early version for pdc?
its a player head
idk is 1.8 early for that
sorry, how do i fit these kinds of listeners in here?
public class Drowing implements Listener { @EventHandler public void onDrowing(PlayerJoinEvent e){ Player player = e.getPlayer(); player.setRemainingAir(0); player.setMaximumAir(0); } }
I only know "public void" š«
um, fix what?
yeh it seems fine
did you register the listener/
I wonder what setting maximum air to 0 does
is the listener registered
yes
Too old! (Click the link to get the exact time)
can i send a gif which shows exactly what im trying to recreate?
im trying to make player drown REAL quick
declaration: package: org.bukkit.event.entity, class: EntityAirChangeEvent
hey! im new to plugin development and want to start coding in kotlin! im looking for some resources that'd help me learn the language (specifically for plugin development) or advice on it. if any of you have resources youre willing to share, id more than appreciate it!
the bot should laugh when prompted with ?learnkotlin
hm
Itās like the potato snapshot
new pfp
no link
just go
real answer i know is just look at some kotlin spigot code and look up what the operators do
EntityPlayer nmsPlayer = ((CraftPlayer) player).getHandle();
// Get the current food level and saturation
int foodLevel = nmsPlayer.getFoodData().getFoodLevel();
float saturationLevel = nmsPlayer.getFoodData().getSaturationLevel();
how to fix this
spigot 1.18.2
why does your profile pic look like if @tender shard was normal
- Fix what
- Why not use the api?
Cannot resolve method 'getFoodData' in 'EntityPlayer'
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
I don't know how to do it correctly
and how it works because I don't know how to search after this
Again why not use the api
I need to do it via spigot nms to packets
I mean you can still use the api methods
Itās just numbers, you can still pass them to whatever packet system you are using
Class:
if (xpneeded <= xp) {
System.out.println("Experience is higher");
p.sendMessage("§4§l(!) §4No XP was gained because you have hit the maximum xp for this level.");
p.sendMessage("§d§l(!) §dYou have sold " + ChatColor.LIGHT_PURPLE + item.getAmount() + "§d§nPig Heads§d for $" + ChatColor.LIGHT_PURPLE + moneyGained);
econ.depositPlayer(p, moneyGained);
}```
Config:
```pig:
sellprice: "1999999"
tier: "basic"
displayname: "§d§nPig Head"
lore1: "§d§l* §7Required Level: §d1"
lore2: "§d§l* §7Head Price: §d$2"
playername: "MHF_Pig"```
Error:
```class java.lang.Integer cannot be cast to class java.lang.Double (java.lang.Integer and java.lang.Double are in module java.base of loader 'bootstrap')```
anyone know how to fix? i cant do econ.deposit unless the argument is a double but the config isnt a double
why not use getFloat instead?
does getDouble exist?
it does in 1.8.8
š
i have created some items with my plugin but how to apply resourcepack to these items? i am not good with resourcepack so i dont know how to do it. does anyone know how to do this?
There is a tag on ItemStacks called CustomModelData. You can set this tag via the Spigot API and write a predicate in your model.json file within your resourcepack.
Here is an example for this:
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "minecraft:item/paper"
},
"overrides": [
{
"predicate": {
"custom_model_data": 1
},
"model": "minecraft:item/iron_pp"
},
{
"predicate": {
"custom_model_data": 2
},
"model": "minecraft:item/gold_pp"
},
{
"predicate": {
"custom_model_data": 3
},
"model": "minecraft:item/diamond_pp"
}
]
}
This will override items of type PAPER if they have a custom model data of 1, 2 or 3.
Just make sure the referenced files (in this case iron_pp.json, gold_pp.json, diamond_pp.json) are in their proper location.
thank you very much i understand how to do it
Ignore it
heh, pp
DIAMOND pp
i just did B)
@worldly ingot ban this filth
D:
this one is going into my "cancel ImIllusion in 2045" folder
alright cool I solved the mystery of the broken textures, turns out I was the murderer all along
can i somehow instantly try out the plugin im working on? (im sorry if i have stupid questions im used from making mods)
debugging the smallest things takes so much time
hotloading
whats that
you know loading? imagine if it was hot
what ā ļø
using Jetbrains JDK, you can hotreload most stuff
remote hotswap tl;dr:
- download the jbr runtime from here https://github.com/JetBrains/JetBrainsRuntime/releases/
- download hotswap agent from here https://github.com/HotswapProjects/HotswapAgent (read the "Easy to start" section)
- in IDEA, right beside the "Run" button, click to edit configurations, click to add a new configuration, "Remote JVM Debug"
- copy the remote JVM command line arguments
- on your server command line...
- Use jbr runtime's
java - Add
-javaagent:hotswap-agent.jar=disablePlugin=Log4J2 -XX:+AllowEnhancedClassRedefinition(I think you don't really need to put it in thehotswapfolder considering you are specifying the agent manually?) - Add the remote JVM command line arguments that you copied from IDEA
- after the server started, "debug" the newly created configuration, it will attach to the running server
- recompile a class
- success (hopefully), you may need to manually reload the classes in Run -> Debugging Tools -> Reload Changed Classes
note: you need to use a mojmapped server (iirc)
there's more info about remote debugging in IDEA here: https://www.jetbrains.com/help/idea/tutorial-remote-debug.html#create-run-configurations
it allows you to swap code without having to restart the server
I mean, sure
soo how do i do it
buddy it doesn't matter if you're hosting it on your pc on on elon's secret martian space station, you're still running server software
yess but i just meant that im still keeping the jar on my pc
like i dont need no transporting things i dont really understand those instructions but it sounded like it
does that one support new method and class creation, I vaguely remember you had to use a specialized one for that at one point
and I should really redo my setup
are yall speaking english at this point
come back when you are not, in fact, 10 years old
<properties>
<dir>${project.build.directory}</dir>
</properties>
<!-- make sure to replace the version of the maven-jar-plugin, you already must have it in your POM -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>YOUR_VERSION</version>
<configuration>
<outputDirectory>${dir}</outputDirectory>
</configuration>
</plugin>
</plugins>
you must be fun at parties
tysm
all i needed
you still have to do -Ddir=path/to/server/dir in the run configuration though (so, it'd be mvn -Ddir=... clean package)
if you don't want to do that, just set the value directly in the pom
that is, change <dir>${project.build.directory}</dir> to <dir>path/to/server/dir</dir>
yes, the jetbrains runtime builds on DCEVM's advancements on that area
wait so is this all
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<outputDirectory>C:/Users/PC/Desktop/Servers/1.21 spigot server/plugins</outputDirectory>
</configuration>
</plugin>
</resource>```
i dont have anything in the properties
<properties>
<java.version>21</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
oh yeah it works thank u so much
Hi! I'm trying to set an item to an ItemDisplay via packets, and it works fine, but when I try to set AIR, it doesn't work. It only works when I set a material that isn't air. I assign the ItemStack this way and then send a PacketPlayOutEntityMetadata to update the entity. Does anyone know why this is happening?
why would you set an item display to air anyway
if you want to hide it, just delete it
Yes, the asNMSCopy method already returns an empty ItemStack if the original was air. I even set it manually, but it still doesn't update. It only updates if I set a non-empty ItemStack
anyone know how i can like
make it so that there isnt so many ifs
i need 15 of those
I think in my case it's better to just hide it since there can be empty slots that change to have an item while this is open. I could simply create a new entity if the slot has an item or not, but I believe it's more efficient to just send an update rather than create a new entity and update it
don't use the lore for storing data
use PDC
lore is just display
Can I use native methods in my plugin and upload it to spigotmc?
I mean we generally advise against it because you often don't really have any reason to whatsoever, but if you have to, you have to
There should be an obvious reason to have to use them, otherwise it might just get flagged as malware and deleted on suspicion of that being the case because decompiling native code is a bit more of a pain in the ass to review
Would a native obfuscator like jnic be allowed?
Almost definitely not :p Again, I see no true benefit to using native methods here
There is no benefit, i'm just curious that's all!
If it's just curiosity, then the answer is no :P
Again, only really in the clear if it's obvious to use native methods - accessing APIs that are not available in Java. Which is rare for a plugin to need
That's interesting but makes sense
you could use ternary operators
but i dont think its necessary
I donāt know how
does anyone know how to make it so only one mace can be crafted on a server
I donāt see how this would help either
Iāll have a look
Okay hear me out
The java plugin uses JNI to interface with some C++ code that starts a python script. The python script makes a web request and the web server utilizes PhP and JavaScript to query a value from SQL and return it. Then the python script saves this value to a file and starts a unity (C#) game that reads said file. Then perhaps we have some sort of AI made in Haskell that plays the game, once the AI wins a signal can finally be sent back to java for the plugin to utilize.
okay im not 100% sure if its gonna work, but something like this?
String itemType = ChatColor.stripColor(meta.getLore().getFirst()).contains("Required Level: 1") ? "pig" : "sheep";
System.out.println("Item Checked");
Double moneyGained = this.getConfig().getDouble(itemType + ".sellprice");
p.getInventory().setItemInHand(new ItemStack(Material.AIR));
String itemName = itemType.equals("pig") ? "Pig Heads" : "Sheep Heads";
p.sendMessage(xpneeded <= xp
? "§4§l(!) §4No XP was gained because you have hit the maximum xp for this level."
: "");
p.sendMessage("§d§l(!) §dYou have sold " + ChatColor.LIGHT_PURPLE + item.getAmount() + " §d§n" + itemName + "§d for $" + ChatColor.LIGHT_PURPLE + moneyGained);
econ.depositPlayer(p, moneyGained);
if (xpneeded > xp) {
System.out.println("Experience Is Lower");
playerLevelManager.setXp(playerLevelManager.getXp() + item.getAmount());
} else {
System.out.println("Experience is higher");
}
setscore(p, playerLevelManager.getLevel(), playerLevelManager.getXp());
you'd be storing the level as an integer (or a byte even, since you don't need more than 255 levels) and thus be able to do range comparisons
It was vulkan
But surely I would still be running something 15 times which would make the code really long
Vulkan sounds right
you can have a List<Integer> where you populate the XP needed per level and then it turns into a single code block
Quick question with storing YAML. If i have a ConfigurationSection field in a different class aka 'HomesSection and it hasn't created the data yet but i want to call it. how do i do so without it causing a null?
Do i have to always call != null in the if statement?
or is there a better way
if (config.getString("my.settings") != null) { }
otherwise yea it would cause error
Kinda figured. thanks
public static final NamespacedKey LEVEL_KEY = NamespacedKey.fromString("level", myPlugin.getInstance());
private static final int[] experienceRequirement = new int[] {15, 24, 32}; // Each one would be a level, could get this from the configuration too
var level = meta.getPersistentDataContainer().getOrDefault(LEVEL_KEY, PersistentDataType.BYTE, 0);
if (experienceRequirement.length >= level && experienceRequirement[level - 1] < xp) {
var reward = ...;
}
There is also a ConfigurationSection#isConfigurationSection(String) which does a null check if I'm remembering correctly
Yeah, it exists and does, but also checks if a default value exists. If you don't want to check if the default exists as well, there's a contains(String, boolean)
Yup like if (config.isConfigurationSection("my.settings")) { } @viscid carbon
You can set that boolean to true to ignore the default
implicit null check yeah
ok i remember my problem, yes i tried but, i want to posicionate them under the player name, but if i use \n They will appear strangely, going through the player's skin, they do not fit under their name correctly.
that'd be two calls to get though, kinda annoying
value would most likely hit cache so it wouldn't matter but still
That's fair
Right it would get stored in memory, but for the homes plugin he wants probably have to grab the latest config. i think for performance id try to do other checks to return, above any file touching
bump (sorry)
Ooo what are you doing with this? It looks cool
In Vanilla Minecraft, when a player punches a boat, the boat rocks / wobbles (for a lack of better words) on its side. Is there a way to invoke this rocking movement without the boat being hit, In Spigot?
I would assume this animation could be sent via packets, otherwise I donāt believe there is a method in spigot api that does this
Are Boat entities marked as damageable?
Maybe Iām wrong hopefully Choco knows
Because my immediate thought is a call to damage(1) or something if so
Otherwise, no. No API for that. But there probably could be
I will look hold on
I don't see it inheriting from Damageable so probably not. I think Minecarts have the same behaviour though, yeah? So might be worth adding a new interface for that and having boats and minecarts both implement it
I really have no idea. I've been trying to manually do it by changing the velocity of the boat, but I can't get it to look natural.
Why do you want the boat to rock tho? if you seek animating blocks and items youd be way better off using display entities
No I do not see anything relating to damagable within boat
I'll find an internal method for it you can call
Trying to make a boat appear to be hit, after ridden in. it has to be a functional.
Thank you so much, I appreciate your dediction
W Choco
What do I do with this
it was an example
if you go about it that way, you can avoid duplicating your code
you'd have to understand what I am doing there though, as it isn't complete
Looks like EntityVehicle (and consequently, EntityBoat) has a setDamage() method
I feel like that would relate to damage of boat, would it invoke the animation?
Really? So the animation could be played by inducing damage?
Not entirely sure what the max value is, but I see setHurtDir(), setHurtTime(), and setDamage() all being used for the animation
Potentially calling animateHurt() is what you want
ah
The float parameter is unused for boats. So probably ((CraftBoat) bukkitBoat).getHandle().animateHurt(1.0F); would work?
Hey choco, if you know enough about hp skyblock, would you say it's got semi rpg features?
Oof. do I gotta use NMS now?
SkyBlock is almost definitely an RPG game
Right
hypixel skyblock is literally rpg
Yeah, unfortunately we have no Bukkit API for the vehicle damaging stuff. We can probably add API for it though
Just need to figure out a good way to expose it
I don't play minecraft man I literally own it to test plugins nowadays
How does adding stuff to the bukkit API actually work? I'm curious.
Im not sure its worth wasting your time adding something for a single usecase.
We add methods to the Bukkit interfaces, then implement them in CraftBukkit
Not terribly difficult, it's just a matter of figuring out what methods to add to make it easy to use
This one is less to do about use case, more about quality of life
Why wouldn't you make it easy to do this
Seems even Paper doesn't have API for this
What if theres not only one use case for this
nmsBoat.setHurtDir((byte) 1);
nmsBoat.setHurtTime(10);
nmsBoat.setDamage(10.0F);
nmsBoat.animateHurt(1.0F);
I suppose this works for now
Yeah that looks about right, but animateHurt() does those first three things already
@Override
public void animateHurt(float f) {
this.setHurtDir(-this.getHurtDir());
this.setHurtTime(10);
this.setDamage(this.getDamage() * 11.0F);
}
Eh I guess maybe it doesn't set the damage lol
You probably don't need to call animateHurt() at all. That might just be called automatically on tick
how do i make a command completion without players being able to actually complete a parameter using tab?
setHurtDir(), setHurtTime(), and setDamage() is likely all you need
Not sure why it multiplies damage by 11 though
yeah thats odd
Maybe boats just have an ungodly amount of health for some reason
:p
I actually think they do. Or atleast they take a lot to break with a single hit
Probably should expose some API for bubble column stuff too
e.g. whether or not a boat is being rocked by one
What makes something worth it to expose in the api?
when it's supposed to be private š«¢
General rule of thumb is that we don't expose it if it's (a) a client sided value (because the server and client are merged together so we have lots of client-sided elements), (b) it's an implementation detail (like NBT), or (c) it's just not really useful at all for anybody
I seem to recall sometimes it might be because it's too dangerous or misleading
That as well, yeah. There are some values that you can set that just get reset on the next tick or something
mmmh portal tick countdown or whatever the hell that was
In general terms of an api, what makes these "private" bits actually needed to be private?
Apart from the dangerous / misleading reason, I can understand a couple of those for sure
That is a pretty cool way to do an interface
textdisplay?
I couldn't solve this, but I used the setViewRange method. Setting it to 0 makes the entity invisible
yep
sendEquipmentChange not being persistent š
speaking of cool models rate my timelapse for random b-roll for my video
I guess take for example an entity's NBT data. We absolutely could expose it with the PersistentDataContainer, or some wrapper for NBT data, but... that's kind of gross and awkward to work with. We'd rather just make concrete methods like getHealth() rather than getNBT().getInt("Health");
I mean neither is sendBlockChange()!
Good workaround
but sendEquipmentChange could totally be tho, it is easier to track (from within the impl)
It would be the only outlier in the sendX() methods. You could also track it via your plugin so
Especially now that we're working on adding the equipment change event
So it's basically just a structure of implementation, base api / impl, and build on top of it to make it better
'member how you were going to add pathfinding?
We just don't want to expose anything that feels like it doesn't need exposing, or is really difficult to expose without just making it feel like it doesn't need to be there
I 'member
that event not working when plugins use setType is wild to me still
Yep fair enough, thanks for the explanation ā¤ļø
The way I was exposing pathfinding was kind of bleh. I would definitely revisit that with a different angle of attack. Like an NBT API was also never going to happen, but then PersistentDataContainer was birthed and it just made a lot more sense
Now we have an NBT API without exposing the NBT values that plugins should be using API for
you can steal my code for it if you want
We don't want plugins to be able to get/set the NBT of entities directly
problem is you're not going to make a good api for this without messing with brains and goals
Yeah
if we had brains and goals we would be golden
It's hard to abstract out the vanilla goals as well because most commonly that what people would want to use, is the vanilla goals
e.g. make a skeleton follow you
could just look at Paper's design and improve upon it
We avoid looking downstream for API in fear of legal issues
I don't particularly like their mob goals API, feels like a direct replica of the server code
Yeah and my initial attempt was also pretty 1:1 with the server's internals
Which I hate, looking back at now
though it exists, so better than nothing
the only abstraction you can make from that is trying to implement brain logic into goals or vice-versa
so there's only one system
I think ideally plugins have no concept of brains
and you're still going to run into oddities if you do that
eh, does brain system mess with goals at all, I wouldn't like that
Brains seem like an internal thing to me - and if I recall correctly, not all entities have that brain system
oh buddy but you do realize those who have brains don't have goals
right
we don't get to pick just one
if we did this would already be a done deal
I haven't really looked at the brain stuff, came way later when I stopped messing with plugins
it's been a little bit since I last directly worked on it but goals are the most basic ai priority system imaginable and brains are mildly more nuanced, but there is no intersection where both function at once
you will not be able to make a comprehensive ai system without doing both
Well brains are meant to be the replacement, right? They're just doing it slowly
and you will not be able to abstract away the fact some use brains and some use goals without losing some of the nuance of how they work
š¤”
that is fair, but honestly kinda sucks overall. Would've rather the community was more tight-knit in this aspect and the different bukkit forks would decide upon standards instead of each one going with their own
Ideally Paper contributes upstream
but then mojang reworks mobs and doesn't change them to use brains
But they seldom do
as a matter of fact mojang is still releasing new mobs with goals
because they're just variants of other mobs that use goals
so it's not the new system, it's just the new competing standard
they've got very different views on what makes a good API for the platform, so it's only understandable to an extent but yeah, at this point I don't know what they think about that but I am not in the Paper team to know
I did look at their api and it's not a good solution for broader use because the mojang code was never build to be expanded upon by plugins
if we want a solution premium pets plugin #1290131 can get to work within a few hours of starting we would probably want some kind of way to abstract away from the internals
it's also made more complicated because not everything across these two systems is cancelalble to the same extent or in the same way
And then again you run into the dilemma of having to expose vanilla behaviours but those technically including implementation details
That was my biggest hurdle was allowing developers to construct vanilla goals and use them, but I couldn't think of a way to do that at all
You'd also have to be able to expose them somehow with a getter - e.g. a way to get a list of all goals from an entity. That was difficult too because mapping those sounds like a nightmare. Maybe there's a clever way to do that with patching though
I don't know
Behavior(priority);
@Override
doBehavior(){
...
}
imo
and forget about using the vanilla ones
just create your own abstraction and re-implement every single goal š
Yeah but not being able to use the vanilla ones would mean you'd have to, as a plugin developer, reimplement the existing behaviours - even simple ones like following an entity
Which just kinda sucked
I know 
also this could be a problem that solves itself as once the ball gets rolling the path to implementing vanilla goals might become clearer as people use it
imo unless you want to expose implementation the best you can do is provide some api defaults for common goals
no one's stopping you from making a FollowBehavior extends Behavior
I mean one big PR at a time. The components API has been like 2 years in the making lol
is what I would say if I didn't already solve this for myself with my own nms library
IT SOUNDS LIKE YOU HAVE ALL THE ANSWERS >:((
I mean sort of
md5 did ask if I was going to pr it
but I don't know if it even fits
hey now I've heard that one before

I've never done a PR
but regardless I'm not convinced my solution is the best solution
like how do you even scale this up for the api
I think even just adding 3 presets would cover 80% of use cases
go to x
follow x
attack x
Yeah it's the generifying of things and future-proofing to the best of our ability that makes it difficult
Because yes we could add those 3 goals to start, but we also have to write it in a way that adding the other goals should be trivial
well just keep it very simple
a behavior, a priority, an override for what the behavior implements
I think you need a condition check
to validate if the thing should happen
Maybe one day I'll revisit it. Right now I'm waaaay too busy and stressed with like... life in general lol. I've hardly had time to update any of my PRs to 1.21
and then just do the thing
I mean I guess I could refer to what I did
start, stop, canStillUse, checkStartConditions, and the actual behavior
technically I just run start over and over again instead of a dedicated method for the behavior but whatever
I had a look, this seems to actually not do anything.
or maybe im not adjusting the values enough
nvm, it was the latter.
Actually it seems like I have to. animateHurt on it's own, does nothing.
hey Im making a void world generator here I think theres not any block, how can I replace all blocks per air block?
public class VoidGenerator extends ChunkGenerator {
@Override
public ChunkData generateChunkData(World world, Random random, int x, int z, ChunkGenerator.BiomeGrid biome) {
return createChunkData(world);
}
VoidGenerator voidGenerator = new VoidGenerator();
WorldCreator wc = new WorldCreator("void");
wc.generator(voidGenerator);
wc.createWorld();
}```
what's a good way to store data in a jar? (the jar is a dependency)
i tried making it a class, but it was too large it couldnt be compiled
i tried making it a resource but idk how to retrieve it
it's like 300k lines combined
Class#getResource
or getResourceAsStream
Doesn't bukkit have a method for saving a resource
it's a dependency not related to bukkit
well i'm gonna use the dep for a plugin but i use the dependency itself for other stuff
alr
also is there a way to know when a parallel stream is done
Ah ok
pStreams aren't async to my knowledge - just parallel
they behave like async tho, it doesn't pause the main thread
Well they should synchronize once you perform a terminal action at the very least
Looking at the sources even non-terminal operations should be synchronized (though running parallel)
i'm just gonna use a normal stream, it's afew ms difference anyways
I haven't ever seen a task that really necessitated a pstream
which spigot version?
1.21
you don't need to generate any blocks
just have an empty overridden generateSurface method
thanks
when you execute a plugin maded for 1.20 (example) in an 1.21 server in theory it works how to explain that that the server can execute it? in the pom.xml it waits for the 1.20 if it doesn't find it, it won't crash?
if you built it for 1.20, thats the minimum version it will run on
if the version in the pom doesn't match, it will still try to run it?
Depending on how you write it, it should work on future version, but thats not a guarantee. You need to test it.
to make a lib that we'll implement as compile scope, I just have to add spigot dpendecy like a nomral plugin but without main class and plugin.yml?
somone have a shop like /shop then you can sell and buy
#help-server economy shop gui free or shop gui++ (premium)
i find but i dont know how to fix this Could not connect to a default or fallback server. Incorrectly configured address/port/firewall? io.netty.channel.ConnectTimeoutException i turn off the online mode
Bungeecord or something ?
Post this error in #help-server some ppl will hopefully be able to help you with that
i fix
I installed neovim guys
now learn vim motions and make your own config
if you are going to do java, I would just go for IJ with the IdeaVim plugin
the neovim java scene is still quite rough, same as vscode's though Microsoft is pushing hard to make it work
I have like 4 IDEs, all for different languages (or language groups)
only 4
Yeah I don't work with a lot of different languages
why i get this error with packeteventz?
What the fuck is "cheese"
surprise - a paper fork
custom spigot
Ah those shits again
Well I guess don't run MojangAPIUtil.requestPlayerTextureProperties on the main thread?
Just use proper debugging techniques and you shall be rewarded handsomely, but from the looks of it this is "only" an issue of doing excessive NIO on the main thread
I've done it other times and it worked for me
Well it really depends on how often you run that method on the main thread
damn paper xD
If you think this is a Cheese bug, f*ck yourself
Nah, this isn't paper that included that message
i execute it one time and the server crash
that's like
one as in 10^0 or one as in 10^3?
to be expected
expected under what sense?
web requests are blocking
and can take a lot of time
it's only expected that they can crash the server
Yeah, but if it is executed 10^0 amount of times, it shouldn't take 10 seconds.
This would only be an issue if the server is offline, an event that shouldn't occur most of the time.
And it would need to be a specific kind of offline where the connection is never interrupted/closed
That's one of the reason I don't do yaml these days
load a class?
it's literally set to true in the config
affirmative
I invoke a method it has
and that makes it load
but when I debug it in the same method
I guess you could do a Thread#dumpStack() in the clinit and see whether the stacktrace aligns with what you expect
Constants should be uppercase with underscores, not camel case, also send config
it's suddenly true
naming conventions have no serious impact here
no
I have no idea what this code even is
Yeah, then debug clinit via Thread#dumpStack or similar and make sure that nothing in the caller methods have side effects
no ofc not but hey why not
I'm restarted
XD
I should init the config
before these
okay, sorry y'all
I'm just restarted
does not compute but w/e
is there any convenient way to have it throw an exception when I try to read an uninitialized final var?
I mean 0 and null are the same thing after all
then what the hell is array zeroing
uninitialized arrays would be null.
shit, I've done a little bit too much C lately to be confusing 0 and null that frequently.
Only problem is that I have not.
I mean this
Well that is just the difference between alloc and malloc
But 99.9% of the stuff in the JVM is malloc'd
wha-
what's that?
there is alloc?
Two methods to allocate memory
this guy is used once in the whole java lib
and only in the newer versions
Yeah, you shouldn't be using alloc in most cases though - can result in nasty security vulnerabilities if you are not careful
alloc does not zero
what does that mean tho?
what the hell is a "garbage" content?
"Deleting" stuff in RAM is the same thing as "deleting" stuff on disk: It only removes it from some random table - but the actual data might still be present
So that garbage data could be anything, depending on your operating system (most OS zero the data either way).
malloc and calloc you mean?
calloc zeroes
Ah yeah indeed
you'll have to do more c š
I actually never do anything more low-level than java bytecode
that is, I've actually never used C beyond looking at a makefile and wishing I had maven
probably the reason i started making my own build system, cuz makefiles arent particulary fun
plus its code based, who doesnt want that!!
I have tried C and I still have no idea how to use a library
I will need to take a look at X86_64 assembly one of these days though - there is one thing that Java does not have available and that's CMPXCHG16B so I need to write a small library to expose that sooner than later
no jvm intrinsics?
what the fuck is CMPXCHG16B
JVM intrinsics are probably not a thing given that this instruction is relatively "new".
@shadow night should i rename palm to mackingcheese
š
dont start trolling here too
fuck you
you're an opp, as neon would say
i have no idea what that means
whats the event when a player equips a armor piece
done
i did that on my laptop on the train btw
took 50 minutes to compile
Im trying to save my intelji project to github with git Ilinked my github account and tried to create a first commit but because my github mail is private it dont work how can I change the git email to set the github no reply mail in intelji?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
also paper
You cant getConfig statically
You are trying to do it in the initialiser of the variable
private String webhock = plugin.getConfig().getString("Discord.WebHockURL");
private String webhock = getConfig().getString("Discord.WebHockURL");
@drowsy helm
can i use like that?
Just set it in your onEnable
is not working
how do i make a parameter above the chatbox without players being able to actually complete the parameter using tab?
W or L?
also how does linux use literally 360mb ram
my window computer uses like 10 gigs on startup
š
windows has a LOT of useless stuff
how else are they gonna send all your data to Microsoft?
good ol arm cortex a76
how much storage?
Oof - you'll have a lot of fun trying to get stuff updated
?ban @cinder abyss highly inappropriate behavior
Done. That felt good.
i didnt see ):
Why is the PlayerInteractEvent called twixe when i right click a block but not when left clicking or clicking air?
?interactevent
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
what on earth happened there. Eh, I'll not second-guess that
okay thanks
I think you can index in the server on what they said :/
ah, so it's more of a long-term improper behaviour
He sent screenshots with n word today lol
idk 32 or 64 gb sd card
mfw Minecraft will now bundle asm :simon_peek:
wtf
that is rather unexpected
geols happiness intensifies
have you seen a modloader that doesn't ship asm?
From a modder's perspective there is no difference since all modloaders already ship asm
And in the worst case, java already has a version of asm already shaded in
hey
sender.sendMessage("Successfully set the join message to: " + ChatColor.translateAlternateColorCodes('&', message.toString()));
Any one know how to implement a .replace("%player%", .getPlayer().getDisplayName) here?
sender.sendMessage("Successfully set the join message to: " + ChatColor.translateAlternateColorCodes('&', message.toString().replace("%player%", "&o<player name>")));
Will this work? š
sender.sendMessage("Successfully set the join message to: " + ChatColor.translateAlternateColorCodes('&', message.toString().replace("%player%", sender.getName())));```
yeah
lmfao
yes time to do this
the message.toString() part is slightly concerning me.
yess it worked
yippee
why?
should i do a
finalMessage = message.toString()
then use the finalMessage
nah, it really depends on the datatype of message. It's okay if it is a CharSequence or a StringBuilder, but any other type is a bit concerning
oh well its a StringBuilder so no need to worry
:)
Guys, i think i got a headphone dent šØ
always have been.
It's not like I'm using my PC setup on public transport and stuff
lmao
anyways
i really dont wanna spam this question much but i literally cannot find a single answer anywhere..
how do i make a parameter above the chatbox without players being able to actually complete the parameter using tab?
parameter in what sense? Is there a vanilla feature that comes similar to what you intend to do?
like for example the /summon command shows you "[<nbt>]" but you cant really press tab on it
My guess is that the bukkit API does not expose this and that either you need to find a wrapper library for that or using brigadier directly.
yes, you can't do that with the api
unless you are using a certain downstream fork but we don't talk about that
no i got a headset, how would i get a headphone dent without a headphone
lmaoo
yeah? Like any sane human being?
im alan
im fahi
cooool
so coool
At what knowledge level, would you classify someone as a intermediate or someone who knows how to code minecraft plugins?
I'm not artistically inclined nor am I a musician, hence there most likely is little for me to distinguish in the first place.
And being with headphones makes me really uncomfy. Blame autism here again I guess.
guys, is it a bad idea to make a paper plugin instead of spigot..?
Once they know how to work with the online javadocs and their buildtool of choice (that is, maven or gradle - neither Eclipse, IJ, Netbeans, nor ant counts here) it ought suffice on that front
i think yes, because not everyone uses paper yk
true, imma forget abt that
i see, what about advanced?
Hello i have a question.
@EventHandler
public void onPlayerDropItem(PlayerDropItemEvent event) {
Player player = event.getPlayer();
ItemStack item = event.getItemDrop().getItemStack();
ItemMeta meta = item.getItemMeta();
if (meta != null) {
String displayName = meta.getDisplayName();
if (MAGIC_WAND_NAME.equals(displayName) || CHEST_OPENER_NAME.equals(displayName)) {
event.setCancelled(true);
player.sendMessage("You cannot drop this item!");
}
}
}
i have this event that cancelss the dropping of 2 items and it works but if i go to my inventory go to the item and press Q there the message that i cant drop it comes but the item dissapears why?
depends for what end. If you have the choice I'd say it's always better to make a paper plugin - but of course stating that on this discord doesn't really fly well here.
yhh i just realized that, but i just found out theres " Aikar's Command Framework" which can help me so nevermind
also sorry for pinging
wait is it paper only
Spigot's default command framework vs Aikar's command framework: Stay tuned to see who wins!!
pls help me : )
Mastering the event system, being able to use asynchronous tasks, understanding classloading and having a firm grip of other java features, etc. etc.
Maybe even having a good inuition of the inner workings of NMS but it really depends on where you draw the line. I generally prefer to exclude NMS since you can often get well by without it.
Does it disappear as a ghost item or?
it just dissaperars its not in my inv and not on the ground
darn guess im beginner-minus-minus
i think geol is just an expert-plus-plus
keep in mind that I haven't actively written bukkit plugins for a few years now.
Brother you are everywhere
I'm chilling in fabric and spigot and you are in both
Also, I have no clue about the inner workings of NMS (though it's not like that is a terrible issue since the bukkit API is incredibly powerful and I already have decent experience with java reverse-engineering proguard-obfuscated applications)
Yeah, even though I'm not using either - kinda ironic lol
damn š
The western galimulator community is mostly dead though so I don't really have a home hence I'm here.
There is still a larger chunk surviving on the other side of the great firewall, but that is a place which is a bit hard to reach.
no idea what all that means but ok
I mainly mod galimulator (a rather shoddy game written in java), that's probably the only thing you need to know
Hello so i am developing prison kind server and got some problems like without op i can place blocks in my guarded region even if i disable it or can't use rankup command but it works when i am op would be nice to get some help some pm me maybe you could help me a bit š i struggle with some things even like i can't make that without op people could use workbenches or something like that when flag is allowed
wrong channel
stay in #help-server
anyone else had issues with intellij taking a long time to open after the recent update
idk why but mine is taking like 2 mins to startup now
For anyone who uses WorldGuard, when do I register custom session handlers? I can't do it onEnable because it gives me an error saying WorldGuard is not loaded yet, or is there a way to wait until WorldGaurd is loaded?
Add WorldGuard to your plugin.yml dependencies
I did, its a soft depend
Then your plugin will load after WorldGuard
Thats what I thought as well but it doesn't, it loads before for some reason
They asll seem fine to me
uh I see
Yes it is. I put it at the bottom thinking it might help as well š¤·āāļø
Is WorldEdit installed on the server
Yeah
what even made you think that was kotlin kekw
WorldGuard does load, it just does after everything else already has
right I missed that
var maybe?
its really helpful tho ngl
The unwanted child
var in java is great
remove load: STARTUP for your plugin and it'll work fine
if you don't need to be enabled before the server its kinda pointless
if you do you'll need to lazily initialize world guard. As long as you can ensure you use it AFTER the world is loaded
Yeah it works, thanks! thats 3 hours im not getting back.. š
happens sometimes lol
Could be worse could spend 3 hours only to find you spelt a word wrong and it wasn't being spell checked
True lol, pretty sure it got added because of the Minecraft Development intellij plugin
is there a resource on coding phase based ingame gamemodes?
not really, but I always did so at work with a pretty simple GamePhase interface
I can't imagine it'd be much more complex unless you're dealing with a heavily multi threaded environment
something like
public interface GamePhase {
void enable()
void disable()
void cleanup()
}
I always cleaned up events and such with a cleanup method
unregistered them and such
yeah yeah
im thinking like i want to make an events framework
where there is different team setup phases
then the actual game phase
then a callback for when its over
Am I missing something or when setting new spawn location of PlayerRespawnEvent or PlayerPortalEvent, functions #setTo and #setRespawnLocation, if player doesnt have bed, server sends message: You have no home be or charged respawn anchor, or it was obstructed.
I also saw this in #news on spigot page:
Mojang recently released Minecraft 1.21 and the first builds of Spigot for this version are now available. As expected given the short time since 1.20.6, this release mainly just moves the experimental 1.20.6 features into the main server. There are however some underlying changes which you should keep an eye out for, particularly to teleportation between worlds which may have some as of yet undiscovered bugs.
https://wiki.vg/Protocol#Serverbound_Known_Packs when was this added?
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Plugin plugin = myplugin.getPlugin();
if (sender instanceof Player p) {
Location location = p.getLocation();
plugin.getConfig().set("spawn.x", location.getX());
plugin.getConfig().set("spawn.y", location.getY());
plugin.getConfig().set("spawn.z", location.getZ());
plugin.getConfig().set("spawn.pitch", location.getPitch());
plugin.getConfig().set("spawn.yaw", location.getYaw());
plugin.getConfig().set("spawn.world", location.getWorld().getName());
//plugin.getConfig().set("spawn", location);
plugin.saveConfig();
p.sendMessage("Spawn location set!");
} else {
Bukkit.getServer().getConsoleSender().sendMessage("Only online players with administrative permission can execute this command!");
}
return true;
}
}```
never worked with spigot's serialization interface, but can anyone show me how i could serialize these .set(spawn.args)
does anybody knows why bungeecord return nullpointer when i try to get a playername?
did you check if it is actually an instance of a player before trying to get its name?
if the player is not connected you can;t get its instance
is connected
?paste stacktrace
return value of "net.md_5.bungee.api.ProxyServer.getPlayer(String)" is null
ah my bad
you are using a string not a uuid
no
Not sure if this is the place to ask, but I have a ProtocolLib question.
I'm trying to make a TEXT_DISPLAY via packets. I'm having issues with the ENTITY_METADATA packet. I'm trying to set the text of the display like so:
PacketContainer packet = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.ENTITY_METADATA);
packet.getIntegers().write(0, this.entityId);
List<WrappedDataValue> metadata = new ArrayList<>();
WrappedDataWatcher.Serializer chatComponentSerializer = WrappedDataWatcher.Registry.getChatComponentSerializer(true);
Optional<WrappedChatComponent> optionalText = Optional.of(this.text);
metadata.add(WrappedDataValue.fromWrappedValue(23, chatComponentSerializer, optionalText));
packet.getDataValueCollectionModifier().write(0, metadata);
return packet;
The index of the packet is 23 according to here: https://wiki.vg/Entity_metadata#Display
My client is disconnecting when receiving this packet saying:
java.lang.IllegalStateException: Invalid entity data item type for field 23 on entity l['Text Display'/200000, l='ClientLevel', x=30.63, y=-60.00, z=1.41]: old=empty(class xn), new=Optional[literal{This is a line}](class java.util.Optional)
So I'm confused because the client seems to say field 23 isn't where I should be putting this, but protocol says I should be. Any help is greatly appreciated!
why not just use real text displays?
š "Performance" š
except that they quite literally don't do anything lmao
uhm actually they tick. Imagine how much CPU cycles I could save by avoiding that 1 if statement
(they don't)
what I stg they did
they do you liarrrr
public void tick() {
Entity entity = this.getVehicle();
if (entity != null && entity.isRemoved()) {
this.stopRiding();
}
zzz
Nice
listen this is some pretty heavy operations we got going here
thats one variable assignment a null pointer check and another boolean check
L0
LINENUMBER 138 L0
ALOAD 0
INVOKEVIRTUAL net/minecraft/world/entity/Display.getVehicle ()Lnet/minecraft/world/entity/Entity;
ASTORE 1
L1
LINENUMBER 139 L1
ALOAD 1
IFNULL L2
ALOAD 1
INVOKEVIRTUAL net/minecraft/world/entity/Entity.isRemoved ()Z
IFEQ L2
L3
LINENUMBER 140 L3
ALOAD 0
INVOKEVIRTUAL net/minecraft/world/entity/Display.stopRiding ()V
this is a proposterous amount of computing here
Ye bro your cpu gonna burn
Why are we doing bytecode
just showing @slender elbow how heavy TextDisplays are on the server
those run on the jvm
bytecode is far from assembly
mmm unfortunately I can not :(
Just rebuild it in rust lol
Quite a lot of instructions
Can we rewrite mc in rust and then add JNI so we can still use java mods and plugins
Good luck, see you in two years
Lemme finish ma server first
3 years
Everything is done, now just need to make chunks and shit
Wait fuck. What about physics. How does nms do physics? Is Mc physics hard??
I never though of that
where have you seen physics
The only physics that we have in minecraft is falling
And velocity
Hmm
That's true
What physics engine does unreal engine use
Can u integrate it into other projects
Unreal physics engine
What's physx
Isn't that something physics related
I should make realistic minecraft with those new entity blocks
That's a good fucking idea
Chaos Physics
That's what I was thinking
Chaos something
Chaos vehicle and shit too
And cloth physics I think
For packets, is the bottleneck the client or the server
Like can I pull something insane with block entities
server assuming you want multiple players
it does depend though as always
What if the server isn't written in Java and is actually optimized
yo guys you know what'd be crazy
writing optimized java code
nvm bro its java š it'll never happen
Unsafe
I wonder how many people here could actually write C good enough to justify it over java lol
noone
But like if you're using Java, you're already giving up on perf I think
Whenever I write java I never care about performance that much compared to rust or cpp
no
So are you if you are writing anything but assembly
machine code
assembly is slow asf
I mean like the placebo effect
C -O2
If you write good Java code, in most cases you won't notice like any difference in performance to rust or cpp
not really true maybe at scale sure for simple projects maybe not so much for java
Java is pretty fast
My point is kinda that most people complain about java's performance and then go write shit code in other languages
Especially comparing to a lot of other bytecode langs
its semantics not really an actual fact
Why do people complain about java being slow when the people who complain about that usually write even slower languages
python my belovedf
Anaconda
Use lua. js engine binaries are really big
Just make it download the binary dynamically
I tried to compile v8 and it took 4hours
rate my animation skills
It's cool
targeting those Fortnight kiddies I see
Wrong chat
It's cool, chef
Like that or what
good
just make the guy hit the dab a few times too
Lol
I have a question, with NMS is it possible to change the pathfinding of an already existing entity? Like I want to add the goal Panic to the entity. I tried but it's not working, the many variations I tried had just either made the entity stand-still in place or just did not work at all.
private void entityFlee(LivingEntity en) {
if(en != null) {
PathfinderMob mob = (PathfinderMob) ((CraftLivingEntity) en).getHandle();
mob.goalSelector.addGoal(0, new PanicGoal(mob, 1.5D));
}
}
}```
Am I just stupid or smth š š„²
Entity e = p.getLastDamageCause().getEntity();
can e be p if the damage is void
yes, IF the player managed to damage themselves before taking void damage
no idea how they would manage that though
ah yes, its the damagee so its the player who was damaged
Check getDamageSource().getCausingEntity()
or getDirectEntity() as it may be an arrow
What is the new way to get a Particle?
get a particle?
I got this:
world.spawnParticle(Particle.valueOf(particleName), livingEntity.get().getLocation(), 100);
But it throws:
Caused by: java.lang.IllegalArgumentException: missing required data class org.bukkit.Color
That's for all the plugins since 1.21
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.lang.IllegalArgumentException: missing required data class org.bukkit.Color
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:218) ~[guava-32.1.2-jre.jar:?]
at org.bukkit.craftbukkit.v1_21_R1.CraftParticle.createParticleParam(CraftParticle.java:69) ~[spigot-1.21-R0.1-SNAPSHOT.jar:4289-Spigot-fb8fb72-8ee6fd1]
Depends on teh Particle but you likely need the T data
hmm, but is there no way to fetch it from a value?
The use case is simple, I want to specify the particle name
and it spawns
default to null and see what happens
but default to null what exactly? The Particle.valueOf() does not take a 2nd parameter
what particle is giving the error?
particle: "SPELL_MOB"
ym thats not a valid particle
not sure, but it seems like it doesn't exist anymore
yeah but it absolutely did exist before š¦
but okay, that explains it
might be an idea to validate teh return of valueOf
That's indeed something I should do
Any idea what is the new name of the particle or not?
Wrong chat
I wish I was magma level, this sort of thing would make my rpg mechanics way cooler
well guess what bud
that's free open source and written to act like an api
you can literally get this working in under 3 minutes
oh shit
I even handle the automatic resource pack creation, merging and distribution now
I tried to make a bush once
and it looked exactly what you'd expect a 1.8 minecraft bush to look like
man
this video is taking so long to make
I actually thought it was going to be a 1 day adventure
we're on day 4
hour long MC cinematic?
is there a way to change mobs scale on CreatureSpawnEvent using the new attribute command?
"/attribute [entity] minecraft:generic.scale base set [value]"
is it bad to have multiple listeners from the same event, for example PlayerInteractEvent? I have multiple classes for different purposes, each listening for the same event. Should I move them all to the same class or does it not matter?
I mean, you'll get a tiny bit more performance with one listener that delegates to all the other classes
But it doesn't matter that much
Hey guys, Im making a replay plugin to replay... a player and I Wonder, do I also have to record
Other players for example if the player Im recording hit another player should I record it ?
Idk how other replay plugins works
@vagrant stratus can u change a premium plugin into a free one? I'd like to preserve version/update history https://www.spigotmc.org/resources/hcf-plus-1-21-teams-claims-claim-wand-classes-dtr-papi.98332/
do EventListeners have to be public
sounds about right
If its private -> cant access
well was just wondering cuz yk you always have setAccessible
Yes I thought about it but spigot try to be as fast as possible using relfection will take a certain time
well it sets method as accessable https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java#264
so i would assume it can be private
Oups sorry
anyone!?š„²š„²
When I attempt to registerEvents against a new instance of this class, I am getting 'unable to find HandlerList for PlayerEvent'.
Can I not implement PlayerEvent? https://paste.md-5.net/ixosawobeg.java
probably am mixing up vocabulary
you need to expose the handler list
there should be a non static and a static version
@remote swallow Wow, that was it. Im ngl i dont really understand it too much; after you mentioned this I looked at another custom event on github and saw how they had the additional static event and implemented it and now its just working flawlessly.
Going to re-read the events API post. not sure how i missed this
not 100% sure, maybe try this
private void entityFlee(LivingEntity en) {
if (en != null && en instanceof CraftLivingEntity) {
PathfinderMob mob = (PathfinderMob) ((CraftLivingEntity) en).getHandle();
// Clear existing goals
mob.goalSelector.removeAllGoals();
// Add the panic goal
mob.goalSelector.addGoal(0, new PanicGoal(mob, 1.5D));
// Force AI update
mob.getSensing().tick();
// Optionally, damage the entity to trigger panic
// en.damage(1);
}
}```
will check this soon thanks dude
Sorry this is might be unrelated but how the fuck can I make jitpack to use newer version of maven? I'm trying to upload my library on jitpack and it always failed. This is the log https://jitpack.io/com/github/mdaffa48/MDLib/3.0.5/build.log
I've tried to create a jitpack.yml as suggested by some articles online, here's the content of the file https://paste.md-5.net/oqevipajam.bash
What is the difference between ArmorStand.setVisible(boolean visible) and ArmorStand.setInvisible(boolean invisible)?
Probably the same
How I can disable /list command on spigot and replace my own command. Make own custom /list command system
I think you can just register your own command and it will overrides it.
Otherwise you need to unregister it.
Animals entity = (Animals) player.getWorld().spawnEntity(player.getLocation(), ped.getPet().getAnimal());
entity.getPersistentDataContainer().set(new NamespacedKey(Main.getInstance(), "owner"), PersistentDataType.STRING, player.getUniqueId().toString());
entity.setCustomName("§7" + player.getName() + "'s Haustier");
entity.setCustomNameVisible(true);
entity.teleport(player.getLocation());
ped.setEntity(entity);
entity.setInvulnerable(true);
entity.setSilent(true);
entity.setRemoveWhenFarAway(false);
entity.setAI(false); // hinteher laufe
entity.setCollidable(false);
entity.setCanPickupItems(false);
entity.setBreed(false);
entity.setTicksLived(Integer.MAX_VALUE);
if (ped.getPet().isSmall()) {
entity.setBaby();
} else {
entity.setAdult();
}
}
public void everySecond() {
PlayerPed ped = getActivePed();
if (ped == null) return;
Entity pet = ped.getEntity();
if (pet.isValid() && player.isOnline()) {
((Animals) pet).setTarget(player);
}
}```
why doesnt this work? // why doesnt it follow me
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project: Fatal error compiling: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid' -> [Help 1]
when compile intellij maven
java 21, spigot 1.21
Double moneyGained = this.getConfig().getDouble(entry + ".sellprice");
sellprice: "1999999"```
why this not working
1 is code
2 is cfg
its returning 0.0
nvm
how does backwards/forwards compatibility work with the spigot api? what versions can i expect my 1.21.1 plugin to run on? and how are some plugins able to run on almost any version?
I think you will get an better answer for that in their own discord
?nms

