#help-development
1 messages · Page 85 of 1
register the recipe correctly rather than doing that janky method
I think you can do: Bukkit.getCommandMap().getCommand("command").unregister(Bukkit.getCommandMap());
Let me check it
But how do you register the recipe with ShapedRecipe class and support specific amounts in the ingredients is what he's asking
Can I use this to add to the config
Yes, but is not much information of how to do it
It's posible to do it with CraftItemEvent?
I dm'd you a kind of wacky solution for it using separate for loops to check the used and unused crafting grid slots, it can work for a simple craft like this which follows a nice pattern of identical ingredients in odd slots and air in even slots
But I also don't know how to make a ShapedRecipe with specific ingredient amounts and would like to see a solution like that too
I have a question: does a VehicleMovementEvent trigger if something like a minecart or boat is placed?
if not, i'd like to know which event would be most appropriate to attach an EventListener to for minecarts. I'm trying to create a rail crossing with a pressure plate in the center of 4 rails facing the plate, and I only want my code to trigger when a minecart is in proximity of a pressure plate. Basically, i want to make a pressure plate express the same sort of physics to a minecart that a straight rail does, but not restricting which cardinal direction makes the minecart think its on a rail.
?
I think placing boat is entity spawning
Docs probably say what to use instead
would this get the level of knockback a stick has?
final var PlayersStickKnckbackAmount = item.getEnchantmentLevel(Enchantment.KNOCKBACK);
It's cause of the MaterialData parameter. There is likely a replacement method that takes the standard Material enum.
Sorry, I missed the context. Recipes ignore item amount. If you want a recipe that requires multiple items, you have to listen for certain craft events and check the item amounts yourself.
try it out
hey how do i make an item that I spawn in be at maximum combine cost (cant combine things anymore in anvil)
yes :)
what is item
could you show me where you defined that
and maybe send the error?
item.getItemMeta().getEnchants().containsKey(Enchantment.KNOCKBACK);
and i think his getEnchantLevel usage should be correct aswell
If you're just checking for one enchantment, item.getEnchantmentLevel()
it just depends what he calls it on
could you rename me on discord to my forum username?
Can you link me your forum account?

