#help-development
1 messages · Page 911 of 1
Yeah I already have a system that converts .bbmodel to display entities
YO
nerd
Sure sounds like a lot of cooking
The animations still need some work, but they mostly work
100+ guests at least
Do you wanna try it out with some of my models later?
yeaa, but don’t abandon this project
Yo that’s awesome
Not for the villager :p
He’s got speed, it’s fine
and he gets the crab massage
Cant ask for more
I wouldve renamed u to coll the chef if I had the permission to do so

wonder if packet entities will ever be properly supported
would be ideal for something like this
I know we have hideEntity and showEntity
We need a lot more than just those D:
just need the ability to create an Entity object or similar which isn't actually spawned into the world but can still be broadcast to players
yea
archamedis ships on spigot???
Well, its a mess to deal w that rn
also what happened to posting these in #verified clearly you aren't a ceritifed developer
I posted some in general earlier :p
Packets
Tldr?
You cannot not spawn an entity and have it being broadcasted to all players. For that you'll have to use packets.
Packets wouldn’t really help here
The issue is the client freaking out, doesn’t really matter if the entity exists on the server or not
how do you get all the separate entities to move as one coll? I feel like this is something that would cause lag behind or something\
Tbh I only read that message mb
They are all stacked on a single entity
like as passengers?
Yes
thats smart
I've yet to properly play around with display entities because I dread resource packs and that's mainly what I'd want to use them with
Fair
I just wish there was easier way to do plugin with embedded resource pack
I dream of a world where plugins are kinda like mods and you can just embed the resources you want 🥲 alas I am living in a pipe dream even thinking this
That’s eventually gonna become a reality more or less
I'll probably be done with spigot by the time such a thing is possible
mmm yeah but then you gotta do some jank shit with HTTPS
and the security of that gets questionable considering I don't trust my code to actually be secure
Mines not even https
💀
I mean all it does is listen for requests and return a stream of bytes
Not much else you can do
I wonder how servers work with multiple resource packs allowed now
do you like add multiple links
I'd have to check the API ig
Yeah you’d have to use multiple links
In theory my system should allow that, but I’ve only tested with one file
Mhm
The sha1 hash sum of the resource pack file what file does it mean
I'd assume 😕
Sounds fun maybe I'll check it out later
That’s my mini little server
Needs some updates tho
I think it’s secure? Since it just returns 404 for any unexpected input
Idk
Do you guys know of any good Packet event bus?
like a packet library?
Like a lib that can allow me to listen for any packets send / received and run code and get the packet parameters.
I know of 2
Actually 3
But last one is on fabric so doesnt count
else
TinyProtocol
And PacketEvents
I'm brand sapnking new to plugin development, but I'm very experienced in mod development
checkout packet events
good
alright, can you send the repository?
Your goal is to create new packets with mods and communicate with spigot ?
Oh yea btw, is there a tutorial for setting up a mod enviroment?
This is kind of my whole deal rn, and i'm not sure if it's even spigot. From the looks of it it looks like paper.
cant upload file
ow
Do you mean plugin environment ?
there is a paper template
not sure if there is a spigot obe
one
But the mc dev plugin on intellij should do the trick
yea so I have a project set up, and you can see what it looks like in the imgur file
Anyway unknown
yep, that's what I used
Unlike fabric or forge
You only in reality need a compile only dependency to make it work
tho, that being said, fixing mojmaps and other niceties obv implies a more complex gradle project environment
(Also u could use maven, tho i wouldnt recommend)
and as a equal and opposite force, I would recommend maven
but a valuable skill
I'm the most familliar with groovy and gradle kitlon (I prefer groovy)
yea thats fine
Rather invaluable I might say, as an opposite and equal force
well depends if you read it metaphorically or literally
invaluable
adjective
: valuable beyond estimation : priceless
funny stuff
like terrifying and terrific
yes but its not always used as an adjective to describe something that has more than a set value
invaluable is almost always used to mean priceless
and priceless also almost always means costly
mostly yes
or rather, too good to have a cost that can be paid
Invaluable actually has been recorded in the sense "without value," but such use has been exceedingly rare and is practically nonexistent today.
Maybe from 1380
I've never read a book that uses invaluable to mean bad
Interesting statement
where can i send images at
not bad, just without value
and without value can either mean good or bad
verify
where
either verify or use an image sharing link
use the /verify command with ur forum username
!verify
Usage: !verify <forums username>
there u go
yup
well maven still sucks for anything other than doing simple banal stuff
... rate limited??
lol
#bot-commands message
When someone says "a couple of" do you guys think of 2 or a few things?
exactly 2
few things
what is this bot broo
lmao
I send 3 commands and it's rate limited for 2-3 business days?
I dont have access to it
3 to 6 or 8
there we go
nice
does this look about right for a packet handler?
maybe
I havent used packet events tbf
I just know its good
I always inject my own netty handler
That;s the way the event bus I use works, but either my logger is broken or i did it wronf
if its my logger is
there's mixins?
API
goal is: you dont need mixins because the api should be delivering everything u could ever ask for lol
but in reality thats not entirely true I suppose
Well anyway for the curious, I use reflection to do hacky injection stuff, which works, but is by no means clean
oh yea i use reflections too
Oh man if we had mixins I’d be braking all the things
reflections <3
Technically you use reflection (w/o s), reflections is a class scan library
Yeah but have fun deconstructing the chunk data packet on your own :p

