#help-development
1 messages · Page 1107 of 1
yes, that's a platform hook
And this is why we wrap Bukkit scheduler
so blue_shrug
that's a you issue lmao
I smell some dissallowed client modifications 👀
??
i mean i might aswell use it
if its there
wait
tf you putting utilities in your plugin class for blud
SHADOW
what the fuck man
What???
bro dissappears for 10 days and then casually steals my embed fail gif
alr
hey but do any of you hooligans know how to do this
im sorry where were we about DI and singletons?
its fine, we aren't gonna change each other's mind anyways if we argue
Hello! I am looking to hire a full time Minecraft Developer who is willing to build a server from scratch using the host Rocketnode. We are willing to purchase anything that is needed for the server to go up and achieve what we are hoping for. Please message me with your experience/portfolio and I will give more details.
i think you are the first person in this server that has some sense on views and opinions
congrats
why did bro delete all his messages
no. is there a question in there that needs to be answered?
i can't find one
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
im starting brand new 🥳
if you can't post hire someone offering
I'm looking to hire someone to run the ?services command full time on #help-development , paying in exposure
magma guy I'm already doing it full time
I'm not even getting exposure
what the fuck
🤡
im not too sure myself
not as deep into coding as he is
i can't focus
I just get CC @river oracle on some stash bugs
then take the contacts off and read, genius
why even be on a chatroom if you can't read
i put them on later
I don't think my eyesight is bad enough for them to even allow me to do lasik
I barely have a perscription
you think they wouldn't take your money?
true I do live in the United States
it's not even that expensive
it is like $400 an eye
if that's the actual price then it's half of what I paid for it
it doesn't matter it could've been 10k and it still would've been worth it
I had pretty bad eyesight
perhaps you aren't familiar with the United States
I've heard there's a guy who does it in the back of a rusty old van
if he moonlights as a free candy van for children then you know he's a real G
what is the right way to getExp()?
Would the output you want be in levels or experience? instead of getexp() its gettotalexperience() and getexptolevel()
the problem is there is math required afterwards
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
idrk if this is the place, but how can i use sonatype nexus to make a maven repo
are you hosting it?
Are there any good fourm posts or otherwise on like some of the math concepts you should know
Like how to apply trig and other key things to kinda know
apply it to what?
what are you trying to achieve? do you just want a public repo?
if so, just use jitpack
Like in the context of working with vectors to do something like make a particle animation
Idk how to do that… cuz like I know trig but idk what it’s doing when people use it in their tutorials sometimes
not any tutorials that i know of, but in most cases it's just simple cartesian plotting
khan academy is great for maths, yeah
I got vectors from 3blue 1brown from essence of Linear algebra
Cartesian plotting!
New term for me
Ty
just a fancy name for putting stuff on a graph
check out desmos if you haven't already https://www.desmos.com/calculator
Relearning trig would be good yea
Cuz I formally learned SohCahToa but not Cotan, Sec, CosSec, or how they can be used apart from figuring out ratios on a triangle
tangent and secant are a bit more advanced level trig but pretty straight forward
so usually won't learn it at the same time as regular trig
Freya Holmér has a lot of good gsme dev math vids
Here’s one!
https://youtu.be/1NLekEd770w?si=G01HikFACc0VD3hM
In short because players dictate their own movement (they don't apply a vector upon themselves, they just tell the server where they went) you need to calculate it yourself
By employing tactics like comparing from/to on PlayerMoveEvent
hi im modifying a players gameprofile at runtime and I need to respawn the player in order for it to visually update to online players
im using Player#Spigot#respawn to attempt this but it doesn't seem to work - any ideas?
You should be able to send entity update data packet instead
what would that packet be? ClientboundPlayerInfoUpdatePacket?
ClientboundSetEntityDataPacket
how can i "intercept" a vanilla command? for example, i want to allow players to use the minecraft:tp command, and i dont want to give them permission for the command, since they could tp any player anywhere, even in other worlds (i think), but i want them to be able to tp using some minimap mod. those mods usually do /minecraft:tp <playername> x y z, so id like to add some logic to the command to check if the player thats being targeted is the same player that executed the command (and also check if the tp is on the same world, idk if you can use minecraft:tp to tp to other worlds, but if its possible, i dont want that)
declaration: package: org.bukkit.event.player, class: PlayerCommandPreprocessEvent
could someone help me with nms 1.20.1?
i have error java.lang.NoClassDefFoundError: net/minecraft/world/level/Level
whenever i use NMS (not even using this class)
you seem to not be reobfuscating your plugin
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.20.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>
<build>
<plugins>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>2.0.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.20.1-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc
1.20.1-R0.1-SNAPSHOT🫙remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.20.1-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc
1.20.1-R0.1-SNAPSHOT🫙remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
?codeblock
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Make sure you're actually using maven when building your plugin
Do not use artifacts
how to do it
I assume you're using Intellij
yes
and run?
still: java.lang.NoClassDefFoundError: net/minecraft/world/level/Level
im not even using this class
you are presumably using a method that has that as a param or something
im using ServerLevel class
What version is the server running
1.20.1
in the server?
/version
[11:43:21] [Server thread/INFO]: Unknown command. Type "/help" for help.
[11:44:05] [Server thread/INFO]: This server is running CraftBukkit version 3871-Spigot-d2eba2c-3f9263b (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT)
yes
I’m trying to make it so that a player can withdraw exp into a bottles
Could you send your entire pom
in a paste
?paste
Try not to put it directly in to plugins
There we go
Code that doesn't exist cannot run so you need to include reflections. There are two ways of doing this; If you only plan on supporting 1.17 or newer you can use the libraries section of the plugin.yml. Alternatively you can include reflections in your jar with the maven shade plugin
I recommend using the libraries section if possible
libraries:
-reflections
also your reflections is outdated. 0.10.2 is the newest version
put everything or only reflections?
libraries:
- "org.reflections:reflections:0.10.2"
and again java.lang.NoClassDefFoundError: net/minecraft/world/level/Level
Sisyphean work
?
should i show the code?
Could you try a clean package for me
and again don't use the jar plugin to put the plugin directly in to plugins
private void registerListener() {
String packageName = getClass().getPackage().getName();
for(Class<?> clazz : new Reflections(packageName + ".listeners")
.getSubTypesOf(Listener.class)
) {
try {
Listener listener = (Listener) clazz
.getDeclaredConstructor()
.newInstance();
getServer().getPluginManager().registerEvents(listener, this);
} catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException |
InstantiationException e) {
e.printStackTrace();
}
}
}
this stopped working
Anyone know
hm I'm not sure why it isn't remapping correctly
Could you try and put the entire project on github or smth
so I can try it locally
does that emit two different jars?
maybe they are using the wrong one or something
ah
but ig that could also be the case
Which jar file are you using
after building your plugin
i have a problem with github
alr that's fine
just answer this
this gennerated in output directory
its just giving me one
hm
TWD-1.1.jar
hm
i delted the libraries from pom.xml, added artifact and listeners started working again but the NMS still dont
Can someone help me
@Override
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
if (sender instanceof Player){
Player player = (Player) sender;
Location location = player.getLocation();
plugin.getConfig().set("location", location);
}
return false;
}
explination for whats wrong. it litterly doesnt change anything in the config file
no saveConfig()
Send your new pom
and double check that you're actually using maven
to compile your jar
Sounds like he's exporting
yeah
how to encrypt my source code? i used mvn clean install but my plugin still got reverse engineered and exposed by some support sites. how to prevent this?
I told you to stop using the jar plugin
an obfusecator (if it even exists for java)
You can't really
People will always reverse engineer your plugin
Obfuscators exist but they're not hard to get around
sad reality of paid plugins
wouldnt a tos do the work
thanks, because the plugin i made is free but some people reverse engineer and modify it and sell it for more but same function which makes me feel uncomfortable about that
like on your plugin page say
tos:
no deobfusecating / reverse engineer
so are you sure they're actually using your code
That doesn't actually change anything
a key system?
nvm that only works for paid
damn
public void onPlayerDeath(PlayerDeathEvent event) {
Location location = event.getEntity().getLocation();
CraftWorld craftWorld = (CraftWorld) location.getWorld();
ServerLevel nmsWorld = craftWorld.getHandle();
Zombie nmsZombie = new Zombie(EntityType.ZOMBIE, nmsWorld);
nmsZombie.setPos(location.getX(), location.getY(), location.getZ());
nmsWorld.addFreshEntity(nmsZombie);
CraftZombie craftZombie = (CraftZombie) nmsZombie.getBukkitEntity();
GameProfile playerProfile = ((CraftPlayer) event.getEntity()).getProfile();
GameProfile zombieProfile = new GameProfile(playerProfile.getId(), playerProfile.getName());
if (playerProfile.getProperties().containsKey("textures")) {
Property textures = playerProfile.getProperties().get("textures").iterator().next();
zombieProfile.getProperties().put("textures", new Property("textures", textures.getValue(), textures.getSignature()));
}
try {
Field profileField = craftZombie.getHandle().getClass().getSuperclass().getDeclaredField("bQ");
profileField.setAccessible(true);
profileField.set(craftZombie.getHandle(), zombieProfile);
} catch (Exception e) {
e.printStackTrace();
}
}
}```
this dont work
That code is not the issue here
You're not compiling with maven like I told you to
i dont know how to
It will generate 3 different jars when you do so
Start by removing the maven jar plugin from your pom
done
done
Now go to the target folder
of course, since this is a plugin i made for my own server, it supports a new genre for fantasy servers. i released it on spigot because many people requested it but it was sold by unscrupulous people to developing servers
olivo is that what you mean just putting an image so he knows what to do
yeah it's that
should i provide images real quick?
4 jars
original-TWD-1.1.jar
TWD-1.1.jar
TWD-1.1-remmaped.jar
TWD-1.1-remapped-obf.jar
There we go
dont mind my artistic skills
Now use that TWD-1.1.jar
private void SpawnCustomBoss() {
int delay = getConfig().getInt("delay");
Location location = getConfig().getLocation("location");
new BukkitRunnable() {
@Override
public void run() {
if (bossUUID == null) {
if (location != null) {
LivingEntity boss = (LivingEntity) location.getWorld().spawnEntity(location, EntityType.WITHER_SKELETON);
boss.setCustomName("Ghost Prime Jr.");
boss.setCustomNameVisible(true);
boss.setGlowing(true);
boss.addPotionEffect(new PotionEffect(PotionEffectType.STRENGTH, 600, 1));
bossUUID = boss.getUniqueId();
}
} else {
System.out.println("Boss is already spawned.");
}
}
}.runTaskTimer(this, 0, delay);
}
This code is not properly working i looked in the console the boss isnt already spawned and i see no boss at my current location where i did the ./setbossspawn command
When spawning an entity that you plan to modify use the spawn method that accepts a consumer
How would i do that?
I aint the best at java
world.spawn(location, WitherSkeleton.class, boss -> {})
and modify your boss in that lambda
might want to add false before the boss lambda
to prevent it from randomizing data
but why, almost everything worked except the NMS now nothing works
location.getworld()?
yes
I assume you understand basic java
if you're not getting any errors
something in your code is broken
Attach a debugger or use some print statements to see what gets run
how so
if (location != null) {
location.getWorld().spawn(location, WitherSkeleton.class, boss ->{
boss.setCustomName("Ghost Prime Jr.");
boss.setCustomNameVisible(true);
boss.setGlowing(true);
boss.addPotionEffect(new PotionEffect(PotionEffectType.STRENGTH, 600, 1));
});
bossUUID = boss.getUniqueId();
The boss variable is out of scope
The spawn method still returns the spawned entity
you can use that
can you help me a bit?
or just set bossUUID inside the lambda
hey,anybody knows a mod/client that can download worlds from multiplayer servers
i need them for testing some stuff
https://github.com/mircokroon/minecraft-world-downloader
This is the very first result when googling "minecraft world downloader" ...
It works fairly well
And this question does not belong here
ye i already tried it but it gives some errors about java version even tho i have the proper version
Then you do not have the proper version
i have it
If you had it then you wouldn't be getting the error for incorrect java version
Maybe you have it installed but are using a different one to start the program
i check my environment variables, and did on cmd java --version
i have jdk 21
im gonna install the latest version anywys and try
but it said it needed jdk 21
Hey spigot people,
so since recently, enchantments are now registered via the registry. My question is, what other things
can be done via the registry now? I did see stuff like biome, etc so I assume biomes and other stuff gets done like this
too now. More interesting would be item tags and potioneffects though
items and potion effects cannot be registered
Wouldn't suprise me if that's going to change in the next couple of updates
as the game continues to become more data driven
Going from Minecraft to Datacraft
Enchantments (partially, next update fixes some bugs), Paintings, Trims, Music Records, Horns (in the next update), Biomes, Dimensions, (most) Recipes, All kinds of tags, Advancements, Structures, Banner patterns, Damage types, Loot tables, Wolves
Actually, just check the wiki :D https://minecraft.wiki/w/Data_pack
true, would be massive for servers
Oh, didn't think about that, ty 😅
is there a way to retrive a cookie in spigot during the login phase like in bungeecord?
oh
1 sec
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerLoginEvent.html
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#retrieveCookie(org.bukkit.NamespacedKey)
declaration: package: org.bukkit.event.player, class: PlayerLoginEvent
declaration: package: org.bukkit.entity, interface: Player
ah i think based on the ServerLoginPacketListenerImpl you can use the login event and request the cookies there
as it waits until they are received
^^
can anyone help me with a problem im having
just ask the problem
I'll consider it after you post a question worth being answered
so im trying to make a plguin where you can like withdraw vanilla exp into a bottle and if you right click it gives u the exp and whatnot
but minecrafts exp is really awful to work with, does anyone know any way around it because if you take away the levels its just gonna replace them with the exp
It's not that bad to work with
doesn't player have getLevel set Level methods
get the raw xp value and store that
Don't use get level and set level as xp per level varies
but then they will keep the exp
do you know how because i cant find it
Store the exp in a separate value or do some math as Olivo said
getExp() returns a percentage
And get the raw value
alr thanks
If this were my own plugin I'd probably favor the math
There are forums posts on calculating this
You'll find it with a bit of google
ive seen some posts with the math but how does that correlate?
Hi guys, I'm learning how to program plugins with spigot in 1.20.6 in IntelliJ. The problem is that I can't import org.bukkit.Material whereas I see the file Material.class in spigot-api-1.20.6-R0.1-SNAPSHOT.jar in my External Libraries. Can someone help me please ?
External Libraries
Use either Maven or Gradle to manage your dependencies.
I already use Gradle
update InteliJ
theres Player#getTotalExperience and a get for that
it just gets the total xp amount so no maths required really
how do i get a certain bit from a string
like i have
"Test Bottle: [1000]"
how do i get just the number
because it will be different every time
find the brackets?
sscanf run

MessageFormat is slightly less cursed but also lol
but how
alright thanks
with substring what if the amount is more than 9999
learnjava moment
if i were to do substring(1, 5) for example
find the index of the first '[', find the index of the last ']', substring
alright thank you
It works thanks a lot
im just looking at the docs but how would i do this, if it was [1000] then it would be 1,4 but if it was 10000 then it would be 1,5 no?
i cant see anywhere how to index the ]
only ints
chars can be converted to ints, so you can pass char literals to indexOf
ah ok thankss
If I wanted a plugin to support 1.12-1.21, would my best solution to be to depend on the 1.12 spigot api or?
you have to use the 1.12 API
otherwise you'll get some fun errrors from Commodore that you can't fix
when does BlockExplodeEvent trigger I've got an event that isn't printing my debug statement at the top when I Explode TNT?
https://paste.md-5.net/aqipidujak.cs
I can confirm its registered all other events in this class work as intended.
but yet no here prints in console when I explode some tnt or summon a primed tnt
mmm
hyper link them
what does that mean?
[url=https://google.com/ ]image[/url]
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
you wrap the image tag in a hyper link
oh
how do you prevent players from getting the buttons from chestgui to their items
cancel click/drag events
that didn't really work
show what you have
remove any spaces
it probably doesnt like the fact its not a link image
okay, this was kinda gay
public void onBottleThrow(PlayerInteractEvent event)
why is this method never used? its registered in my main class but it doesnt work
Is it possible to stop the attack indicator from resetting to 0.0 when holding a new material so it only resets after hitting?
please provide more code
in which
assuming you know how to register an event properly, show the event
?paste
ignore IntelliJ
its genuinelly not smart enough to know
I'd just supress that warning for every method that is annotated with @EventHandler
it should give you an option to do so under ctrl+1
or whatever the IJ equivalent of that is
it happens whenever i shift + click an item then close the inventory fast enough
canceling click and drag events will do just fine
thanks
just the item in their hand
alr htanks
the interact event tells you which hand is being used for the current interaction
you can get the item for the hand in that interaction
i have a json object that im (de)serializing, but it needs my plugin instance for some things (DI), how would i handle that?
ideally without a custom adapter for that specific object (the interface it implements already has its own adapter)
why am i getting this error
even tho the item that i am trying to serialize is Map<String, Object> which is a serialized itemstack
the map contains an ItemMeta which is not serialized
sounds like you're using a regular ObjectOutputStream rather than a BukkitObjectOutputStream
yea
BukkitObjectOutputStream can do anything that an ObjectOutputStream can right?
since its an extension of it (based on dcos)
yes, and is able to serialize ConfigSerializable objects like ItemStack and such
wait, does that mean that I dont need to do ItemStack.serialize() anymore?
not for that output stream, yes
Since when is emily cute... 
surgery couple days ago I think
i am cute
Noted
cap
Yes, but not vice versa
Is there a way to access the custom_data item component of items?
Use minimessage
Yep it’s apart of adventure
Component serialize / dezerializer, you could also use the legacy serializer
I’m not gpt, but minimessage again, is apart of adventure api
And again
Is a component serializer / deserializer
🤷 it’s a ?tas question
This is spigot so we don’t exactly have a lot of people knowledgeable of the adventure api, though there are some
Either way minimessage is an adventure api thing so
Component greenText = MiniMessage.miniMessage().deserialize("<green>Green text");
that's a component, not string
I'll be honest I didn't read any context
deser returns a component
yea
Minimessage I thought still always returns a component
Ik that's my bad
I believe the world contains that
player.level.lookup something like that
(just look at how craftbukkit does that)
entity, level, server contain one
i thought you needed a reg access?
no you just need to become a nerd and have all of this engraved in your memory
yarn vs mojmap woes
lolyarn
Is it safe to assume that PlayerInteractEvent#getItem == PlayerInteractEvent#getPlayer#getItemInUse?
same with EntityDamageByEntityEvent with the damager/attacker
Get item in playerInteractEvent returns the item that was interacted with iirc
So no it’s not the same item
EntityDamageByEntity however would return the item in use by that second method call you mentioned but I don’t even remember if that’s a method in said event
yea its rather getDamager and then getItemInUse or something like that
Wtv it is it’s not the same
but when would that be different? in what cases
?tas
Interact like I said returns the item interacted with which may or may not be an item in their inventory so
It could be an armorstand for example, or perhaps a cactus
The point is it fires on any player interaction meaning it’s not always an item they currently have in their inventory
wait but getItem always returns the item in one of the players hand no?
what exactly
how would u interact using an item thats not in ur inventory
Get item usually returns the item most relevant to the case
Get item in interact event
?tas
but how would that work in game? assuming the item is not air
I’m literally here helping, you don’t have to spam tas
Wdym? The item returned by get item in playerInteractEvent is the item that was interacted with
Not necessarily always an item in the players inventory
For example, get item in playerInteractEvent vs get item in use could mean the player interacted with cactus, but was using an axe to do so
For context: im trying to make abilities bindable to items. for that i got a class somewhat like that ```java
class Ability<T: PlayerEvent> {
//some shit here
}
and im listening to all events that are bound to an abiltiy. So my event listener is public void onAbilityItemUse(PlayerEvent event). I registered it using getPluginManager.registerEvents to listen to multiple events. But now the question is whether i should use a switch statement to cast and get the item using getItem on playerniteractevent or just universally use getItemInUse
wouldnt that be getClickedBlock?
It can
PlayerInteractEvent is pretty vague tbf
Still iirc get item returns the item interacted with, so it could be in the players inventory or another item
weird
ig ill js use it without switch and put it in the readme under possible issues :)
thanks for the help tho
Well you just guard clause to verify it’s an item in the players inventory, you can get the action types as well to make it a more specific ability, ie: shift right click for the trigger, also I’d be storing these abilities in the items pdc
From pdc you can easily derive if this is actually one of your custom items, not sure if you’re familiar with pdc but yeah
?pdc
actually what i was looking for for my cooldowns. was thinking for so long on how to save them but ig thatll do
Yeah pdc the modern nbt wrapper
then id need to cast again no?
Cast what
Uh
That’s probably a jdocs lookup tbf
declaration: package: org.bukkit.event.player, class: PlayerInteractEvent
getItem says Returns the item in hand represented by this event
Hmm I guess I was wrong, still I wonder how it differentiates main/off hand
no idea. Im also worried with how it handles stuff with shields or bows
like aiming with bow while left clicking
I assume it’s the same process? Just the item being currently used when that event was fired
maybe itemInUse is then the bow but getItem is not
thatd mean that playerinteractevent would set itemInUse to the non-bow item just for some ticks?
No I don’t think so
maybe really ?tas
Whatever item was or is in the hand at the time of the event being triggered is what should be used
but there r multiple hands and a bow in the offhand aiming is also kinda using
left clicking with the main hand is also kinda using tho
Yeah this one is probably a tas, see if you can break the event and if you can make a jira report
Seems quite niche but still problematic for sure
wait whats jira?
?jira
Where you report spigot bugs
Did it work?
can I set that with commands?
all these different versions are annoying. cant even run 1.21.1 server with jdk17
I don’t actually remember the benchmark versions, but j21 for 1.20+
you can set it in a plugin, plugins can have commands, so, yeah I guess?
so I can give players an item with custom data using a command and then check if the custom data is present with a plugin?
yea i js tried whatever java was the newest and it worked now
now js gotta fire up minecraft on this laptop
events not eventing...
Debugs
wdym
Verify the event is actually being fired, debug statements of some sort
yea i got a bukkit#broadcastmessage in there
First thing?
maybe i should verify onEnable is running cuz i have no idea why it wont work
onliest thing
Well your plugin wouldn’t show up green in /pl if onEnable didn’t fire
Did you register the listener?
yea
Uh
wait i js need to login to discord on laptop again
No worries
I think he said that listener class is in the main file as well so perhaps this is an issue
Idk
don't see why it wouldn't
nope!
Kotlin is weird
what error?
ah
noclassdeffound
you arent shading kotlin
are you using maven or gradle
gradle
show your build.gradle(.kts)
on it
theres a new new one
oh god why
com.gradleup.shadow
its moved to a gradle managed group still maintained by goooler
its not updated anymore
oh my fucking god
goooler maintains gradleup shadow
holy fuck can these gradle people get their shit together
it was planed to move to a gradle managed org for a while
its so if gooler (for example) stops wanting to maintain someone else just gets contrib access to the gradle managed repo
only been known since march
this too btw
maybe you should just keep up smh
still same error
and also, why are you shading the kotlin stdlib one more time
ok prob was cuz reload instead of restart
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
yeah, don't reload, try with restarting
was talking about plugin jar not spigot but been as you said it, get bukkit is not an offical source and you shouldnt use it, run buildtools to get the spigot jar
that doesn't have the spigot api no
yea js wanted a quick server for testing
but what plugin jar do u mean? im running gradles build task and using the thing without any weird suffix
use the -all or -dev-all
in build/libs which jar do you use
oh i didnt read it all
do what rad said
with no suffix is just the normal gradle build jar, -all is the jar gradle shadow produces with any libraries you specify shaded
the -all includes all libraries
isnt shading bad because of size?
it depends on what it is
shading is just what you do to include libraries
now why tf is player#getItemInUse on playerinteractevenmt null
but then u have duplicated libraries with multiple plugins right?
pretty sure thta only fires when doing a specific action with the item, like right clicking a chest
that's what spigot's libraries feature does
thats paper im pretty sure
spigot fires it for everything
yea im hitting grass with a trident
well thanks for the help tho
would have went to sleep and never touched my pc again without u
?learnjava
For Beginners:
Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/
For Intermediate to Advanced Learners:
Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/
Practice and Hands-on Learning:
Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/
Free Resources and Documentation:
Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/
Community and Support:
Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/
Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉
hey guys, is there a way to stop a world from generating new chunks if the chunks are unloaded, the world i imported is a normal world(not flat and all layers set to null), it has some builds, whenever i walk far new chunks generate normally like vanilla
is there a way to do this without listeners?
do I have to use PDC to make an item unstackable?
for that i usually generate a random uuid, its rarer to exist 2 times randomly then a 64bit number
you can now set a MaxStackSize to make them unstackable
true, gotta update my plugin, but ill keep the uuid to check for potential duped items ig
how do i give my entity a color coded name
Hello, i was wondering how ItemsAdder, Oraxen , Model Engine can create custom model textures for specific mobs only ? When i ask this, everyone say "just use ItemsAdder" but i want to know how they succeed doing this when everyone says it is not possible
modelengine's textures are made of display entities / items with custom item models
and the items are defined in the resourcepack
they wrap around the real entity, they don't retexture an existing one
Is it possible to create tottaly custom gui with NMS?
only serverside no
why are plugin devs so scared of resource packs
they are annoying
pain in the ass to impl
sure but that isn't really a limitation as to not do it
its a choice not to be burdened by annoying things
facts
💀
Before multiple resource packs were a thing they sucked for public plugins
A lot better now
they are
well
not in server.properties
but the network protocol supports it
well the client just layers them
by using a plugin
¯_(ツ)_/¯
Does anyone know how i can change the health of my boss i've tried bos.sethealt(250) but it errors saying i cant go over 20
you first need to set the max health attribute to that val
You still have to be careful to not have conflicting model data values
And you gotta host the pack somehow
✨
Its just a witherd skel with prot 80 armor. i am not that good yet to do model data and that advanced stuff
why the fuck are requests randomly taking exactly 2.0x seconds?
both the api(axum) and next.js are running on release mode
its on localhost btw
I think it should be possible to host the pack on the server itself through the same port
Just gotta intercept the request early in the netty pipeline
I’ve yet to try it tho
u gotta be fucking serious. its cuz of ipv6 dns? tf
web dev is so gay
oh thanks , the blockbench animations are also made with display entities /custom items ? And they get all the positions from the blockbench json file ?
Pretty much yeah
boss.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE).setBaseValue(10); would the base value be in hearts or what is it in?
Half-hearts
Alright thanks
hacker
Do you know the song big balls by AC/DC?
Big balls no, but 3 big balls i do know.
holy shit its jan tuck
Ah based off your description, you should go listen to big balls by AC/DC
I feel like you’d enjoy it
heya eboceboc
why would gson skip my enum field in an object even tho i registered an adapter for it?
its just a simple enum in constructor
i tried without, same result
private transient final FishyBusiness plugin;
private final String message;
private final Type type;
private final double weight;
public MessageReward(FishyBusiness plugin, String message, Type type, double weight) {
this.plugin = plugin;
this.message = message;
this.type = type;
this.weight = weight;
}
my obj
why do you need a reference to your plugin in a data object
real cursed
also why isn' your plugin suffixed by Plugin
thats just how i name stuff
i watched some vid back in a day and i just follow how it recommended to name things
its not entirely a data object
what ive sent is just a constructor
it's serialized otherwise you wouldn't have the transient keyword tossed in
yea it is serialized, i handled injecting the dependency already tho
poor design leading to weird engineering
i aint rewriting the whole thing until it works
you could also avoid that (although regrettably) by just having a singleton
yea i dislike that tho
maybe try SerializedName?
i kinda wish gson just throwed exception without being goofy and just ignoring everything
shouldnt my adapter already handle that tho?
try it and anyway
yuore right
Is there any way to add "can_place_on" data to an ItemStack on 1.21?
itemMeta.setPlaceableKeys() is removed
only i found is to modify the nbt of ItemStack
but they changed nbt to component
brain dead xP
it might not have been added to spigot yhet
too bad 💀
does EntityRegainHealthEvent get fired when the player heal from regen potion?
you should pr it and scare lynx that ur breaking the damage system again
lol and then the ItemMeta system will be broken
I S2G
Ah
I found it called in heal() method
I pinged you in another discord server LoliColleen. those methods were added back
^ 
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/player/PlayerMoveEvent.html#getTo()
why is this null?
declaration: package: org.bukkit.event.player, class: PlayerMoveEvent
nullable*
because the player can move their head
which also calls the event
therefore there is no getTo
ur right
i found both the two places calling PlayerMoveEvent
toLocation are not null
Well 😅 PlayerTpEvent has a nullable to
oh
btw i found that if an entity is riden, it cant be teleported
it even doesnt call an event
i did some testing, added a statement to print the json tree but looks like the issue is when saving json to the file
so, if you add anything mounting on a player, they cant be teleported any more
ill get back to it later
maybe we should add a PlayerPreTeleportEvent?
what is the best java version to use on 1.21?? should i got java 21 or 22?
I didn't update java21 until I couldn't play the latest version of minecraft
Then I found all plugins on my PC are broken
That was a disaster
omg i figured out the issue
🤦♂️
parent object already has a field named "type"
so gson overrided the one related to messagetype
because the other one was last in serialization
can i make it complain by throwing exception if that happens?
i much rather prefer an exception
instead of just plainly ignoring every rule
How do you fake teleporting a player or otherwise make it seem as though they are somewhere else than where they are (camera-wise)?
spawn a clone npc at original location, set gamemode to spectator, teleport
eh
but then wouldn't i have to like
listen to see if the clone gets punched by someone else, stuff like that?
is there a way i can set an itemname into like a gradient with like rgb birdflop or do i just have to do CHATCOLOR.BLUE and that
using chatcolors will restrict it to 0-f
so is there a way i can just make it so i can copy and paste the rgb birdflop or no?
birdflop?
never heard of it?? basically it gives you like the &3 and all that colors to make gradient names
Use the proper output format on birdflop
And copy and paste it
Or use a library like mini message or mine down
Birdflop supports exporting to mini message
Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...
Is there an efficient way for a workaround to that sign editing bug in 1.20+ with waxed and unwaxed signs?
What bug
Ajj that bug that one is chill don't avoid it
Lol
hello ! (I'm on 1.21)
do you know why sometimes my boat takes the right vector and then stop immediately ? 9/10 times it just slide (as wanted)
public void boostBoat(Boat boat) {
if (this.boatBoost <= 0) {
return;
}
Bukkit.broadcastMessage("boost" + boatBoost);
Vector direction = boat.getLocation().getDirection().setY(0).normalize();
Vector currentVelocity = boat.getVelocity();
Vector boostVector = direction.multiply(2 * this.boatBoost);
Vector newVelocity = currentVelocity.add(boostVector);
boat.setVelocity(newVelocity);
this.boatBoost = 0;
}
Thx for help 🙏
When do you trigger the method ?
how would i allow snakeyaml to combine configurationsections and strings?
root:
- "test"
section:
- "idk"
- "blah"```
with 2 methods to get string list (like the one in spigot) which filters the sections and returns "test" and "idk" or get the configuration sections which returns "section"
or maybe extend the yamlconfiguration by spigot
there's this guy
who is using freeminecraftmodels to make transformers in minecraft
he's been doing it for months
he's dedicated that's for sure
damn
the animation looks cool but that looks like anything but transformers
Looks like my dїck on fridays
don't ask me why the texture is flipped, he's still working on the model
but yeah I swear he's been doing this since like january or something
Damn
gimbal lock 💀
Wrong chat
Why?
cus he's the overlord of help-dev
Why do you think like that
do I even need to dignify this with an answer
it's using a transformation matrix so it shouldn't even be locking
transformers, robots in disguise ™️
Well it depends on how you construct that matrix no ?
If you use the shitty axis angles or whatever then ofc it will lock
I don't even want to look at that code right now
that's going to be another month of my life right there
I believe you gotta do all animation rotation calculations with quaternions
I wish the joml library had just worked for this
for some reason it was not doing the math right
I think I might've since sort of figured it out but I don't know that my heart can go through that again
I have managed to load and correctly display Blockbench animations with my own render engine.
And I have no idea how matricies or quaternions work, used joml for all that shit
I know it has to be possible
I think part of the problem when I was first doing it had to do with the root bone
and how some specific models are grouped
like there was a problem with rotations if you didn't make a rotationless root bone for the model
Ooohh
That sounds like a big flaw
yeah I only figured that one out after like over a month of slamming my head against it
the problem isn't getting animations working it's getting every possible configuration of animation working
like making root bones with a default non-0 rotation would seriously mess it up
or having several root bones
now I just add my own core bone via code to make sure there is a proper world-oriented bone in there for the matrices to actually work
but uh it didn't occur to me while I was trying to use joml
Since you're doing everything on the CPU, you should be able to just multiply the transform matrices with the proper offsets and rotations recursively for every frame of the animation.
I believe that was how I did it (when I had no idea how to properly make animations work)
that is basically how I am currently doing it, mostly because I had half a mind to implement animation blending which I have since reconsidered
I'm probably just going to end up caching positions into an array and play it back though
Hi guys! Quick question, has anyone got an example of detecting a sheep's color? I have a EntityBreed event giving me a sheep entity like so
if (event.getEntity() instanceof Sheep)
Sheep sheep = (Sheep) event.getEntity()
but sheep.getColor() is not available
Has anyone tried to use moshi (https://github.com/square/moshi) in a bungee plugin before?
I am getting some cryptic errors, and moshi doesn't seem to be able to deserialise java records
Maybe does bungee do anything with records and classloading?
I've been able to determine that my moshi instance does have the record adaptor factory, it is just not using it for some reason.
sheep.getColor() exists and returns a DyeColor https://hub.spigotmc.org/javadocs/spigot/org/bukkit/material/Colorable.html
It should be available. For me it is alt least.
Would it be ok if I paste my whole event code somewhere?
ok thanks
Good chance that Moshi only supports POJOs
it works outside of bungee
just not as a plugin
It does support classes, it reliably serialises it in a standalone project
Ah i see, they do classpath scanning to infer the constructors
Here's the relevant code for reference:
https://github.com/square/moshi/blob/4ba753c2254d9c89d702e39f7ff1f66078fc2e38/moshi/src/main/java16/com/squareup/moshi/RecordJsonAdapter.kt#L112-L151
What exception do you get?
what spigot version?
and does it compile anyway?
because that definitely exists
java.lang.AssertionError
at net.mangolise.deps.moshi.ClassJsonAdapter.fromJson(ClassJsonAdapter.java:210)
at net.mangolise.deps.moshi.internal.NullSafeJsonAdapter.fromJson(NullSafeJsonAdapter.java:41)
at net.mangolise.deps.moshi.JsonAdapter.fromJson(JsonAdapter.java:70)
at net.mangolise.commons.messaging.datagrams.DatagramParser.deserialize(DatagramParser.java:52)
at net.mangolise.commons.messaging.datagrams.StagedDatagram.deserialize(StagedDatagram.java:12)
at net.mangolise.mangee.Main.onEnable(Main.java:31)
at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:266)
at net.md_5.bungee.BungeeCord.start(BungeeCord.java:298)
at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:67)
at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
spigot api 1.21 and yes there are no other errors
AssertionError??
The exception is only happening because it is using the ClassJsonAdaptor instead
And it is trying to make the record field modifiable, which it can't
Does your record implement any interfaces?
where you have customItem = new HealthScroll(3); you are creating a new instance of the item and then decrementing the counter for that only, which means it resets every time you use it
Yes it does, both in bungee and in the standalone java app
record QueuePlayer(UUID player, String game) implements Datagram { }
Hm, show how you create an instance of Moshi
private final Moshi moshi = new Moshi.Builder()
.add(new UUIDAdaptor())
.build();```
isnt moshi kotlin?
kotlin and java interop
i can only find a ClassJsonAdapter.kt
https://github.com/square/moshi/blob/master/moshi/src/main/java/com/squareup/moshi/RecordJsonAdapter.kt
This is the record adapter
it's half java apparently
Paste the event into your IDE and see if it compiles?
Honestly moshi is the last serialization API i would think about using in a spigot project
it does
wtf
it does?! hmm :/
it's a minestom - bungee project
No that's the pre-java16 one
ye
doesnt seem to be swapped then
This is the post java16 one
Are you shading moshi?
yes
Show pom plox
* This is just a simple shim for linking in [StandardJsonAdapters] and swapped with a real
* implementation in Java 16 via MR Jar.
What
tasks.shadowJar {
relocate("com.squareup.moshi", "net.mangolise.deps.moshi")
}
it's inherited from another dep
(being controlled by us)
I would try to instantiate the RecordJsonAdapter and call it with a dummy value to check if the right implementation is loaded.
I hate this project. Would have never picked moshi. But then again, i think Kotlin is a borderline scripting language that shouldnt be used for bigger projects.
Yeap, idk who that is, but he speaks truth
lmao
it's private, and it getting too painful to debug, we're just gonna use another serialiser
yes :/
I mean, when are you calling the method? lmao
thats not a yes or no question btw
[12:27:38 WARN]: java.lang.NoSuchMethodException: missing.plugins.turboenchants.syntax.sections.TestSection.<init>()
(i used Class#getConstructor)
TestSection extends TurboSection which has a default constructor
getDeclaredConstructor ?
I never remember these things
nop
Did you declare another constructor?
yeah
public TurboSection(TurboSection parent, TurboSection[] children, ParsedElement... elements) {
this.parent = parent;
this.children = children;
this.elements = elements;
}
public TurboSection(TurboSection parent, ParsedElement... elements) {
this(parent, new TurboSection[0], elements);
}
protected TurboSection() {}```
ok
oh wait the subclasses need to have the default constructor as well
i thought it just inherited it
Class#getConstructor requires a public constructor (https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#getConstructor-java.lang.Class...-)
getDeclaredConstructor?
it still doesn't work if it's public, i just had to add the default constructor to TestSection
Oh, if you declared it in the super class then you have to declare it also in the sub one
That's why indeed
is there a way to force subclasses to add a default constructor
only through super constructor
does anyone know how to increase the radius a player sees when they are given blindess
nms workarounds would also work if possible
would you know which shader file