Thank you!
Well it most certainly works ;p
So if something isn't working, then it's because of a logic error
is there a way to have arguments for a command in different classes? i know just make a new command executor but im aussming thats not the best since itd be registered like 12 classes for the different arguments
no not really optimal. I'd actually go about using a different command framework that bukkits
there are plenty of really good ones out there
Lamp, ACF, etc.
Brigadier even is really good if you get comadore with it
they have features for arguments in dif classes?
not exactly but they allow for sub commands
atleast lamps are same class but its cleaner to look at
really stops if statement hell as well
ah alright ty
I dont' know much about acf but i know its really good
as far as brigadier I have 0 clue I also know its good though
else if (args[0].equalsIgnoreCase("ban")) { if (args.length == 2) { int sizeBanList = Main.getInstance().getConfig().getStringList("Ban-Definitive-Ban").size(); Main.getInstance().getConfig().getStringList("Ban.Definitive-Ban").set((sizeBanList), args[1]); Main.getInstance().saveConfig(); } }
should do the trick
wich trick ?
remove the error hopefully
which event is fired first: PlayerInteractEvent or PlayerInteractAtEntityEvent?
anyone know if ACF allows me register multiple commands under the same alias across multiple plugins
for example
plugin 1:
/test a
plugin 2:
/test b
PlayerInteractEvent, since PlayerInteractAtEntityEvent fires under more specific conditions. Can anyone else confirm?
Oops, forgot to ping
Actually PlayerInteractEvent applies only to clicked objects (in the JavaDoc there is no way to get a clicked entity for this event), so it shouldn’t have anything to do with PlayerInteractEntityEvent or PlayerInteractAtEntityEvent.
same for PlayerInteractEvent and EntityDamageByEntityEvent?
Yes, those two events aren't related. PlayerInteractEvent is fired when a player interacts with an object or with air.
does the PlayerRespawnEvent run before or after the player respawns? (lets say I am giving a potion effect to a player when they respawn, it does not seem to work using PlayerRespawnEvent)
would there so happen to be an event or workaround for my situation?
delay adding the effect
with a task?
quick question: how do I handle an interaction in chat to a plugin with bungee cord api TextComponent? (idiot example, every time I click a chat msg an int var sums 1)
I got this error when compiling my plugin us.newrealms.timebounditems.EquipmentPacketProcessor is not abstract and does not override abstract method process(com.comphenix.protocol.events.PacketEvent) in us.newrealms.timebounditems.EquipmentPacketProcessor Does that just mean I need to set EquipmentPacketProcessor as a abstract class?
if im not wrong this say you need declare the method process(com.comphenix.protocol.events.PacketEvent) in EquipmentPacketProcessor
I declared process. What it is is that when I declare it I have to declare it as an abstract method but my overall class isn't abstract and it doesn't like that
U r little kid
But would adding abstract to the class change anything(I haven't really worked with abstract a whole lot).
Alright nevermind I just had done something wrong.
Thanks though
Ok little kid
When loading my plugin I get this error. I can't figure it out. Could not load 'plugins/TimeBoundItems-0.024Snapshot.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: Abnormal plugin type at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:87) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:153) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:411) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:319) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_19_R1.CraftServer.loadPlugins(CraftServer.java:421) ~[paper-1.19.jar:git-Paper-81] at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:278) ~[paper-1.19.jar:git-Paper-81] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1122) ~[paper-1.19.jar:git-Paper-81] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:303) ~[paper-1.19.jar:git-Paper-81] at java.lang.Thread.run(Thread.java:833) ~[?:?] Caused by: java.lang.InstantiationException: us.newrealms.timebounditems.TimeBoundItems at java.lang.Class.newInstance(Class.java:639) ~[?:?] at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:83) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?] ... 8 more Caused by: java.lang.NoSuchMethodException: us.newrealms.timebounditems.TimeBoundItems.<init>() at java.lang.Class.getConstructor0(Class.java:3585) ~[?:?] at java.lang.Class.newInstance(Class.java:626) ~[?:?] at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:83) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?] ... 8 more
Yes u can
But u must declare only one and other not as a command
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
How will learning java help with that?
It will help
U can’t even understand a stacktrqxe
Idk how you like you programming
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
How do I check if a block is inside a region? I've been trying for a bit but I can't seem to figure it out
@EventHandler
public void onBlockBreak(BlockBreakEvent e) {
Block block = e.getBlock();
Location blockLoc = block.getLocation();
RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
RegionQuery query = container.createQuery();
ApplicableRegionSet set = query.getApplicableRegions(blockLoc);
}
I have this but its saying blockLoc has to be a different type of location type
There should be a method in BukkitAdapter to convert
@boreal seal being toxic again, just ignore him. Learning java is more than just learning what certain things do, it also for people who know java to take refreshers on things. As humans we aren't perfect and sometimes things slip our mind or fall outside of our understanding. Things also change rapidly over the years. Being able to read a stacktrace is a very useful ability and while I'm not sure if the links in the bot cover stacktraces it is something I definitely recommend googling (or duck duck going if you prefer not to be tracked... Most of the time... Looking at you Bing...)
i was gonna say he seemed to not be being very helpful..
Well theirs actually a couple of articles in the plugin development section of the spigot page I ended up reading and determining what my issue was. thanks though!
In his eyes he's the most helpful because he's teaching newbies the "XYProblem" lol
While the XYProblem is a good thing to keep in mind, it's not the be all end all solution and doesn't warrant being rude.
I do have another question though. I'm working with packets and I was using what ProtocolLib tells you to use to setup the initial packet listener and such but when I load my plugin it just throws NPE errors at me because my declaration(same as what the protocollib wiki says) is "null". If you need the error or to see my code I'll send that but I think I gave enough information.
Their was a 2 hour argument about this like 2 days ago
I've never worked with ProtocalLib and so this is a question for somebody else.
ok
What version are you using
1.19
I actually don't reccomend using protocol lib
I think he means of protocallib
no I meant spigot
Oh nvm I guess lol
I have 2 good options protocol lib is overly verbose versus either Mapped NMS or PacketEvents by Retrooper
Primary reason I used it was I couldn't find much of how I can learn how to do Packets and it was a plugin I knew
https://github.com/retrooper/packetevents <-- ProtocolLib without the bullshit
imo best way to learn stuff is just fuck around with it till it works
https://blog.jeff-media.com/nms-use-mojang-mappings-for-your-spigot-plugins/ if your curious about mojang mappings option
and most of the code I've created are written for ProtocolLib and I don't really want remake what I've already done unless its doesn't work.
because I'm not kidding ProtocolManager manager = ProtocolLibrary.getProtocolManager(); this is my initial declaration for the ProtocolLib stuff and in the error it gives me it says that results in null...
which doesn't make sense
are you shading protocol lib
if so don't just put protocol lib in your plugins folder
then it should return fine
It gives me the same error whether I have protocol lib on the server or not.
took a second cause I had to double check if that was true or not
I got this error https://pastebin.com/ivhpHG4Q when loading my plugin. From what I read it's caused by ProtocolLib and when looking at ProtocolLib's common error page it says a common error is NoClassDefFoundError for BaseComponent and I don't think that matches my error but I want to make sure before I report it to them(No I can't update protocollib)
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
do you have protcol lib on the server
did you make sure its not being shaded/shadowed in your maven/gradlew build
do the versions you're using match from pom/gradlew to plugin jar
Yes, I think so, yes @river oracle
I think so isn't really good enough class not found errors happen when the dependency isn't there or its shaded and their simultaniously
my assumption would be one of those two things would be happening
So that error wouldn't be a protocollib issue?
So its something I can/should fix not something to report.(sorry I'm not understanding what your saying.)
I need some help
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
looks like you already asked in help server be patient
Okay thanks
As far as I can tell I'm not shading protocolLib into my plugin and I know that protocol lib is their and that if I remove it it will cause problems.
send me your pom
send me the name of the protocol lib jar in your server
ProtocolLibdev1.19.jar (I added the dev1.19 so that I could keep my old protocollib version).
having 2 protocllib versions in your server is going to be the issue
get rid of one
you have no choice its a either or
what version of protocol lib did you download do you know?
I only have one protocollib on my server
because for 1.19 you are supposed to do dev versions
I did dev version #600 which is the latest
hmmm I'm not sure tbh it'd be best to open an issue/go to their discord if they have one and ask
using dev builds you can always have issues i guess
even if you are doing something on your end they'd know more than me
ok
Caused by: java.lang.ClassNotFoundException: net.minecraft.server.level.ServerPlayer
bruh
shows no errors during compilation
or in the IDE
only shows this error when i try to run it in minecraft
I've never used NMS, but doesn't the namespace typically include the server version? Are you using a library?
If so, is that library being shaded, or loaded as a plugin?
im using a library
not for mojang mappings
which also happens to use nms
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<classifier> remapped-mojang </classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.nuggetmc</groupId>
<artifactId>TerminatorPlus</artifactId>
<version>3.2-BETA</version>
</dependency>```
the second one is the library im using
Are you shading the library, or is it meant to be loaded as a plugin?
If it's a library it needs to either be shaded, or loaded as a plugin on the server. If the library itself isn't a plugin then it needs to be shaded
alr
You need to include the library plugin inside the plugins folder too
Of your server
aw
the library im using is local
its not hosted anywhere
idk if that means anything
cuz the creator didnt bother putting it up anywhere
wdym local
uhh
Just slap their plugin in along side with your plugin on your server
i did a command to include it
was something like mvn install:installfile
If they said it was a plugin, the same rule applies. You need to take their JAR file and put it in the plugins folder on your server
In your plugin.yml add their plugin as a dependency
It will ensure your plugin loads after theirs
i dont think thats the error
Caused by: java.lang.NoClassDefFoundError: net/minecraft/server/level/ServerPlayer
Can you paste the log?
?paste
The full log, not just the stack trace. I want to see if your plugin is loading before or after theirs
Load order makes a difference. Their classes wont be available if their plugin isn't loaded first.
[06:53:50 INFO]: Max TNT Explosions: 100
[06:53:50 INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
[06:53:50 INFO]: [TerminatorPlus] Disabling TerminatorPlus v3.2-BETA
[06:53:50 INFO]: [NPCTest] Disabling NPCTest v1.0
[06:53:50 INFO]: Loaded 7 recipes
[06:53:51 INFO]: [TerminatorPlus] Loading TerminatorPlus v3.2-BETA
[06:53:51 INFO]: [NPCTest] Loading NPCTest v1.0
[06:53:51 INFO]: Server permissions file permissions.yml is empty, ignoring it
[06:53:51 INFO]: [TerminatorPlus] Enabling TerminatorPlus v3.2-BETA
[06:53:51 INFO]: [NPCTest] Enabling NPCTest v1.0
same exact error 💀
Are you running /reload or actually restarting your server?
Because you shouldn't use /reload
That probably isn't the source of this error specifically, but it is bad practice.
In this little snippet, I don't see remapped mojang
Are you putting remapped mojang's jar file in your plugins folder
im gonna guess no
Because you should
You don't know for sure? It's your server right?
Download remapped-mojangs jar file and put it in the plugins folder
what
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>```
this is remapped right?
im so confused rn
Not from the maven repo, as that one is probably stripped
Ah wait, I might be misunderstanding
Ok, so when you run buildtools, it generates a few jar files right?
One of those should be the server jar
You will need to use that as your server jar
I thought remapped mojang was a plugin, but it is actually a compile flag.
That was my mistake lol
where the server at
That's a good question, it is your server so I guess wherever you decided to host it?
It would be named something like spigot-1.19.jar but it may include -remapped mojang in the name
oh alr
Do not use api jars
Yeah, but you can get the jar file using your file explorer
You don't need to worry about it being in the maven repository at this current moment. You just need the jar file to replace your server jar.
-remapped-mojang.jar I would use
no
if you want to use mojang mappings follow this guide
https://blog.jeff-media.com/nms-use-mojang-mappings-for-your-spigot-plugins/
The jar you put in your servers should be the regular jar file none of hte special names. The regular jar will also contain all other shaded dependencies
it doesnt start
no way 🤯
its almost as if im using the exact same mojang mappings that are on every single google search
I didn't know this. It's been a while sense I've used buildtools
I offered you help and a direction if you don't want it just fuck off and ignore me
💀
I mostly just use paper these days
my bad
its a bit quirky xD
Seems like it lol
its ingrained in my brain now though lol
will never forget java -jar BuildTools.jar --remapped
I use it way to much xD
--rev for version
Luckily for me, my plugins are more on the simple side and don't need this
yea I don't use NMS much either
mostly use it to decompile and screw around for a couple hours here or there
It's fun to see how much damage you can do to the games you love
The Item#owner is the person who first picked up the item right?
Like it will never change unless specifically changed
declaration: package: org.bukkit.entity, interface: Item
no, its the person who dropped the item
I'm not quite sure you'd have to test that out I'd assume it'd just be whoever held it last
Sets the owner of this item. Other entities will not be able to pickup this item when an owner is set.
Mike - Read The Docs - Shadow
can i somehow change the last location of a disconnected player? without tricks like teleporting them immediately the next time they connect or something like that. is there some entity in the world that represents the last known location?
Ahhh
on quit event the player technically hasn't left yet so while they are leaving you could teleport them
they wouldn't feel any effects as they are leaving either
Is it possible to check if the item was previously picked up before
I'm not sure if this is any help to you, but I don't think this is tracked by minecraft/spigot at all, what you could do is add a byte of persistent data to see if it was pickedup before
apply this to the item on first pickup and follow through with logic on corosponding events
Oh yeah that could work
basically I'm trying to make a collection system so people can't just drop it and pick it up again lol
Cant do that, you see, what im doing is moving an entire city along the y axis, since now you can go deeper than y=0. I need to do that without any player connected, and the new position will only be valid after moving it, so i cant teleport them on disconnect, since they may reconnect before that new location is valid
Idk, if its too hard or i need to use nms or something, i gues ill just teleport them once on the first login after that
Tho i would prefer to avoid the need to keep a plugin forever just for that
okay this is pretty much all 100% theory, but on leave store the players uuid in a list on join remove it. This way you don't have repeats in the list. When you go to move the city trigger the runnable while the city movement code is executing that reads off the player UUIDs into an OfflinePlayer object now that you have the OfflinePlayer object you should beable to modify their NBT spawn data with your new locations. This should allow a clean transition on next spawn
So, basically, if i have the uuid, i can get an offline player object, in which i can set the location
granted you need to know the NBT tags to set thats where I can't help you anymore
but its somewhere in there likely
Will essentials interfere with that?
depends on what you have essentials doing
if it spawns the player at X location every join yes
otherwise no
Writing to the NBT is writing directly to the player's data file
players appear where they left so, i dont think i have any plugin touching that, not even essentials
So ill try that, thanks
You might have to do some try and see with the NBT tags to see what they all are I couldn't find any resources on what the OfflinePlayer NBT contains
but I'd assume there is something in there regarding spawn location
The
Entity#remove()
method didn't works at the onDisable?
I help many people
Lmao
Just that guy should go to help in plugins section
And use skript 😂😂😂😂🥴
Don't let them reconnect before that new location is valid?
Probably not what they are going for the event probably occurs at x time where players are kicked?
How are you guys handling permissions in your plugins? Like, if I have one permission needed for several things I don't wanna write it over and over again, are you saving them into some string variables, etc? Would be interesting to know
Consider the onDisable as already disabled
Constants
You could also use enums
I save the base secontion as a String and adds the current command name (for instance "pluginname." Is the base section and "commandname" the name command). All of that is managed by my command framework actually
that's a kinda cool "automation"
That's what I'm doing rn actually
Do you also append args to that?
Yeah, if the command is acting on other players for instance, I add ".others".
Btw I just have one command, but multiple args in fact (that's why I made a command framework)
So /command test and /command yo are 2 different commands for me
yeah, makes sense! that's cool
how do you handle that in events when there is no command?
I keep the base section ("pluginname.") And adds manually the name of the feature. No need to create a system I guess
But I usually like to create a method to checkPermission, and automatically: return, send a message, etc
that's a good point, haven't thought about it yet. Might actually implement that too!
Thanks for the insight :)
to collect everything within "" should I use indexOf or a for-i loop
Hey guys I've got a problem with a plugin I'm trying to do
I'm totally new in the matter and every time I'm importing something an error occurs saying that "org.bukkit.(whatever) is accessible from more than one module: org.bukkit and org.api"
does anyone know how to solve that?
hey why does Player#teleport(location) spam console with "Player moved too quickly! (coords)"
Probably you have ac if the text is colored. Or its spigots own reporting idk
It’s on my test server, no anti cheat, or any other plugins that should cause that
Yeah prolly spigots own
But i dont have an information
Dont have an opinion but try this
This would most likely work, however, I’d like to not mess with the game rules. especially since I plan to release the plug-in to the public, and they might want the gamerule on
How well is your server performance?
#toCharArray and loop through those
Wdym by that? It tends to perform pretty good. If your talking about player wise, I’m not sure why it would matter as well as the server isn’t public just yet while it’s under development
If the server or client lags, then the delay can cause this message iirc
But if it’s performing well then it’s probably not the issue
Ah yeah, not it performs pretty well, I give it like 8gb of my system memory to make sure lag isn’t an issue on my test server
any help?
I had this issue a while ago and iirc there is no way to guarantee that the entity is being removed in the onDisable.
I always removed it after the server startup
onDisable is so your plugin can clean up after itself, not make changes to the world
iirc remove() only "marks" the entity for removal on the next tick or so. I'd simply apply a PDC tag to the entity like "myplugin:tokill" -> (byte) 1.
Then listen to EntitiesLoadEvent, check if any of the entities has this PDC tag, and if yes, remove() it then
im pretty sure most beginners wouldnt understand it
even if you learn java
you need to pretty much learn the meanings of all the exceptions, except if they're self explanatory
Thats amazing
thanks!
your plugin doesn't have a no-args constructor
note that your plugin needs to be enabled on STARTUP and not POSTWORLD, otherwise you cannot listen to the EntitiesLoadEvent in the spawn chunks
although you could of course also just loop over all already loaded entities in onEnable()
both would work
tho second would be slower maybe
unless they /reload
/plugman reload 🤡 💀
I thought it was before. Cause you can set no gravity to an Armorstand in 1.8
1.8.8 doesn't have this method
so um, I had this bug with minecraft where any versions 1.18 and above would freeze every 1 second, meaning the graph would be some thing like this:
300 -> 1 - 250 -> 1..etc
so well i used some jvm args i got recommended which ill send later,
and that fixed it, however after 3 days the bug is back, but i realized something, when the bug was fixed i had 2gb allocated and it was using 2.7gb, but when the bug still existed it was using 2gb flat, so i thought maybe that was the problem, i just tried allocating 3gb or 4gb and no luck.
the jvm args are here: https://pastebin.com/3mK9yZFf
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
How can I add an enchantment to an block (without nms)?
No. I mean so I can give dirt for example the enchantment glint in the inventory
Enchanted beacon
I'll enchant my door protect 4 so zombies won't pass
Bru what about curse of vanishing on a block
I get his error:
java.lang.IllegalArgumentException: Specified enchantment cannot be applied to this itemstack
Lmao
addUnsafeEnchant
You can't apply each enchantment on all items
The glint isn't there
?paste
Version ?
api 1.13, server 1.19
is the 1.19 |1.18 |1.17 R3?
would it be possible to say, have a crafting recipe require a potion (the potion can be of any type) and the attributes of the item given from the recipe depend upon the effects the given potion has?
You'll have to create a craft recipe for each potion effect
you can do everything with codes
ah fuc
Not in Minecraft 🤡
you can
if you code enough, anything is possible
if something is "impossible" then write a mod
if it's impossible then make it possible
Yeahhh but we're talking about plugins here 😂
- just hack microsoft and push a fake update
I wanted to make some sort of tinted potion item
which would hide what effect the potion has
could I make a shaped recipe with it tho
which also changes the outcome depending on potion
if you want only to hide the effects, you cann listen the event and add an ItemFlag to the result
also wanna change color
also listen the event and apply the color
wait a minute
if the crafting recipe doesnt exist and the player doesnt actually technically craft the item what do I run the event for
how can i prevent a player from eating / start eating?
too bad it's client side
you can use the MaterialChoice in the recipe
so the recipe will listen for every potion
Hello, I am developing a CustomSkullGetter method and this is the result. The only problem is that Legacy Item is initialized and causes a Thread break for about 5 seconds.
Can you give me a solid alternative/advice or help please?
public static ItemStack getSkullHead(final String val, final String name, final List<String> lore) {
final ItemStack head = new ItemStack(Material.LEGACY_SKULL_ITEM, 1, (short) 3);
if (!val.isEmpty()) {
final SkullMeta skullMeta = (SkullMeta) head.getItemMeta();
final GameProfile gameProfile = new GameProfile(UUID.randomUUID(), null);
gameProfile.getProperties().put("textures", new Property("textures", translateValue(val)));
try {
final Field profileField = skullMeta.getClass().getDeclaredField("profile");
profileField.setAccessible(true);
profileField.set(skullMeta, gameProfile);
} catch (IllegalArgumentException | NoSuchFieldException | SecurityException | IllegalAccessException ex3) {
ex3.printStackTrace();
}
skullMeta.setDisplayName(name);
skullMeta.setLore(lore);
head.setItemMeta(skullMeta);
}
return head;
}```
Don’t use the legacy item?
how do I get a circle around a player
place blocks in a circle or play particles or whatever
Im not sure that It will work without
It will. That method still works for 1.18+
Since a Skull_Item doesnt exists
Just use the PLAYER_HEAD instead.
It is only legacy
Should I maintain the java (short) 3?
No, as those are magic values that are no longer needed post 1.13
Fixed, thank you bro
Can you give me a coding opinion guys about this plug-in (Its mine)?
https://www.spigotmc.org/resources/identity.104776/
How can i fix this error? https://pastebin.com/nWyR2K0R
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
show your code
public static ItemStack getHandCuff() {
ItemStack item = new ItemStack(Material.STICK);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName("§7§lManette");
item.setItemMeta(meta);
NBTItem nbtItem = new NBTItem(item);
nbtItem.setString("handcuff", "handcuff");
nbtItem.applyNBT(item);
return item;
}```
so um, I had this bug with minecraft where any versions 1.18 and above would freeze every 1 second, meaning the graph would be some thing like this:
300 -> 1 - 250 -> 1..etc
so well i used some jvm args i got recommended which ill send later,
and that fixed it, however after 3 days the bug is back, but i realized something, when the bug was fixed i had 2gb allocated and it was using 2.7gb, but when the bug still existed it was using 2gb flat, so i thought maybe that was the problem, i just tried allocating 3gb or 4gb and no luck.
the jvm args are here: https://pastebin.com/3mK9yZFf
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Caused by: java.lang.NoSuchMethodError: 'org.bukkit.inventory.ItemStack eu.jettstudios.Utils.Utils.getHandCuff()'
How can i fix it?
it says the method you are trying to call does not exist
getHandCuff
is it in a different jar or something?
No
you will need some math
calculus?
yes
hahahai hatem ylife
can you give me a general idea
not code, just what I need to do
Can someone help me about this
whatever scuffed version of a server software you are using is failing to connect to some api/website
so um, I had this bug with minecraft where any versions 1.18 and above would freeze every 1 second, meaning the graph would be some thing like this:
300 -> 1 - 250 -> 1..etc
so well i used some jvm args i got recommended which ill send later,
and that fixed it, however after 3 days the bug is back, but i realized something, when the bug was fixed i had 2gb allocated and it was using 2.7gb, but when the bug still existed it was using 2gb flat, so i thought maybe that was the problem, i just tried allocating 3gb or 4gb and no luck.
the jvm args are here: https://pastebin.com/3mK9yZFf
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I am using web panel papermc. I changed it to spigotmc and this happening rn
whatever that is is neither papermc nor spigot
dude i just download skin restorer plugin and it doesnt show in the plugin files
but i can use the plugin
Neither spigot or paper contain a obfuscated Updater class
check your console for errors, make sure to be in online-mode=true unless you are behind a online-mode=true proxy
you are infected with malware, you can look at conversatin in #help-server
no errors
Is their a way without building an AI system that I could create an iron golem that would be like a village golem except towards a specific player?
Probably

yeah ive been googling for days
asked on 9 servers daily
no one knows what the problem is
For what
so um, I had this bug with minecraft where any versions 1.18 and above would freeze every 1 second, meaning the graph would be some thing like this:
300 -> 1 - 250 -> 1..etc
so well i used some jvm args i got recommended which ill send later,
and that fixed it, however after 3 days the bug is back, but i realized something, when the bug was fixed i had 2gb allocated and it was using 2.7gb, but when the bug still existed it was using 2gb flat, so i thought maybe that was the problem, i just tried allocating 3gb or 4gb and no luck.
the jvm args are here: https://pastebin.com/3mK9yZFf
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
its client side btw
i tried using default jvm args
and removed the Xms flag since some people suspected that
updated java
reinstalled minecraft
restarted pc 10 times
reinstalled java runtime
use 0.5gb and 2gb, my game works great with that
Haven't tried using a different version of java?
What graphics card do you use?
AMD?
no, intel
amd doesnt have integrated graphics
They used to didn't they?
i doubt you can come up with a solution with a few questions
i asked a few dozen people, none of them knew
minecraft support isnt responding either
i asked in minecraft discord server too btw
Is this only with the latest version of the game?
gotta use these
-Xms4G -Xmx4G -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-OmitStackTraceInFastThrow -XX:+ShowCodeDetailsInExceptionMessages -XX:+DisableExplicitGC -XX:-UseParallelGC -XX:-UseParallelOldGC -XX:+PerfDisableSharedMem -XX:+UseZGC -XX:-ZUncommit -XX:ZUncommitDelay=300 -XX:ZCollectionInterval=5 -XX:ZAllocationSpikeTolerance=2.0 -XX:+AlwaysPreTouch -XX:+UseTransparentHugePages -XX:LargePageSizeInBytes=2M -XX:+UseLargePages -XX:+ParallelRefProcEnabled
``` 
It's a meme but you can try it anyways
though idk if thats good since ur forcing it to use 4gb
:(
It works better that way
welp i already tried a dozen other solutions
Are your graphics drivers up to date
another one wont matter
i think so
It's a different garbage collector than what your args use
game didnt launch

Make sure you're using java 17
exit code 1
mojang moment
minecraft has its own java builtin
True
-Xms4g -Xmx4g -XX:+UseShenandoahGC -XX:+AggressiveOpts -XX:+UnlockExperimentalVMOptions -XX:+AlwaysPreTouch -XX:+UseStringDeduplication -Dfml.ignorePatchDiscrepancies=true -Dfml.ignoreInvalidMinecraftCertificates=true -XX:-OmitStackTraceInFastThrow -XX:+OptimizeStringConcat -Dfml.readTimeout=180 -XX:+UseFastAccessorMethods
You can try Shenandoah too if you want
imma point the java executable to
C:\Program Files\Zulu\zulu-17-jre\bin\javaw.exe
yeah it didnt change anything
zulu damn you really are desperate
i am
If nothing works you might as well just sell your pc and buy some skittles and coffee and hop on pocket edition
i trieimma try this
but shouldnt it be
4G not 4g
case doesn't matter
case doesn't matter
I believe you need OpenJDK to use it
do i install openjdk jre now?
I'll test something brb
Are you launching optifine
yes
I assume vanilla gives the same issue
just nuke your installation
reinstall everything
make a windows vm to play minecraft
Doesn’t optifine have a autosave setting in settings?
yes
The first thing I sent works with the openJDK 17 microsoft build
It's uh, something lol
so i should get openjdk 17

Everything I’m finding says it’s something to do with optifine but if it’s doing it without optifine then I’m at a loss for words
you're at a loss for words then
case insensitive
quick question
do you have enough disk space 👀
could be something tripping with cache files
300gb surely is enough for minecraft
You are using 64 bit Java right
yes..
i just updated my drivers
since there was an update
imma try again now
idk if i should restart since it didnt tell me to
and if it didnt tell me to restart
then its probably not something that matters
so im doubting if that would fix it
I can get Shenandoah working on OpenJDK 17 so if you have it you can try -XX:+UseShenandoahGC as an extra arg
imma get openjdk 17 jre if this doesnt work
is it possibly to only show certain mobs to certain players using only the spigot api (no nms)?
ok it didnt fix it imma get openjdk jre 17
I get 40fps in 1.19. Something about the update sucks for my PC
ok how do i do this
Install openjdk make sure it's not oracles openjdk then add the Shenandoah arg
exactly what i asked on "how to do"
how to install the open jdk thats not oracle's
do you have a link? since all im seeing is jdks
Oh I downloaded a Microsoft build of it
i use windows
Yeah I got the jdk cause I'm lazy
Extracted it into my already thicc java folder and then set my MC to it
does all of your stuff also get posted by random chinese users on mcbbs?
or is this just me?
it just keeps happening
Yeah my Mod is bigger there than in English last time I checked
They event used machine translation to create a translation
The comments are always a joy to read
https://www.microsoft.com/openjdk I used this. It's ugly but it works
Just a question, why u 2 don't create a thread
because no one else is using the channel
Cause #help-development looked lonely and needed a friend
and we started talking before anyone came
if u want to talk, YOU make the thread
because we came here first pretty much
yea just saying threads exist
imma try this now
with microsoft
openjdk
i got a crash
wow
I only got the Shenandoah enabled
I just append this to my args
The default args that is
imma tr this
ok an exception occured
on start
i love my life
-XX:+UseShenandoahGC
so i append this
to the default args
That's what I did
-Xms3G -Xmx3G -XX:+UseShenandoahGC
thats all you use?
It works with that
You'd have to add more args slowly to see what works.

I haven't slept in 24 hours I'm not exactly present
There's a website leaking premium plugins tf
that's kinda sad
Ah well. 1.18+ is a lag fest so guess you gotta wait and see
might or might not contain malicious code
you can't do a static access to hasPermission
move the declaration of your player variable before the if
and then use it
wait for what..
CTRL + L & CTRL + O is love
^^
Does anyone have an idea as to why this code isn't working, it never changes anything in the file, the file is always empty?
The "createFile" method is called in the onEnable method, of course.
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
^^
Your reload is stopping itself from doing anything
It saves and then loads
If you start with an empty config, and try to load from disk by calling reload, which saves first, what's going to happen?
It saves the empty config, overwriting anything that was in the file, then loads those same values
As in, no values, because it's empty
I know, I tried without the save() method, but it still did not add any values.
Do you specify any?
I see you adding defaults, which aren't the same
Defaults are in-memory, they just set what will be returned for a key if it hasn't been explicitly set
They don't actually set values that will be saved
If you want that, call saveDefaults
I don't see any "saveDefaults" method in the code, and neither in the JavaDocs.
Plugin#saveDefaultConfig
I tried using copyDefaults, set, and addDefault, but none worked.
Won't that just save the default config.yml file?
so um, I had this bug with minecraft where any versions 1.18 and above would freeze every 1 second, meaning the graph would be some thing like this:
300 -> 1 - 250 -> 1..etc
so well i used some jvm args i got recommended which ill send later,
and that fixed it, however after 3 days the bug is back, but i realized something, when the bug was fixed i had 2gb allocated and it was using 2.7gb, but when the bug still existed it was using 2gb flat, so i thought maybe that was the problem, i just tried allocating 3gb or 4gb and no luck.
the jvm args are here: https://pastebin.com/3mK9yZFf
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
It seems that when I use this.player.getInventory().getContents().clone(); it clones the inventory but forgets how many of each item are in it. Is there a way to make a shallow copy of the inventory, keeping the contents?
this is client side btw
Check timings
its client side
Well this is spigot plugin development support
Poor Redempt, we're all torturing him, lol.
😔
then where am i supposed to ask 😢
this is the most active coding server related to minecraft
The max pause is 200ms
just xms 3gb xmx 3gb sheondan gc
I tried using saveDefaultConfig and saveResource, none worked, I guess I'm just gonna use some other config library, probably BoostedYAML or RedLib (wonder who made that second one).
-Xms2G -Xmx2G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=30 -XX:+UnlockExperimentalVMOptions
Milan, I have a config library you can use if you want
2G could be too low
yeah ill do 3gb or 4
Go for 4 I'd say
Hahaha, I know, I'm already using RedLib in this exact plugin, but for GUIs, guess I'll be using it for configs too, lol.
Oh well that works out perfectly lol
Anyone knows how would I go about removing the 1/2 players sleeping message when going to sleep?
That's from a plugin
no the new versions
Not sure then
Read carefully
Because a lot of people misunderstand how the target function works
I will, thanks!
Maybe you need a profiler
That kind of issue usually suggests something is going on with gc but that might not be the case
what is a profiler and how to get one
A profiler gets a breakdown of what's using the most CPU time
VisualVM is a good free one
Use Spigot
I need nms
Spigot has nms
what type of event should I listen for tree growth, basically i am making an evil plugin
y'all must know the annoying oak tree (the tall one thats hard to cut down)
I m makin a plugin that will make every single oak tree into an annoying one
(when the world renders, its not like its gonna loop through all trees and turn them, it will just change when one is gonna spawn)
I think that would be StructureGrowEvent
Craftbukkit is gone
It does
installing it
Use spigot, not spigot-api
spigot has nms, spigot-api does not have nms
But also why are you using nms
I am using Jar file
to use multiple versions
FUUUUUU
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
Get ready for pain
A lot of nms-only stuff on 1.8 can be replicated through API on 1.18
Considering that you are either using JDT or IJ's cursed build system it shouldn't be too hard to adapt unless you went extra cursed
If you have that disable attach mechanism JVM flag, remove it - otherwise yes
whats that
Prevents remote debugging
is that jvm flag in mc
Well it can be applied for any JVM instance, but in this case it would be mc yes
If you are unsure whether you have it, just run mc and check
-Xms4G -Xmx4G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=30 -XX:+UnlockExperimentalVMOptions
these are my mc jvm args
Should work then
ClickEvent.Action.RUN_COMMAND not work anymore on 1.19.2?
Using adventure?
Show code
Because if you use adventure-plattform-bukkit you might need to update it to the latest version. The reason for this is that the client refuses to run the command because the command is not signed
"not working" tells us nothing
The client refuses to run it
Oh that's weird
I am 100% sure that that is the issue because a lot of plugins broke with that exact issue with the 1.19.2 update
Why didn't spigot just make it sign the command
Not strange at all - that is all the fallout of the chat verification feature
I don't really understand the point of it over just encrypting the entire connection
Oh right, moderation
So how does that work?
Spigot was probably updated to do that, though on older builds it might not do it
When you run the command, is it still using the one that was signed by the server?
Poke around in the sampler
Figure out what's causing the freezes
ah yes
throw me on an app ive never used before
and i have to magically figure out whats causing the freezes
well ill try to eitherway
thanks for the recommendation
I mean, at this point you're gonna know as much as I do
You just have to look through the call hierarchy and see if anything seems to be using an unreasonable amount of cpu time
How can I make my 1.16.5 plugin compatible with every version from 1.13 to 1.18+
How can i give a item to a specified player when it quits, for example, i click on a player with a stick and when this player quits i get back a grassblock
I would create a hashmap with a SimpleEntry inside (Containing the sender of the action and the desired block) and as another hashmap value I would put who suffered the action. At quit, thanks to a listener, you control the hashmap and if it contains the X (PlayerUUID) key, it gets the sender of the action and gives them the block.
Something like that: java HashMap<UUID, AbstractMap.SimpleEntry<UUID, String>>
I wish Java had a standard library pair type
Though nowadays I guess you could just public record Pair<K, V>(K first, V second) {}
I really don't know how to use that
sooo, if you can give me a better example idk
these are the methods that took a shit ton of cpu time and the cpu time increased dramatically whenever the freeze (every second or two) happened:
in thread io worker 7:
- org.lwjgl.system.JNI.invokePP[native] () 152,514 ms (100%) 152,514 ms (100%)
in rendering thread:
-
com.mojang.blaze3d.systems.RenderSystem.limitDisplayFPS () 159,371 ms (40.4%) 159,371 ms (40.4%)
-
org.lwjgl.system.JNI.invokePPV[native] () 241,926 ms (50.1%) 241,926 ms (50.1%)
@waxen plinth
idk wtf they do though
What happens if you let the game render as many frames as it wishes? (i.e. you disable the FPS limiter)
idk
but i have my fps maximum set to unlimited
hm, interesting
I'm intrigued
invokePP hehehehehehe pp
Oh god
how can I make my.... secret plugin... compatible with every version 1.13+ (it is 1.16 rn)
no words with others!!
sshh
what the hell is going on ...
shh! keep your voice down!
how can I?
either 5 or a troll
I aint going to respond to that
That is defo a bait, not idea how, but either way you played your cards wrong there
give me answers or Ill have to kidnap u
sshhh
Especially because I am quite sure that you don't know that I like doing things the wrong way.
But they still can connect?
yes they cant connect
@ancient plank just giving ya a heads up before this inevitably spirals
Okay okay I'll show you how to do it: Use sun.misc.Unsafe to set CraftMagicNumbers.instance to your own UnsafeValues impl and use that authority to remap your plugins at runtime
I understand more here than from a search on the internet
Is a 1.16 plugin compatible with 1.17?
it's compiled in java 16
If you use a mish-mash between https://github.com/Geolykt/EnchantmentsPlus/tree/4xx/src/main/java/de/geolykt/enchantments_plus/compatibility/hackloader and https://github.com/FabricMC/tiny-remapper - yes
Idc if you're joking or not, but don't joke about this thx
^
lmao
What I gave you is far too much already
One cannot learn the dark magic of Mass ASM without experiencing much pain
I find it hard even to understand the names of the classes
ahha
if you run your server on java 16 i think so
thank you. Geol you’re fired
i dont know if its possible to run a 1.13 server on java 16 though
man
and any later versions (1.19 requires java 17 i think) wont work
There were days where all minecraft modders were Wizards capable of mastering that dark magic, but after they built a bright future with their crafts, others flocked in. They were incapable of mastering the dark arts, but still they existed for they stood on the shoulders of giants. The Wizards meanwhile retreated to the darkest corners of the modding communities, rarely to be seen on discord - for their den was (and still is) IRC
this is so impossible
It is quite possible through mass ASM
wdym
how did you get ASM access on bukkit
Just lower the version flag, and transform anything that would be invalid
what r u talking about
As I said - there are loopholes
And bukkit only allows you to transform raw byte arrays, so you can use your own ASM version
ah yes of course MethodHandles.Lookup has a method to define a class
bruh what the hell bruh
It should be noted that this only works to transform plugin classes and only works on 1.13+ (I.e the versions where commodore is used)
Actually, could be that it is used earlier than that. Whatever - it isn't too old
how do i remove soap from my power cord
it stopped the power in the house once
if i plug my charger in again it might do it again
plug it in, it will dry out once it stops burning
I have 4 random locations
but some of them are outside WorldBorder so I tried doing this:
while(!border.isInside(randomUL)){
randomUL.add(randomUL.subtract(center).toVector());
}
but it always goes to -Infinity -Infinity -Infinity and crashes my server
dad just turned the house power on and off
bruh
this is a serious development question
Turn the power off, then rinse it with water
After that plug the device in an UPS because you have no power in the mains
the ones that disconnect into 2
no the house power works fine
Hello guys, how can I make a city build plugin? I want to create one my own
dad said something but he just turned the switch on and off
and its fine
the laptop charger thing has soap in it
You should turn it off though, there is a high chance of an electric shock
Soap is conductive
yeah its not connected rn
I fit was just water, and the cable, hang it out to dry. If it was the brick you can;t dry it out without openign it or placing it in the airing cupboard for a week
if i connect it it'll probably turn power off
what i did was i took a napkin
and a bent fork
and half a drop of water
... or use rice
Tf is an airing cupboard
i dont want my parents to know i put soap in my fucking charger 💀
here in teh UK, they are the warm cupboard you keep your linnens in. It has teh boiler in it too, which provides the heat
older houses mostly
elgarL, can I ask you something?
You can always ask
ingenius
wait im searching for the link
bump it down
what do you think of my first and last public plugin? https://www.spigotmc.org/resources/identity.104776/
theres the sourcecode on the top
Yeah, not even bothering to look. It is about Gender
this has soap in it
while loops are taking whole main thread for itself right
guys how do i unsoap this
I mean, what do you think of the code
im your fan so...
Wat
I would appreciate every advice
I love you, im sorry
Yep
pom looks fine
lmao, thank you
Name two plugins he is known for
yes
is anyone here a professional soap remover from charging cables
Then you are absolutely not his fan
I am
I have a certificate of best fan ever
idk if this is satire or fr
idk too
edgar
eggarl
are you sure the water method is gonnawork
If it's your own resource, why don't you verify your account real quick
r u talking with me?
what would you do if this happened to you
Yes
how can I
?verify
?verify
Ah, only works in certain channels
?verify I am the developer
There's a channel for it
ouch
I've a lot of experience in repairing electrical/electronics, so I'd repair it properly. You can;t do that (safely)
I would honestly love a plugin that lets you specify pronouns in hover text over your name
no soap doersn;t evaporate
fuck
done, but... I want to change my name, this is ugly
I'd rather not tell you as opening the unit is a shock hazard
BRUH
it could kill you
Alright, link me a GitHub repo and I will happily review your code
im talking about my charger
Even if unplugged due to capacitors