is there no event.getPacket(); ?
Make a wrapper from it
what dat mean
Each packet has a wrapper class you can construct using the event
oh yea thats exactly what i need
so is all the server receives is just raw bytes in a byte buf?
Yes
So i'm just trying to write a packet logger
Do i have to manually make a thing for each packet
there's no util or something to do it
if you wanna make a packet logger don't quote me on this but I feel like it'd be 200x easier to just inject into the netty pipeline yourself
Alright how can I do that?
can i ovveride vanilla minecraft commands?
sure
How can I get the players locale using API version 1.8.8?
Listen to packets?
hm?
It's still just Player#getLocale
I wonder if I can use that in my locales system
And sure if you insist on using packets its sent in the Client Settings packet
its not, its player.spigot().getLocale() but
public String getLocale() {
throw new UnsupportedOperationException("Not supported yet.");
}
I guess use packets for it then
gonna drop 1.8 soon
0x15 > Play > Serverbound
Player#getLocale was added in 1.12 right?
That spigot() method works fine, it gets replaced internally
Yes
What do you mean
You can use that method instead of listening to packets
.
It literally doesnt do anything
For 1.8.8?
Yes
Do you think I havent tried it
Possibly
How have you used it
I just used that method, it works fine for me
What issue are you having?
How can I get the locale on newer versions using 1.8.8 version API
You can't, the 1.8.8 was removed
o.o
Ended up using reflection
Until I drop support for older versions some day
why
player.getInventory().getItemInOffHand() doesnt return the item in the off hand?
targetOffHand is using player
what?
yea
ah
shit
thanks
now this doesnt work
target.getInventory().remove(targetOffHand);
can that method remove items from offhand too?
just use setItem(EquipmentSlot.OFF_HAND, null)
ah
this will work too right?
yes
k
any way i can improve this?
public String getLocale(Player player) {
String locale;
String serverVersion = Bukkit.getBukkitVersion();
String[] versionParts = serverVersion.split("-")[0].split("\\.");
int majorVersion = Integer.parseInt(versionParts[1]);
if (majorVersion < 12) {
locale = player.spigot().getLocale();
} else {
try {
locale = player.getClass().getMethod("getLocale").invoke(player).toString();
} catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
throw new RuntimeException(e);
}
}
return locale;
}
^
Is there a way I can hide a command from a specific player (without unregistering it?)
I guess just Player#updateCommands and filter out the ones I don't want in a PlayerCommandSendEvent listener?
I think this is possible with permissions
Don;t give them teh command permission and they will never see it.
The problem is that they have to see it and then not have to see it
remove the permission after they see it?
Fair enough but I'm not the one handling the permission
sooo I just filtered out the names ¯_(ツ)_/¯
Hello, how to make an entity with a custom texture and model (and even animations if possible)?
nah !
This is a very complicated task. You will have to write a lot of code and dabble in gut wrenching math.
Basic idea:
Create multiple armorstands or preferably display entities with remodelled itemstack which represent body components.
Then write a bunch of bone logic and make them follow animations which are exported from BlockBench
do you know any librairy that exist to make that? x)
I already have this in my bookmarks
https://github.com/MagmaGuy/FreeMinecraftModels/tree/master
Display BlockBench models in-game, for free, in an open-source way, under GPLV3 - MagmaGuy/FreeMinecraftModels
ModelEngine plugin exists, but that one is paid iirc
Yes, but the devs now charge a ton of money (i think it was like 40$) so im not gonna promote them.
I bought the old one and am still mad that i would have to buy it again. So im writing my own which uses display entities instead of armorstands.
Do you know of a Koth plugin that can be programmed for free?
Yo, when you finish that, wanna give us peasants access to it too ?
I plan on making one myself, but I'd really rather not to 'cause of all the math and I would not be able to make it performant.
Depends how interwoven it will be with my other code. It will also be a few months before this is done.
Yoo, I'm glad to hear there even is a possibility of that :D
GL with all that math!
any plugin can be programmed for free if you know enough about programming
how do i make item glowing?
i tried to apply some enchantments
enderPearl.addEnchantment(Enchantment.LURE, 1);
enderPearlMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);```
but it doesnt work
more code. Remember getting teh Meta is a copy. so if you get it before adding the enchant the enchant will not be on teh meta when you place it back
ah i think i found the issue
on: Specified enchantment cannot be applied to this itemstack
now im getting this
is there any enchantment that can be applied to all items?
addUnsafeEnchantment
thanks
Pretty sure they give you a free license if you ask nicely
setting the meta will wipe out the enchant you are adding
so i just set the enchantment on meta?
yes, or get meta after settign enchant
Can i createa private project on jenkins or do i need a whole new jenkins server for separate private projects
Hey do someone know from which class the AsyncPlayerChatEvent is called?
src/main/java/net/minecraft/server/network/PlayerConnection.java
or ServerGamePacketListenerImpl if you are on mojang mappings
Man why is the server being mean and not sending position updates to the client
:c
Game rude
Well if I can get the player to move
Can you
Did you know that between a valkyrien skies object and the world world edit sees around 64 bit integer limit blocks
what
can't you just add the player as a passenger??
or do it not be that simple
It's a passenger of a seperate entity
Which for some reason isn't sending update packets
why is player.canSee(Entity entity) marked as unstable? Also this is related to player.hideEntity(Plugin plugin, Entity entity) right
public static void injectPlayer(Player player, NPCManager manager) {
ChannelDuplexHandler channelDuplexHandler = new ChannelDuplexHandler() {
@Override
public void channelRead(ChannelHandlerContext channelHandlerContext, Object packet) throws Exception {
super.channelRead(channelHandlerContext, packet);
}
@Override
public void write(ChannelHandlerContext channelHandlerContext, Object packet, ChannelPromise channelPromise) throws Exception {
if (packet instanceof PacketPlayOutMapChunk) {
PacketPlayOutMapChunk loadChunkPacket = (PacketPlayOutMapChunk) packet;
Field xField = loadChunkPacket.getClass().getDeclaredField("a");
xField.setAccessible(true);
Field zField = loadChunkPacket.getClass().getDeclaredField("b");
zField.setAccessible(true);
int chunkX = xField.getInt(loadChunkPacket);
int chunkZ = zField.getInt(loadChunkPacket);
if (!manager.getNpcsInChunk(chunkX, chunkZ).isEmpty()) {
System.out.println("have npcs");
Bukkit.getPluginManager().callEvent(new PlayerChunkLoadEvent(player, chunkX, chunkZ, manager));
}
}
super.write(channelHandlerContext, packet, channelPromise);
}
};
ChannelPipeline pipeline = ((CraftPlayer) player).getHandle().playerConnection.networkManager.channel.pipeline();
pipeline.addBefore("packet_handler", player.getName(), channelDuplexHandler);
}``` why net.minecraft.server.v1_12_R1.CancelledPacketHandleException may occur here?
for (ItemStack drop : drops) {
if (player.getInventory().firstEmpty() == -1) {
isFull = true;
}
int fortuneLevel = player.getActiveItem().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS);
int dropAmount = 0;
if (fortuneLevel >= 1 && drops.toArray().length == 1) {
switch (block.getType()) {
case COPPER_ORE:
case DIAMOND_ORE:
case EMERALD_ORE:
case REDSTONE_ORE:
case NETHER_QUARTZ_ORE:
case IRON_ORE:
case GOLD_ORE:
case GLOWSTONE:
case COAL_ORE:
case DEEPSLATE_COPPER_ORE:
case DEEPSLATE_COAL_ORE:
case DEEPSLATE_IRON_ORE:
case DEEPSLATE_GOLD_ORE:
case DEEPSLATE_DIAMOND_ORE:
case DEEPSLATE_EMERALD_ORE:
dropAmount = ThreadLocalRandom.current().nextInt(0, fortuneLevel);
break;
case LAPIS_LAZULI:
dropAmount = ThreadLocalRandom.current().nextInt(4, 9 * (fortuneLevel));
break;
}
if (dropAmount != drop.getAmount()) {
drop.setAmount(dropAmount);
}
}
itemsToAdd[itemCount] = drop;
itemCount++;
}
Can someone help me? Items that go into my inventory are not affected by fortune
so why are you calculating that yourself
instead of just using the https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/block/BlockDropItemEvent.html
declaration: package: org.bukkit.event.block, class: BlockDropItemEvent
I'm using BlockBreakEvent, so should I replace it with that?
yes
I have a question
Is it possible to get the current date and time?
Also how?
Ik how to get specifics like hour and minute
How come max inventory slots is now locked to 54 when before it was up to 81?
But not all of it
????
When was it 81
it was never 81. Unless this is some 1.5 feature
or before or something
I've only been coding for a couple years but have been playing for a decade I never remember these 81 slot inventories
It used to allow beyond 6 rows
Read a thread on spigot before 1.14 was possible something similar
But they were glitchy af
oh the glitch??
I thought you meant like a real 81 slot inventory
that glitch wasn't even any good lmao
I mean if you had a custom inventory texture it would actually be useful
I still wanna know why this armorstand isn't sending position updates
Like, I could just send them myself but blah
?
Don't know if you got your answer but yes they're related. It's marked as unstable because it may or may not work as intended. It wasn't thoroughly tested enough over time to know whether or not it is stable
I believe it was recently marked as stable though 
At least setVisibleByDefault() was
hi
Im trying to replace the content of a title to the same text but translated to other language with an http request and working with packets, but im getting this error when trying to show the title Can someone help me? https://pastebin.com/FxbVzSp0
Code snippet: https://pastebin.com/Bi4XcDLj
return asyncTranslateText(text, "es").get();
you are blocking main thread
no point in doing it async if u gonna call get()
I undestand thanks
help me I have problems with interfaces and their implementations https://paste.md-5.net/vonatadima.java - what to do if 2 menus work with different items, how can they be generalized
Dragons need a dragon battle instance to control them
this sucks
same math is giving me different results for armor stands vs display entities
the math for model-based origin offsets is fucked
I'm starting to wonder if there's a feature mismatch between armor stands and display entities
it's like display entities don't accept the origin offset in the model correctly
not that that makes much sense
iirc I don't think they start with / but I might be wrong
remove that check and/or print the list before and see how they're formatted
u are misusing both removeIf and MONITOR priority
you don't need to iterate over collection if u are using removeIf
i have those?
also monitor priority unnecessary yea
oh
if you are looping you should instead just check if the current iterated command contains blah blah and remove it in that case..
public void onCommandSend(PlayerCommandSendEvent event) {
for(String commands : event.getCommands()){
event.getCommands().removeIf(command -> commands.startsWith("/") && commands.contains(":"));
}
}```
still misusing removeIf
i have that bro
you are calling it for each command in the list
you don't need to iterate over collection if u are using removeIf
Misusing
use (something) in the wrong way or for the wrong purpose.
Well the way they are doing it it is more of a clear rather than removeIf
HOWEVER, I'd say you shouldn't modify the collection at all, but that is just my two cents
I just realized they are using commands.contains(":") rather than command.contains
?
because the for loop variable is in plural for some reason
Do note: this has different behaviour than your original code
The original code was basically equivalent to
@EventHandler(ignoreCancelled = true)
public void onCommandSend(PlayerCommandSendEvent event) {
for(String commands : event.getCommands()){
if (commands.startsWith("/") && commands.contains(":")) {
event.getCommands().clear();
}
}
}
?jds-s
?jd-s lol typo
Oh actually, that won't work at runtime. The fixed version would include a break or return after the clear (as otherwise the loop will try to find the next element, causing a CME)
And well earnest to god you should be using permissions plugins instead of this
When it comes to permission checks, is it wise to include compatibility with general permission plugins? Or should it even matter considering we already get access to player.hasPermission?
would that work?
depends on what you are accomplishing to do
You can try it, but it seems like geol is saying it might just be easier/better to clear
It does not match the semantics of the original version that is
if (!ignoresFile.exists()) {
saveResource("ignores.yml", false);
}
if (!languageFile.exists()) {
saveResource("language.yml", false);
}
i dont need all this checks right?
Is it possible to remove the Anvil 'To Expensive' cap with plugins?
is there a way to give the player a regular chat autocomplete without creating a seperate player list? like, i'm working on emoji autocomplete and only want it to trigger once the message/word starts with :.
it seemed there used to be PlayerChatTabCompleteEvent but it got removed
Nope
alr, i'll just send a fake player list then :p
huh !
im just gonna assume theres no way to check for the last token of a chat message which is not yet sent? because that would probably violate every single privacy laws there are
why not, tab completion exists right?
setCustomTabCompletions is a custom packet mojang added
it does not "read" the last token of chat
mojang is so nice torwards modders
the method tells the client "here, think of these new strings as completions"
well, I need the completion to only show when the last token starts with :, so like the discord emoji autocomplete
well yoU'd register it with the : at the start
but would that show without the message starting with that
i mean thats honestly not a big deal
Yea I mean, you are not getting around that
would it be possible to have something different get entered when pressed tab
so that the preview would show
😭 :sob: but only :sob: would get entered
I don't think that's possible, atleast the last time I checked
okay ty
Hi uhh ik this is kind of stupid question but ehh , my brain is not braining xD
so when a user open the gui : /faction open .
3 factions , can select any , and when he do it will update the database with the new id of the selected Faction [1,2,3]
but its not updating.
when a user quit , it save it , but when i want to update it , it just keep on 0 ..
it create the user seccfully but it does not update him in database , i only update when a user quit better for performance.
I'd triple check the SQL argument positions
Fixed it :p
:p
How to create like a database? I want to store all the players that typed a command and clicked the item in the GUI
I want to keep their UUID and the name of the item they clicked
This doesnt seem like a spigot thing...
how do i remove this useless messages?
Well we do help people with misc dev stuff here too
Though mod dev is kinda a stretch lol but somebody probably is experienced enough to help with this. Not me though
Related code?
Try setting false to true. It should override the file data though
Yeah true will replace the file
You need to manually check if the file exists to avoid the message
bruh
i have to cancel every task in onDisable or not?
Anyone got a good idea on how I'd add looping music to areas? I know custom sounds and all that but how to know when it ends to make it replay is a bit not possible as far as I know. (Well possible but just inefficient or just bad)
why dont you just cancel the event when a command meets the requirement, so player's just cant use them?
or do you want them to be hidden as well?
if so i might have something for you
No. You're doing something wrong then :p
Gg
Store the duration and play it
That was my thought but then I thought about how much it has to constantly make sure the player is in said location.
uh?
if you try to play a sound that is out of range of a client it will be ignored
In my case that does not help.
You could have a jukebox that plays in loop
How exactly would I get it to play on loop
It seems to be possible to build such thing even in vanilla. Apart from that there is a GenericGameEvent that gets called when it stops playing
Wait when any sound stops or only Jukebox?
declaration: package: org.bukkit, class: GameEvent
Dang so I would have to use some Jukebox trickery.
declaration: package: org.bukkit, interface: World
Send the music you want this way when close enough. Then you dont have to worry about distance as it should play the entire track
The downside of this is you will have to lookup the time lengths for each song as you have to guess when its done before changing to the next. Not too difficult
Now you dont need jukebox trickery 
https://youtu.be/-GQ9zSdmx4k anyone knows what sound is this?
declaration: package: org.bukkit, enum: Sound
thanks

I could use ticks but if any TPS loss occurs it'll break the perfect loop.
Not if you are monitoring how many ticks went by
But even then no one is going to notice a 2-5 tick delay
There will be a delay of a few millis anyways because packets dont travel at an instant either
So whatever delay does happen will be beyond your control anyways
Without mods that is
I wish minecraft just had a loopable sound component. 😢
does this look right for making a new template plugin?
Well until then, what i presented is the best solution without having to mess with jukeboxes and the sorts lol
I normally change the MainClass package pack to something shorter as i dont like how the plugin names my packages
Dont forgor to name your pluginackage, and make a directory for all your intellij related proejcts isntead of storing them in your root
Mainly just suggestions, they can make your life a little eaier when trying to find that one random project you made 2 years ago
per world
great
is there javadoc for @EventHandler annotations?
?jd-s
declaration: package: org.bukkit.event, annotation type: EventHandler
wish i could download the sources for the spigot api so i can just look at the javadoc in my IDE
?stash
there's no sources.jar?
yes, just run buildtools with the sources arg
buildtools?
there's no gradle task?
spigot uses Maven
API sources should be on the maven repo, no?
Pretty sure they are
where cause gradle says it couldn't find the sources.jar
i mean
it's just there?
alongside the regular jar
it's the same artifact, just a different classifier, but your IDE&build tool should take care of all that
it doesnt work but wtv
do you know if it matters that the config file entries names have to follow a certain set of rules or can they just be a string
They have to be unique
And certain characters require them to be surrounded with quotes
but I can name something like "Default Buff %"
Yeah
okay good that improves readability a lot more
Can I also insert comments in to the config file?
If so, how?
declaration: package: org.bukkit.configuration, interface: ConfigurationSection
thanks
How can I set comments inside of a ConfigurationSection?
ConfigurationSection#setCommends(path, comments)
are you saving it
saving?
you have to save any modiciations you make
each line?
no
save it when you finish something
if its the default javaplugin one use JavaPlugin#saveConfig
well im adding them in the init method
so save it at the end
and i am
?paste the code
why are you creating it like that
just specify it inside the config.yml you ship in resources
huh
put the default config you want in src/main/resources
then call JavaPlugin#saveDefaultConfig
do i have to program in the default config, or can i just write it in the text file
just write it in the text file
It didn't work
is config,yml inside of src/main/resources with all the infomation you want as a default
correct
do you use maven
gradle?
yes
run a clean build
I use the plugin
oh yea it worked, i just deleted the old config file and refreshed gradle
How i can load an class into my server?
like
im trying to make use an lib called javamail, for my plugin
im importing the lib into my intelliJ
but the server gives me this problem
you would have to shade it, which would need maven or gradle
You aren't providing the full path.
Punishment Effects.Enabled
i've shade it but i have the same problem org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: javax/mail/MessagingException
that means you arent shadingit
I was referring to the comments not being set correctly.
yeah they call it on effectPath which means calling effectPath.setComments(enabled, ...) should be taking the effect path section path
i tried with this<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.2.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>mycode.test.Main</mainClass> </transformer> </transformers> </configuration> </execution> </executions> </plugin> </plugins> </build>
Oh, wtf. I don't ever see people set stuff to local variable for configs.
yeah its kinda weird
artifacts
that isnt compingin with maven
huh
I think you mean compiling. :p
yeah
open the maven tab on the right side of your screen open the lifecyle dropdown and press package then take the jar from /target/
the last snapshot right?
yeah
well
i copy it
the shaded one
into my plugins folder
and gives me the same problem
somebody n the bukkit forum told me i have to import the class for the server
idk
alr i did it but i dont think that's the problem
still gives me this org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: javax/mail/MessagingException
?paste your pom
is there a way I can edit the plugin.yml file from code?
I'm making a command registry thing that automatically adds in new command classes from reflections
add it to the command map
https://www.spigotmc.org/threads/create-command-at-runtime.592950/ read the spoiler on OPs message
which jar did you use?
from the build right?
yeah
the shaded one
well I know how to do all of that, I just need to know how I can get the command map
read the spoiler on the first message
what name
MyProyectTest-1.0-SNAPSHOT-shaded.jar
xd
use the one with no -shaded and make sure you delete any old jars on the server
what
well, i have the same problem
js an argentinian joke
most likely a javax mail issue then
there's an alternative?
no idea, what is javax mail even for
look
this is my idea
the player send his email, and the server needs to verify it sending an email to the email
got it?
let me try
Server.class
because its from craftbukkit and reflection accesses it
but it isn't, it's throwing the exception
show your code
i recommending keeping the command map as a final variable but looks correct
?paste the error
i mean I use the command thingy for my abstract command
paste the error
oh i think it was the access
yep
I was using a protected constructor rather then a public constructor
oh yea baby
this sources crap is starting to piss me off.
> Could not resolve all files for configuration ':downloadSources_e8ef20da-6ea5-4434-8ce9-5a9430cfdc20'.
> Could not find spigot-api-1.20.4-R0.1-SNAPSHOT-sources.jar (org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT).
Searched in the following locations:
file:/C:/Users/admin/.m2/repository/org/spigotmc/spigot-api/1.20.4-R0.1-SNAPSHOT/spigot-api-1.20.4-R0.1-SNAPSHOT-sources.jar
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html```
I can't see any javadoc
looking at that you dont have the spigot repo added and you dont have javadocs in maven local
then what do i need to add
yes there is
whats the groovy thing to add in the sources
its using your maven local as priority
it still doesn't work
there we go
for other people with my problem, add this to your gradle file instead of your current spigot api
compileOnly 'org.spigotmc:spigot-api:1.20.4-R0.1-20240222.090456-86'
its better to avoid that, as you wont get any new api that gets released
Imagine manually doing anything
Using my command method, I completely bypassed implements CommandExecutor and I cut straight to extends Command
im back, with a problem xd
java.lang.IllegalStateException: Not provider of jakarta.mail.util.StreamProvider was found
alright enough waffling,
I need to save every unique player's UUID and an int.
should I use the spigot config things or should i make my own JSON config thing
id probably use database for that
databse
so json thing
How can I get the root directory of the config for the plugin
this directory
JavaPlugin.getDataFolder
dependencies?
nvm i fixed it
How can I make a command with tab complete arguments?
is there a tutorial i can follow?
onTabComplete
or you can use a framework
that automatically does it for you
generating autocompletions for anything other than a simple command is complex and hard
are you sure you want to do it manually?
i can alrerady override the tabcomplete method
well my plugin only has 3 total commands, only 2 have tab complete,
both of them require a player as an argument, but i'd like to do something different from just online players, I have a file I want to read then parse all the keys as a argument
you can do that for sure
the way i've set up reflections 1) allows me to automatically register all command class inheritors. 2) it extends Command and not the traditional way of making a command
so i automatically get a mot more features
oh yea
I need to figure out a way to convert a UUID to a player
Bukkit.getPlayer
is the command args ordered like
/command arg1 arg2...
arg[0] arg[1] arg[2]...
I wouldn't say hard, depending on your skills. It's quite easy by using a command tree and deferring the invocation of completion to each command node. It's just time intensive to build, so you may actually want to opt into using a framework instead.
that was actually the easist thing i've done, it took a while to figure it out, but it was very straightforward
this needs support for offline players
Bukkit.getOfflinePlayer
I just stay away from dynamic commands lol
I find most plugins dont really have a use for such things and are not always useful. Just because a feature exists doesnt mean you need to use it.
does this request the API under the hood?
What api are you referring to? Like does it make a check with mojang servers?
yes
I believe it does if the player does not exist on the server to get the uuid
and why does it take so long for my plugin to process code in the enable method? I'm getting issues because of that
Uh...depends what your code is doing also plugin load order is not guaranteed
its a test server and im making a file
the issue is that when the server first starts, the file is null because it hasn't been read in the memory
If you are making a file in on enable then the file is null and even you make a file there is nothing to read
no like the file literally isn't there
However it still depends on code because there is like hundreds of ways to make files
it takes like 10 seconds to get added
Yes thus file is null because it doesnt exist. Which makes sense
Well it wont run the second server starts
It will run the moment the plugin is loaded
right but im getting some exceptions
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
It can be ran in a static block but I was having issues with static variables
and thats what i normally do for those files
Not sure why you need instance variable
i use it a lot
Ok but in the case of the main class its not needed
I add a lot of variables
Show the file variable
And just because you add a lot of variables doesnt change what i said about the main class
idgaf about the intstance crap rn
It's never been a problem
it is literally the first thing that is being ran
Until it is, alright not sure why trying to do other stuff with initializing a file variable
We'll talk when it becomes a problem, sound like a fair deal?
What does the playerdatabase object do?
makes a json file
What does getOutputFile return?
the Path
no it's a Path
So a string
java.nio.file.Path
Which is a string
sure
What exception are you getting? NPE?
yes
I assume its on the file.clear
no
java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonElement.getAsJsonObject()" because the return value of "com.google.gson.JsonObject.get(String)" is null
at me.wclient.dangerlevel.event.Events.onPlayerJoin(Events.java:20) ~[dangerlevel-1.0-ALPHA-all.jar:?]
at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:40) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
Ok so it says playerjoin event and we are looking at the onenable
Did you check to see if the file does get created? I would probably recommend getOutputFile returning a file object as opposed to path
oh yea i forgot to load the file
I saw a video where a bukkit plugin developer refactors students' code and I became interested, but then I realized that this is not related to bukkit, so I wanted to know who had seen this kind of video
Is there a way I can get the entity that caused the player's demise in PlayerDeathEvent ?
event.getKiller()
event.getEntity().getKiller()*
Well that's what the thread https://discord.com/channels/690411863766466590/1100941063058894868 was created for
event.entity.killer 👆🤓
Kotlin is just blessed
is it fine to use:
MapPalette.matchColor(...);
even though its deprecated?
I use it to send map data through packets
Where can I view the mojang mappings for nms?
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
?nms
also is it fine to use Vector#clone and Location#clone, if I want to use the current state of them, but not change them internally?
for example for some calculations
You have to clone it if you want to do operations on them without actually changing the source location (usually player's one or entity's one)
Other way is to do the calculations on values of the coordinates
Both methods will result in a new instance of these Objects
ok yeah, I was asking because you usually shouldnt use clonable 🤔
Yeah it's fine to use those
you shouldn't use clonable because the contract is doodoo
Hi , ahh so i want to create 3 custom texture banner in minecraft
anyone good with it can help me?
is there a way to make a custom resourcepack that have 3 custom banners?
i have been looking online but didn't find a defnitife answer ..
you can do 3d objects
What exactly are you trying to do ?
I believe banners render as builtin_entity instead of item/block model
So I think you'd have to make a banner model from scratch if you want to use custom model data
(also ew, 1.8)
But I am not sure, you'd have to go through vanilla files
Is there a way to improve tps by turning off light of redstone?
iam working with 1.20.4
i droped support for 1.8
Oh I saw 1.8 on your stream
Good
Well you need to create only one model, then just use different texture for each
yes , but what its called? the banners?
i did search it here
This page serves as a compact list of all unique item textures which have ever existed in officially released versions of Minecraft. For an overview on when each texture was changed, see the appropriate History of textures subpages.
Original texture files for Java Edition can be downloaded from https://mcasset.cloud/, and the entire default reso...
but didn't find the default banner
#1 use the new wiki
#2 don't look on the wiki for textures lol
#3 the banner textures are in entities
no just open the 1.20.1.jar
WoW its moving xD
where? exactly i did that
it's in assets/minecraft something something
player.addPotionEffect(new PotionEffect(type, Integer.MAX_VALUE, amplify, true, true));
Why is Interger.MAX_VALUE ingame not infinite or is there an Acutall infinte from the spigot API
PAPER LINK 
bro sends paper docs on spigot server but ig i take it
banning
?jd-s just spam the command like I do ;)
-1 is infinite
What's not to like about https://hub.spigotmc.org/javadocs/spigot/

why even include spigot again
the bungee javadocs are on the jenkins aren't they xD
Bukkit docs are on here too :p

public static void generatePlatforms() {
DyeColor[] colors = DyeColor.values();
DyeColor randomColor = colors[random.nextInt(colors.length)];
for (int platformRow = 0; platformRow < 4; platformRow++) {
for (int platformCol = 0; platformCol < 4; platformCol++) {
for (int rowIndex = 0; rowIndex < 16; rowIndex++) {
for (int colIndex = 0; colIndex < 16; colIndex++) {
Block block = Map.party.getBlockAt((int) (Data.firstPlatformBlock.getX() + (platformRow * 16) + rowIndex), (int) Data.firstPlatformBlock.getY() - 1, (int) (Data.firstPlatformBlock.getZ() + (platformCol * 16) + colIndex));
block.setType(Material.WOOL);
BlockState blockState = block.getState();
blockState.setData(new Wool(randomColor));
blockState.update();
}
}
}
}
}``` I'm trying to make a colormatch and here's my code, but why aren't the blocks being placed even though the code is executed, what's wrong here is that the state of the blocks doesn't change to colored wool?
yes
data has been deprecate for eternity
please do not use MaterialData
so is Material.WOOL
it should not even exist anymore
o.O
how do I set the color then?
I mean, each wool is its own material?
unless he forgot to set an API level
i have api-version: '1.12' in plugin.yml
thats wrong



?
lowest you can set is 1.13 (I think)
but what spigot are you actually wanting to use?
1.12.2
well, I have a 1.20.4 server, I just do 1.12.2 as well.

given that you should not be running stock spigot 1.12 in the first place you should either have a fork or maintain your own fork of the software anyway
1.12 has enough crash exploits for weeks
Not related to your problem, but I noticed that you are calling the checkEntities within the wrong block (I assume it's not supposed to be within the for-loop)
What kind of Set are you using?
And it's cool that you are using weak references, however you don't remove them from your collection once they get unloaded. Personally I wouldn't use references in this case, and instead just use isValid() to check whether they got unloaded and remove them within your iterator
As a Set by itself does not support GC on WeakReferences
Set type?
yeah, thats not going to clean up your WeakReference Objects
You are using a break and not a return within your checkEntity for-loop
This causes the entity to always get un-silenced
If it's not near ANY one of your locations, it gets unsilenced
no
If it's near ANY it shoudl remain silenced
your code unsilences it if ANY of yoru silence blocks are out of range
you need to loop all isNearby and set a silenced boolean if any are in range.. Then unsilence if it's false
no breaking out
boolean isSilenced = false;
for...
if (isNearby(..)) isSilenced = true;
if (!isSilenced) blah...```
Is there anyone that understands why my intellij doesn't recognize my spigot jar? i made it using buildtools
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
google WeakSet and teh first couple of links will answer
there is no WeakSet in Java itself
someone reviewed my resource & i posted update yesterday and now its gone
the review is gone and update isnt released
im pretty sure it wasnt a dream
lol
GroundHog Day
I'd say it was a dream after all 🙂
i released it on github
and then on spigotmc
why isnt it there
what about reviews
yesterday i had 4 reviews
now i have 3
Nah, you just crazy 🙂
If the update got removed any reviews on said update would too
So maybe that happened
nope
i updated it after the review
as far as i remember
can anyone check it
or why is the update gone
i didnt get any alert or something
@vagrant stratus
I think they didnt make one because semantically, Collections.newSetFromMap(new WeakHashMap<>()); should work
yea
anyone can help me make a model using blockbench ? i have the image
just need the model
should be a banner entity
public class CustomMonster extends Monster {
public CustomMonster(Location loc) {
super(EntityType.RAVAGER, ((CraftWorld) loc.getWorld()).getHandle());
this.setPosRaw(loc.getX(), loc.getY(), loc.getZ());
((CraftWorld) loc.getWorld()).getHandle().addFreshEntity(this);
}
}```
How do I make this work? I want to spawn in a ravager but give it custom logic
extend Ravager
yo howd I check if the exception im trying to handle is specifically this thing
but i want to give it the Monster aiStep
Aka HTTP request response code 429
it depends on the http client you are using
alright so I have a bit of a logic question, I want to know if a player is standing on fire but obviously a player can be standing in fire by being slightly on the block and not fully on the block, what's the best way of checking this? (except checking if the player is on fire lmao)
should i check if the 9 nearest blocks on the floor to the player are fire? 😭 (or maybe 4 idk)
check 8 closest blocks, as the player is two blocks high
could be stood near burning leaves/wood
are u in an interview or what 😂 @molten hearth
This is an easy check but prone to false positives. Best way to do it is to iterate over blocks in a radius and check if the player's bounding box expanded by 5E-3 overlaps with one of the fire blocks
bro im fucking coding fire logic in minestom because it doesnt have it
schedulerManager.submitTask(() -> {
if(event.getEntity() instanceof Player player) {
if(player.isOnFire()) {
player.damage(DamageType.ON_FIRE, 1);
// TODO: Verify this worked
player.playSound(Sound.sound(Key.key("entity.player.hurt_on_fire"), Sound.Source.PLAYER, 5f, 1f));
// Send Screen Shake
HitAnimationPacket hitAnimationPacket = new HitAnimationPacket(player.getEntityId(), 45);
player.sendPacket(hitAnimationPacket);
System.out.println(isOnFireNearby(player.getPosition(), 2, player.getInstance(), player.getBoundingBox()));
return TaskSchedule.tick(50);
}
}
ENTITIES_ON_FIRE.remove(event.getEntity().getUuid());
return TaskSchedule.stop();
});``` oh yeah now this is a banger 💀 💯
Should have said "this is fire"
it just came to me that this is a thing thats wild
Do it!
no wait im tripping lmao
idk i wanna die
😔
MinecraftServer.getSchedulerManager().submitTask(() -> {
for(Player player : MinecraftServer.getConnectionManager().getOnlinePlayers()) {
if(player.getGameMode().equals(GameMode.SURVIVAL)) {
Block below = player.getInstance().getBlock(player.getPosition());
if(below.compare(FIRE)) {
player.setFireForDuration(100);
}
System.out.println(player.isOnFire());
}
}
return TaskSchedule.tick(10);
});```
this is the code I meant to send earlier
System.out.println(player.isOnFire());
Wtf does this print?


