#help-development
1 messages · Page 1274 of 1
so its IJ's fault ?
well, does it build?
based on the zero information you have provided I could not tell you
I can't read your mind
yeah, now it does
hmmm
just use MobChipLite if you're gonna do pathfinding
or if you want pathfinding algorithms, pathetic
not algorithm but more like a simple api preferably.
in unity there was something called nav mesh agent and you just called a method and it walked
quite simple
then use MobChipLite
thats quite good.
many game engines will have the common ones that are known
like nav mesh, A* etc
which is nice however sometimes you might want something more custom or more refined and that becomes more difficult or when you want to combine more then one together
pathetic is a popular one
pathetic is just A* + heuristics though, not actually moving the entity
if any one could use it in combination of mobchiplite
I can hear the Seinfeld music
you're so right bb
does anyone have a function to determine all of the blocks a player is standing on top of
because if you're in the center of four blocks, you need to break all four for the player to fall
ehm the bounding box seems to be +- 0.3
are you making tnt run
I mean there's a player.getBoundingBox method isn't there
if you take that approach it'll be incredibly difficult to actually play
that's exactly what I'm doing
how the hell do I do tnt run LMAO
If not destroy all blocks supporting a player, how else then?
bump
oh for fucks sake
can someone explan this to me
private fun getBlocksUnderTo(location: Location): List<Location> {
val world = location.world ?: return emptyList()
// Player's X and Z coordinates
val x = location.x
val z = location.z
// Calculate the range of blocks the player is standing on
val minX = (x - 0.3).toInt()
val maxX = (x + 0.3).toInt()
val minZ = (z - 0.3).toInt()
val maxZ = (z + 0.3).toInt()
// Player's Y coordinate (block below the player)
val y = location.y.toInt() - 1
// Collect all blocks under the player
val blocks = mutableListOf<Location>()
for (blockX in minX..maxX) {
for (blockZ in minZ..maxZ) {
blocks.add(Location(world, blockX.toDouble(), y.toDouble(), blockZ.toDouble()))
}
}
blocks.add(Location(world, x, y.toDouble(), z))
return blocks.distinct()
}
how is it destroying literally every block besides the ones I want?
I mean that's not fair, it's two for four
is your location centered?
it should be player's location
so 0.5?
oh no its 0.0
well duh 0.0 is between blocks but why does it still break the left four lmao
toInt() is not appropriate
I am going to steal this method
it would seem, yes, it would floor
+0.4 and -0.4 point to different blocks, but toInt()ing both will give you 0
it strips the decimals
no rounding
-.7, -.3, +.3, +.7, all toInt() to 0
floor is exactly what you are looking for
oh yeah I'm not sure why I thought -0.3 would "floor" to -1
yeah so that should fix that
although I still don't understand how blocks two left of the player are being destroyed
but not any to the right
I suppose I'll make the change any maybe I'll see that is fixed\
it will, yes
one of your axes is a negative coordinate
so the toInting will do that
alright so I shall floor then toInt
see how the other is correct
okay so I have decided to make the method return all the qualified blocks, i.e. supporting and a game element
then I will add-
no that will not work
so I suppose a fatal flaw was using the move event for this at all
I kind of just need to tick all player locations...
if I use the move event then I must destroy all the supporting blocks, I can't just do a random one because if they stop moving they'll win the game
if I use a task then it'll do a random one until they fall
I'd do a task for this tbh
I figure polling around every 5 ticks is ample?
I'm generally a move event enjoyer, but for this I'd use a task
Is toInt some Kotlin magic for (int) casting
Yeah
yes
Smh (int) is literally less characters
but then you need to wrap in parenthesis :)
or it's ugly :(
the difference with kotlin is that it isn't a primitive
so when you "cast" to int you can still use methods on it
otherwise,
pretending the cast syntax was the same in Kotlin as in Java
(Int) x.something()
wouldn't work, yeah? Java compiler interprets that the same as (Int) (x.something()), I believe?
Right
so if primitives did exist in Kotlin, I suppose x as int is prettier than x.toInt() for sure.
honestly between (x as Int).someMethod() and x.toInt().someMethod() I'm not even sure which I prefer
as seems better but only because it isn't chain calling methods
lmfao its barely breaking anything now
I need to A and B with you guys, one second
https://streamable.com/kow66g does this seem off?
thats polling positions every 5 ticks and choosing a random block that's supporting them ^
oh and blocks are destroyed after 10 ticks
that noise is incredibly annoying
i know
i didn't want to go through the hassle of disabling it for this testing while I'm struggling to even destroy a few blocks
and why not just use PlayerMoveEvent instead of polling position?
aye karamba we just switched to polling becuase move event is not going to work for this
ehm basically if the player stands still then they wont fall, unless I destroy all the supportin blocks
but if I destroy all the supporting blocks then I'm doing potentially 4 blocks at a time in tnt run
basically, it needs to get rid of too many blocks to make them fall
we need to punish standing still, but not that excessively
If you don’t move for 3 seconds you get banned
that's a good solution
Hi guys! I'm having an issue with custom mob names. Setting the name of an existing mob through the entity.setCustomName() method along with entity.setCustomNameVisible(true) does not update the name on the screen. Do I need to send a packet to all the clients who can see it? Thanks!
show your code
if its not a packet based entity you shouldn't need to send a packet
I'm not sure how much of this you want to see. it's just entity.setCustomName(customName)
hang on I'll show the whole thing
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.
nothing happens
No all your code
it might not seem relevant but it depends on how you spawn the entity
that's not in the same class
I mean, you're setting the name only if it contains "Level:1" which it might not
my assumption is that it isn't passing that if statement and thus not updating
it updates the file where the mob's info is stored
I am not sure how that relates to this piece of code honestly
even after a server restart the name does not update
other than that, it's unreliable to check for contains, you'd want to parse the name instead if it contains some kind of placeholder like a level
I can prove it's passing by logging the new name in console
well, if you are sure it is indeed passing that if statement then the issue would be somewhere else in your code entirely, but do make sure it passes
just adding a print inside the if statement should do
I think the easiest thing to do at this point is to make a little demo plugin and see if it works without all the other code
that would definitely narrow things down, yeah
I'll do that in a bit, dinner's ready
reminds me I have to cook mine 😭
@potent atlas I didn't really take a look, but, if you're using MythicMobs with this entity it will not work
I just say this because I've spent what felt like an eternity attempting to modify the name of a mythical mob for specific players and
oh my god how much of a headache that was. never got it to work either
Then nevermind haha
alright it works as expected with a demo plugin. I'll have to try to find the problem in the full one
solved \o/
you guys were right it was the 'contains' method which has now been replaced to check the file for the name. much more reliable. thanks ❤️
Did you not put a println in the if statement?
obviously I did not. I overlooked it
it's broken again though
not showing up again?
it changes in the file but not in game -.- I'm going to put a lot of prints everywhere 😛
are you by chance using /reload?
no
I stop the server, change out the jars, start it back up
fixed it (again)
I'll make a backup...
Is there a way to start a sound at a time interval? e.g. starting music.nether.basalt_deltas at 30 seconds in ?
30 seconds in... to what?
after the point of some code being run? If so then you just use a scheduler
Starting the sound halfway through, skipping the first half of the sound
you cant
Ok thx
Be fun if you could, then you could appropriately time sounds to play any song
Rick roll here we come
That's what I"m saying
my setPlayerDataTag method
@SuppressWarnings("unchecked")
public static void setPlayerDataTag(OfflinePlayer player, String tag, Object value) {
NBTFile nbt = loadPlayerDataFile(player);
if (nbt == null) return;
if (value instanceof String str) {
nbt.setString(tag, str);
} else if (value instanceof Integer i) {
nbt.setInteger(tag, i);
} else if (value instanceof Double d) {
nbt.setDouble(tag, d);
} else if (value instanceof Long l) {
nbt.setLong(tag, l);
} else if (value instanceof List<?> list && !list.isEmpty()) {
if (list.get(0) instanceof Double) {
List<Double> doubleList = (List<Double>) list;
NBTList<Double> nbtList = nbt.getDoubleList(tag);
nbtList.clear();
nbtList.addAll(doubleList);
}
} else if (value instanceof NBTCompoundList clist) {
NBTCompoundList nbtList = nbt.getCompoundList(tag);
nbtList.clear();
nbtList.addAll(clist);
Bukkit.getLogger().info("[DEBUG] Wrote NBTCompoundList with size " + clist.size() + " to tag '" + tag + "'");
}
try {
nbt.save();
Bukkit.getLogger().info("[DEBUG] Successfully saved NBT file for " + player.getName());
} catch (IOException e) {
plugin.getLogger().severe("Failed to save player data for player: " + player.getName());
plugin.getLogger().warning("Error message: " + e.getMessage());
plugin.getLogger().warning("Stacktrace:");
for (StackTraceElement element : e.getStackTrace()) {
plugin.getLogger().warning(element.toString());
}
}
}```
```java
public static void setEnderChestItems(OfflinePlayer target, ItemStack[] items) {
NBTCompoundList newEnderItems = new NBTCompoundList();
int count = 0; // debug
for (int i = 0; i < items.length; i++) {
ItemStack item = items[i];
if (item != null && !item.getType().isAir()) {
NBTCompound nbtItem = NBTItem.convertItemtoNBT(item);
nbtItem.setByte("Slot", (byte) i);
newEnderItems.addCompound(nbtItem);
count++; // debug
}
}
setPlayerDataTag(target, "EnderItems", newEnderItems);
}
How do I create a new NBTCompoundList, so I can add my ItemStack to it and pass it to my setPlayerDataTag() method?
?paste oh boi, wall of code
its not that big
oh boy we're back to this
NBTCompoundList newEnderItems = new NBTCompoundList();
this line shows 'NBTCompoundList(de.tr7zw.changeme.nbtapi.NBTCompound, java.lang.String, de.tr7zw.changeme.nbtapi.NBTType, java.lang.Object)' has protected access in 'de.tr7zw.changeme.nbtapi.NBTCompoundList'
click into NBTCompoundList and see if it has any way of creating an instance
What version btw
2.15.0
no help
oh wait nbtapi
I thought this was NMS
well that's not what I meant
where do i click
public class NBTCompoundList extends NBTList<ReadWriteNBT> implements ReadWriteNBTCompoundList {
protected NBTCompoundList(NBTCompound owner, String name, NBTType type, Object list) {
super(owner, name, type, list);
}
public NBTListCompound addCompound() {
return (NBTListCompound)this.addCompound((NBTCompound)null);
}
public NBTCompound addCompound(NBTCompound comp) {
if (this.getParent().isReadOnly()) {
throw new NbtApiException("Tried setting data in read only mode!");
} else {
try {
Object compound = ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz().newInstance();
if (MinecraftVersion.getVersion().getVersionId() >= MinecraftVersion.MC1_14_R1.getVersionId()) {
ReflectionMethod.LIST_ADD.run(this.listObject, new Object[]{this.size(), compound});
} else {
ReflectionMethod.LEGACY_LIST_ADD.run(this.listObject, new Object[]{compound});
}
this.getParent().saveCompound();
NBTListCompound listcomp = new NBTListCompound(this, compound);
if (comp != null) {
listcomp.mergeCompound(comp);
}
return listcomp;
} catch (Exception var4) {
Exception ex = var4;
throw new NbtApiException(ex);
}
}
}
public ReadWriteNBT addCompound(ReadableNBT comp) {
return comp instanceof NBTCompound ? this.addCompound((NBTCompound)comp) : null;
}
/** @deprecated */
@Deprecated
public boolean add(ReadWriteNBT empty) {
return this.addCompound((ReadableNBT)empty) != null;
}
public void add(int index, ReadWriteNBT element) {
if (element != null) {
throw new NbtApiException("You need to pass null! ListCompounds from other lists won't work.");
} else if (this.getParent().isReadOnly()) {
throw new NbtApiException("Tried setting data in read only mode!");
} else {
try {
Object compound = ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz().newInstance();
if (MinecraftVersion.getVersion().getVersionId() >= MinecraftVersion.MC1_14_R1.getVersionId()) {
ReflectionMethod.LIST_ADD.run(this.listObject, new Object[]{index, compound});
} else {
ReflectionMethod.LEGACY_LIST_ADD.run(this.listObject, new Object[]{compound});
}
super.getParent().saveCompound();
} catch (Exception var4) {
Exception ex = var4;
throw new NbtApiException(ex);
}
}
}
public NBTListCompound get(int index) {
try {
Object compound = ReflectionMethod.LIST_GET_COMPOUND.run(this.listObject, new Object[]{index});
return new NBTListCompound(this, compound);
} catch (Exception var3) {
Exception ex = var3;
throw new NbtApiException(ex);
}
}
public NBTListCompound set(int index, ReadWriteNBT element) {
throw new NbtApiException("This method doesn't work in the ListCompound context.");
}
protected Object asTag(ReadWriteNBT object) {
return null;
}
}```
look
no way to create instance
Can you not
?
wall of code
i mean it aint that big
I have to scroll, it's big
ok sorry
And I opened it on github anyways
From the wiki, I don't think you're using the API correctly lol
wdym
Do this NBTFile nbt = loadPlayerDataFile(player);
Use the nbt to get the EnderItems and modify that compound instead of whatever the flip you're doing
I think
I dunno, I never used this lol
wait ill text you on the car, i need to fix this lol
Please don't text and drive (?)
yeah wtf
Explains it
Fahian rn
Aaa
I'm at work >:(
Thankfully working form home haha
How do I get the hight of a block?
bump
try giveExpLevels()
height?
I just want to inc it by a tiny bit
?jd-s
declaration: package: org.bukkit.entity, interface: Player
like a chest is not as high as a normal block or a slab e.g.
"Gives the player the amount of experience levels specified. Levels can be taken by specifying a negative amount. "
you wanna increase the progress
yes
maybe this can help: #help-development message
i think there isnt a direct method for that, but you gotta do math for it
bruh
is there some git code for it?
cba to do math right now
public void addExpProgress(Player player, float amount) {
float currentProgress = player.getExp(); // value between 0.0 and 1.0
int currentLevel = player.getLevel();
float newProgress = currentProgress + amount;
while (newProgress >= 1.0f) {
newProgress -= 1.0f;
currentLevel++;
}
player.setLevel(currentLevel);
player.setExp(newProgress);
}```
Asked gpt, gave me this idk use it at your discretion. It's gpt after all
gpt is lowkey smart
why do you use ai... think a little
with ai you are basically doing nothing and learning nothing
if you know what it's doing then it's fine
i just told him its ai and gave him a warning
no need to get mad over the tiniest mentions of ai
after modifying what do i do, how will i save the changes
your honest reaction:
"ionknow"
I said I don't know the API
gj
now it needs to be live-sync, and also make sure its also synced for all the other inventory "viewers"
I use AI myself to give help at times, but only because I know what I am doing and when it is appropriate. Most of the times it isn't
icl I too do use it, admittedly more than what I should, Ig being able to boost productivity isn't all that bad- tho I suspect there to be consequences in long term with this workflow choice
personal use is more than fine, it helps one to be able to center in whatever you're trying to solve when it works well and avoids getting out of the flow, and newer models are only getting better and better at doing even niche things like bukkit plugins
I personally draw the line when it comes to support though, as it is nearly the same thing as spoonfeeding a solution, except it is even worse as it just demonstrates my own laziness of actually going through code and understanding the user's problem. It's already bad for a person learning to just give out code and hence why people recommend doing so sparingly, however AI makes it so easy to just spew stuff that it almost feels like it would be fine, but it ultimately isn't
Reason people discourage AI for people learning something isn't so much that it can get things wrong. That's part of the problem but not the main pain point with this approach, which is the fact that someone learning doesn't know the right questions to ask, and thus they're unlikely to actually be able to be productive with these tools
didn't meant to go in a rant but welp, here I am lol
is giving items in PlayerJoinEvent recommended or is there a better event that executes after that? I noticed that without any delays in the event I cannot 100% guarantee that a player gets the item.
think about it for a second
that is weird, the player entity should already be spawned by the time the join event is called so you should be able to just give the item without any delays
In the PlayerJoinEvent the player should be expected to be fully loaded on the server.
Adding items to his inventory should be working consistently.
if a plugin synchronizes inventories, it'll apply its changes on top of yours causing it to override your changes or the other way around
I agree with this 100%
Personal use is perfectly valid if you just need to make a script, or want to bootstrap some code.
Don't spoon-feed people, with or without AI, it's not helpful to them.
universal opinion: teach a man to fish

teach a man to fish, and he'll be fed for the rest of his life.
give a man a poisoned fish, and he'll be fed for the rest of his life.
true
ok then, weird though
tell a man to fuck off and he'll never bother you again type shit
fr
teach man cook good? Not good, die starve. Teach man fish? Not starve. Cook and fish starve not
sadly not true in many cases
fuck off
no u
Is there a way to ban someone permanently without setting the DURATION to a whole bunch of days? with player.ban()
Got it! thank you!
I needed a way of running a command and getting its output. I created class implementing ConsoleCommandSender and overrided sendMessage with saving it to a variable and returning when my method is called. When i run /tps it returns what i expect it to return - string with output, but when i run for example /list or /op <...> it returns nothing. Why?
What command(s) are you trying to capture the result of and why
implementing the interface is not something that's really supported. list and op are vanilla commands while tps is not
very specific question
does anyone know how to apply tint to a custom model which is made using the 1.21.4+ rsp system
specifically
the item is horse armor
bukkit commands accept any implementation of CommandSender, they only use the methods on that interface, but any vanilla command will attempt to unwrap it and call methods on the underlying player/commandblock/etc instead
the method worked for 1.21.3 and older but is not working anymore
for doing this there is the rcon system but i don't remember if that returns command feedback, iirc it does
old (works)
@Override
public void setHorseLeatherArmorColor(Color color) {
LeatherArmorMeta leatherArmorMeta = (LeatherArmorMeta) leatherHorseArmor.getItemMeta();
leatherArmorMeta.setColor(color);
leatherHorseArmor.setItemMeta(leatherArmorMeta);
nmsLeatherHorseArmor = CraftItemStack.asNMSCopy(leatherHorseArmor);
itemDisplay.setItemStack(nmsLeatherHorseArmor);
}
new (doesn't work)
@Override
public void setHorseLeatherArmorColor(Color color) {
LeatherArmorMeta leatherArmorMeta = (LeatherArmorMeta) leatherHorseArmor.getItemMeta();
leatherArmorMeta.setColor(color);
leatherHorseArmor.setItemMeta(leatherArmorMeta);
nmsLeatherHorseArmor = CraftItemStack.asNMSCopy(leatherHorseArmor);
itemDisplay.setItemStack(nmsLeatherHorseArmor);
}
I don't know why I posted both, it's the same code, I'm falling asleep here
the difference is in how they initialize is all
one of them initializes with setItemModel and the other with setCustomModelData
what is the name of this thing that shows up above command?
tab complete
Those are completion hints.
Not something that’s currently available in the API.
You’d have to use Brigadier directly.
onTabComplete gets most of that
im getting this error with this code:
Code:
CraftPlayer craftplayer = (CraftPlayer) sender;
Error:
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.dispatchCommand(CraftServer.java:847) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at org.bukkit.craftbukkit.v1_19_R2.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:50) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:?]
at net.minecraft.commands.CommandDispatcher.performCommand(CommandDispatcher.java:306) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.commands.CommandDispatcher.a(CommandDispatcher.java:290) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1957) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.network.PlayerConnection.lambda$18(PlayerConnection.java:1919) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.util.thread.IAsyncTaskHandler.b(SourceFile:67) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:156) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(SourceFile:23) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1154) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:1) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.util.thread.IAsyncTaskHandler.x(SourceFile:130) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.MinecraftServer.bh(MinecraftServer.java:1133) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1126) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.util.thread.IAsyncTaskHandler.bq(SourceFile:115) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.MinecraftServer.i_(MinecraftServer.java:1109) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1021) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:301) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at java.lang.Thread.run(Thread.java:1623) ~[?:?]
Caused by: java.lang.NoSuchMethodError: 'net.minecraft.server.level.ServerPlayer org.bukkit.craftbukkit.v1_19_R2.entity.CraftPlayer.getHandle()'
at org.example.nmsplugin.commands.Create.onCommand(Create.java:39) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
... 23 more
>java -jar spigot-1.19.3.jar```
before the same exact code with the same exact versions used to work but now its not working, Note that this plugin uses nms
?xy
the cast isn't what is causing the stack trace but the call to getHandle
how can it be fixed
what are you using this for to begin with
should i send you the whole function code
so you're creating NPCs
I would recommend using a library/plugin like TAB for that, honestly
way easier to manage as you don't have to handle the multiple version problem
idk bro previously compiled jar is working find in the server but now i created a new project with everything the same but doesnt work
so like you have any you could recomend
it seems to support layout but its developer API wiki doesn't seem to include it, I wonder if they just don't have public API for it or forgot to document it lol
okay thx
okay they do have API for it, just forgot to mention it in their wiki: https://github.com/NEZNAMY/TAB/blob/master/api/src/main/java/me/neznamy/tab/api/tablist/layout/LayoutManager.java
thanks
for more information on what layouts feature is, check their user wiki: https://github.com/NEZNAMY/TAB/wiki/Feature-guide:-Layout
okay
anyone know of a good offline speech to text library for java? i tried CMU sphinx4 and it just completely missed the mark, rarely understanding what i was saying
whatever Minecraft uses
minecraft has speech to text?
there aren't many java specific ones but you can just use a C/python one and FFI your way through it
or just do the speech recognition part in python and pass the text to your java process via IPC or whatever
I assume this isn't for a plugin since you're depending on speech recognition, so the world is your oyster basically
whisper sweet nothings to the server for a performance boost
oh i misread that
I wonder if there are any free-ish API for the multi-modal models, they do pretty well at speech recognition but I assume it can get expensive fast
speech to text, not text to speech </3
nah yeah its for a client mod
i wonder what minecraft does use for TTS tho
ive used FreeTTS but its pretty old
i always thought they hooked into some kind of Windows narration service for some reason lol
There’s plenty of stuff for tts, stt is a different story though
I think they use something very basic
I imagine they just forked something open source
Although I think it’s based on SAPI
Hey I'm making some custom items for a server with my friends.. The way I'm doing that is by having "private void" and sticking them all in there. It's getting a little cluttered. Is there a better way to do this?
I would love to have my own little private void, infinite trash bag :D
?paste Please elaborate, send a snipplet of code or something
your custom items are simple enough to be just loaded from some config file
And this is silly
You should have just made a registerItem method that takes CustomItem, then get the item ID (I assume) and put it in the map
Less repeating yourself, no possibility of you messing up the ID
oh yeah that makes a lot more sense
ah why didn't I think of that
well thank you man
much appreciated
Is there no way of getting what world the players changed to from the PlayerChangedWorldEvent?
like making sure that the player has to be in the end?
there's only the from() method
Try getting the players current world in that event ?
Maybe it fires after the player already changed world
oh I thought this gets called before the world change actually registers
hmm lemme try
It does, changed is past tense
Ye makes sense :D
I’m writing a Bukkit/Spigot plugin that opens a custom Inventory as a GUI for players. In this GUI I have two special slots defined in GuiUtils:
PAPER_SLOT – players may insert paper here
COIN_SLOT – players may remove coins here
I want to completely lock COIN_SLOT so no item can ever be placed into it—no cursor-drag, no shift-click, no double-click, nothing—just like the result slot of a crafting table. that cannot place an item 100%
My current attempt cancels clicks and drags on that slot, but a clever player can still shift-click a stack into it, immediately shift it back out on the next tick, or drag to the cursor and back. ?
assignedPlayer.playSound(assignedPlayer, Sound.BLOCK_NOTE_BLOCK_BELL, 0.9F, 0.5F);
PotionMayham.instance.getLogger().info("Mayham sound 1 || countdown: " + wrapper.countdown);
break;
case 40, 10:
assignedPlayer.playSound(assignedPlayer, Sound.BLOCK_NOTE_BLOCK_BELL, 0.9F, 0.2F);
PotionMayham.instance.getLogger().info("Mayham sound 2 || countdown: " + wrapper.countdown);
break;
case 0:
assignedPlayer.playSound(assignedPlayer, Sound.BLOCK_NOTE_BLOCK_BELL, 0.1F, 0.5F);
task.cancel();
break;```
who do all of these sound the same even they they have different pitches?
pitches? pitch? pitch-i?
i think it would just be "pitch"
It's hard to cover every scenario and you gotta manually check for it
Even with NMS I had to edit a lot of the inventory code to register clicks and whatever
im pretty sure you can't completely disable interactions with the items, you can just cancel the events and thats the best you can do
yeah they just need to cancel the right events
how many version remmaped by mojang can buildtools generate?
any list can refer to?
Even NMS can’t do that?
you can but it needs some effort
you can also do it without NMS but it's a lot more annoying
I should write a bukkit version of my nms funkery tbf
i see and i need some suggestion about double click item on player inventory the item in the gui that is the same item will merge to inventory? How can i prevent it?
print out the click type etc and figure it out
PICKUP_ALL -> getCursor -> look in the opposite inventory sumn like that
Ah okay i will try
write an abstraction at some point
so you can do a lil
menu.getSlot(13) // or whatever
.setRestrictions(SlotRestrictions.accepts(item -> item.getType() == Material.COOKIE));
I still need to redo a bunch of NMS logic to also accept cookie items even if the slot has a display item or whatever
thinking something like
public interface MinecraftSlot {
ItemStack getItem();
boolean accepts(ItemStack item);
void consume(ItemStack item);
}
is there a way to stop all entities targeting a player to stop after they have targeted them?
but how do I get all mobs tageting my player currently?
loop through them, check the target
how do I get a list to loop through? 😿
do I really have to loop through all entites in a world?
yeah
wow
wow
amazing stuff
I mean you can optimize that by only looping entities in nearby chunks
An entity 5000 blocks away probably isn’t targeting them
like 1.16 onwards or something
i think thats when they started giving us official Mojang mappings
or maybe it was 1.17
The chances of being killed by a mob 312.5 chunks away are low, but never zero...
Yeah 1.17
1.14 is when they started releasing mappings
But the license was too restrictive until 1.17
Just get nearby entities
paper and maybe spigot too also has the EntityTargetEvent which fires whenever any entity targets another entity
We have that
how can i tell if a Player leveled up from PlayerExpChangeEvent?
i thought i could just do if Player#getExp() + PlayerExpChangeEvent#getAmount > expNeededToLevel but it looks like getExp is a 0..1 percentage
nor do i actually know of an API method to get exp required to level up
oh theres a PlayerLevelChangeEvent instead
that makes life a lot easier
@undone sphinx https://builtbybit.com/threads/how-do-i-completely-lock-a-custom-gui-slot-in-bukkit-like-a-crafting-result.730608/
I’m writing a Bukkit/Spigot plugin that opens a custom Inventory as a GUI for players. In this GUI I have two special slots defined in GuiUtils:
PAPER_SLOT – players may insert paper here
COIN_SLOT – players may remove coins here
I want to completely lock COIN_SLOT so no item can ever be...
buddy this u?
Yeah it’s me lol
too late. everything is probed and looped
or shall i say looped and probed? :sus:
How can I get a list without deserializing the elements in it on FileConfiguration
(without extra libraries)
hopes and dreams
buffer underflow
ConfigurationSection::getValues iirc returns a Map<String,Object> where child sections are nested maps, but i don't remember if that will give you the deserialized ConfigurationSerializable's or their serial map-object representations
sure but OP is talking about a list
a list has nothing but the values in the list
I guess the only use would be to count the amount of things in it
in which case you'd just save an extra variable that is just the amount of items
Ik its not like Intelija dc server but i cant get help from it :I So i wanna make plugins on 1.16.5 and i installed Java 16 but when im trying to select it, it like dosent work i can only choose 21
it will also return lists for yaml lists yes
i'm just not sure whether what's in the list is going to be in serial form or deserialized; but if there's anything in the config api that would return the serial repr, it'd be getValues
it's all eagerly deserialized as far as i'm aware
When i get a itemstack list from a config, Bukkit automatically deserialize it
So instead of getting a Map<String, Object> I get a CraftItemStack
whats the issue with that though
Normally deserialization is a good thing, but if the itemstack amount is not specified on the file or if it is specified as 1, the order of the returned list does not equal the order of the list in the file.
that doesn't sound right
I can pass this issue with extra library
But i don't wanna add whole library for one issue
the order of elements in a list isn't affected by the properties of the elements themselves
it's for almost certain that you're doing a boob somewhere
let's see the config yaml and the code you are using to access it
Hi, I'm having trouble with getting sweet berry growth in an event. I want sweet berry bushes to to die and turn into a dead bush if it fails a random chance check upon trying to grow.
Does anyone know what event sweet berry bushes use when growing?
I tried BlockGrowEvent, StructureGrowEvent, and BlockSpreadEvent
None of those trigger for sweet berry bushes for some reason
Yeah it seems to work for all other plants
I'm not sure why it's not working
Ok nvm I see
It uses block growth event, BUT this event never triggers if you used bonemeal on the sweet berry bush
Ahh ok thank you
it shows nullable on 1.21.5, but not on 1.21.1, it also shows on older versions
did they change anything ?
another day, another reason to hate kyori
😦
in inventory click event, when on air (empty space) is clicked, it says air for me, but when you click outside, it's null
at least that's what i remmember
What does that have to do with getItemMeta
(this broke in kyori 4.20 -> 4.21)
will not
?? lol
“I have an issue with this tool”
Have you tried doing anything to actually solve it?
“No”
that's too hard
Too hard to open a website these days
you're nbt is probably invalid
is there a way to boost a player's elytra flight speed to more than default?
this is why we use bungee chat Components 
What is the absolute fastest way for me to test my spigot plugin?
Anyone here have a test server?
Spinning up one isn't that hard
..... it's just... time consuming.
it would take 5 minutes or less to set it up
you kinda need a server if youre gonna make plugins lol
You have to figure out where to download it... then run it... make a jar runner... install worldedit... install MY thing... accept the EULA...
spigotmc.org -> download jar -> java -jar file -> eula.txt -> eula=true -> java -jar file.jar
yeah that takes 3 minutes bro
that takes 24 seconds
Missed a run BuildTools step in there but close enough
then intsall paper
Paper, yeah.
And that's how you end up not getting support here
ikik
If you're using Paper you should head over to the Paper discord
i dont need support tho
its not that much of a process as you only really need to do it all once
True...
hotswapping assuming you are not using reflection and the sorts
I love hotswapping so much. Plugman is the best.
too bad windows requires you to stop your server every time you want to swap a jar file.
that isn't hotswapping
How do you define hotswapping?
not by using whatever plugin you are talking about
Java allows hotswapping class files and thus no need to stop the server to change out plugins or update them
this is the fastest way to test plugins
go away
and remove your message as it will be removed anyways
@worldly ingot
Yeah it's not that kinda server
other channels too
#general #help-server
Dude, okay, fuck Mod View
That's twice now it's just not shown all a user's messages
plugman does some reflection-ish things to help unload plugins and reload them without having to reload the entire server.
Hot swapping... sounds like you could load a jar while server is running which is great... you still have to swap the file though, right? I know it works on linux, but windows gives me a lot of nagging.
someone knows
MockBukkit
I use the run server plugin
you literally swap the code in the servers memory
That’s a testing framework not a hotswapper
indeed however it doesn't work sometimes if you are using reflection
cant u hotswap in the IDE tho for it
or is it literally just like
the JUnit of spigot
It’s meant for writing JUnit test cases
a
If you want hot swap, I currently use the run-task gradle plugin
you can also just use the remote debug feature in intellij
you dont need the gradle plugin to hotswap or even use the debugger
can even connect to a production server
No, as in editing the code and then clicking a button will hotswap it for you
You don’t have to drag and drop it
which is what im saying
I use jetbrains runtime jdk for hot swapping
what do I need to import for this to work in 1.21.4?```java
EntityHuman nmsPlayer = ((CraftPlayer) player).getHandle();
?nms
I have the mappings
follow its steps
I already did...
so you ran buildtools with --remapped for 1.21.4 and added the stuff to your pom?
Vec3 imported
I need to do this:
Vec3 current = nmsPlayer.getMot();
EntityHuman isn't remapped
yes
whats the import for it?
version: 1.21.5, hash: 77f5bff929
use the mojang mapping https://mappings.dev/1.21.4/net/minecraft/world/entity/player/Player.html
?mappings
Compare different mappings with this website: https://mappings.dev/
Player
oh, so I dont use any craftbukkit names, I just use the mojang names since I have the mappings?
havent used them before
yeah
ok thanks
if I also need to use the spigot Player in the class, can I do something like this:
import net.minecraft.world.entity.player.*;
import org.bukkit.entity.Player;
////
net.minecraft.world.entity.player.Player nmsPlayer = //...
Player player = //...
```?
No
yeah
Oh yeah
Maybe
If you explocity define it
it compiles but I'm getting ClassNotFoundException: net.minecraft.world.entity.player.Player
https://paste.md-5.net/atuxesucat.coffeescript
make sure you added special source to your pom
And that you're actually using maven to compile your plugin
this is what I added to my pom, I'm not sure what special source is: https://paste.md-5.net/ulalimukex.xml
how do I check that?
it definitely seems like its using maven to compile it
how are you compiling
with the power of love and good will
I dont know how to check that
what are you doing to create your plugin jar
build -> build artifacts
that isnt maven
Artifacts kekw
thats the only way I know how lol
I've been doing that for 3 years and never thought to change it
Open the maven tab on the right and find package
should be under lifecycles iirc
^^
now inside target is your jar
^ target folder
there are 4 .jars, I want the one that doesnt have "remapped" or "original" in the name?
You want the shaded jar, which defaults to your artifact name-version.jar if not set
okay, how do I set it?
how do you set what?
the name of the .jar output file
it should be whatever the name of the project is in your pom either change it after and test with a different name or change project name
theres probably an easy way to do it with a plugin but i dont use maven so dk
okay thanks
u can always just rename it manually
<project ...>
...
<build>
<finalName>FinalNameOfJar</finalName>
</build>
...
</project>
No plugin necessary
is it posible to make it so hoes get more fortune, and the fortune enchantment stacks with the extra hoe fortune?
bro wants the extra fortunate hoe
Does fortune even work on hoes
yes but you usualy mine melons with an axe
Apparently it always has, but hoes couldn’t get fortune until 1.16
thats why people like me used to use fortune picaxes to farm crops
14w31a yeah
ur a bigger unc than him 😭 wdym
wdym? choco is like 3
https://paste.md-5.net/dofemigese.coffeescript
I am desperately trying to boost players' elytra flight speed to no avail. does anyone know why this might not be working? is it even possible to modify a gliding player's velocity?
o Dafuq. Expected him to be 30
I’m trying to increase the nms player’s deltaMovement and nothing is happening…
I spawned evokerfangs, but why can't I cast it to a Living entity?
when I sout the entity, I get CraftEvokerFangs (do I need NMS)
evoker fangs aren't living entities?
LivingEntity evokerFangs = (LivingEntity) world.spawn(enemy.getLocation(), EvokerFangs.class);
yeah
evoker fangs aren't living entities
that was meant to be more of like a statement rather than a question
you lied to me
that doesn't match the method signature that you had in the code snippet
a World#spawn(Location, Class) doesn't seem to exist
this would give a compiler error because evoker fangs don't extend living entity
oh nvm it does on RegionAccessor which World extends
O.o
btw I'm doing 1.21.4, so I'm using this docs https://javadoc.mcio.dev/spigot/1.21.4/org/bukkit/World.html#spawn(org.bukkit.Location,java.lang.Class,org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason,boolean,java.util.function.Consumer)
declaration: package: org.bukkit, interface: World
is it fine?
that's only if you need to modify anything about the entity before it gets spawned in
and it would give you a compiler error if you tried to summon an evoker fang with it
It's valid
Kyori messed something up
Since it worked for a long time
And in a certain kyori update it broke
It's snbt
cool so are you gonna do anything, like open an issue or a PR
I was wrong about the version it broke in
Will need to find it manually today
I despise the people behind kyori, is why
if you don't like it, don't use it
too bad
It's the support that's absolutely terrible
Heya, is there a way to translate materials based on the language of the player?
like their name?
ye
They are dicks
Is the reason
provides no reason
Are you banned in the Kyori discord as well or smth
my guess is that they're banned from all discords with proper moderation
u suck at ur job
thats the implication
from HIM not me
spigot barely has moderation
what would you change?
I feel like there are barely any raids, or belligerant people who manage to stick around
have actual clear rules and have moderators enforce those
have you seen an instance of this not happening lately?
an instance of what not happening
Well it has been like this in general
... rules not being enforced?
you asked what I'd change, I said I'd have actual clear rules and have those new clear rules be enforced
never said rules aren't being enforced
i agree
the rules are just the forum rules arent they?
Not sure what rules are not clear
the rules thread references like two other rules pages nobody reads
half of which don't apply (anymore)
Please read the rules: http://j.md-5.net/1ikUQuU
I thought the discord rules were just the irc rules lol
They are
i think those rules are enforced fine
I'm just curious which of the rules is not clear though lol
irc:
- 3.4
- 3.6
- 6.2
- 8.2
- 8.3
general:
- 4
- 6
- (11)
3.4 is not unclear, but can you color chat here?
it's just simply not possible on discord
discord doesnt have colored chat no
these are rules that don't apply here (anymore)
Ok but that does not make it unclear lol
it does have markdown
never said it was unclear?
then what are the rules that are unclear
You said here clear rules
Which implies there is rules that are not clear
kek
- they're buried in three different threads
- half of them don't apply (anymore)
- not all of them are enforced
doesn't mean that specific rule is unclear
How is that unclear?
nuh uh
Do you know what unclear means?
again, I never said anything about that
YOU JUST DID.
You're full of shit
you asked about my personal opinion and what I'd do to change the moderation
And you said make clear rules
I literally never said that rule is unclear
you heavily implied it
yeah lol
by saying the opposite is fals
I said that rule doesn't apply on discord
since discord doesn't have coloured chat
You just said these 3 are "unclear".
Something not being applicable doesn't make it unclear.
it makes it way harder to understand what the rules are and which actually apply
Alright so maybe you used wrong phrasing then since you can not point to a rule that is not clear and instead meant easily accessible rules
lol
All the rules are clear
rules would be uunclear if they lacked these subpoints.
I will agree that rules should be all on a single page and easy to read lol
i dont think every single rule needs to be expanded upon, and given such egregious detail. If you have active helpers (which this server does), then they are free to use discression.
I am of the fan of the totalitarian approach
Never said they need to be expanded upon. There should be a clear page with rules that apply on the discord which doesn't contain any completely unrelated things (like resource rules?) which are also properly enforced
doesnt help that when u google that word, the second image is moustache man
that is my opinion, you asked for it
Lmao
well thats not the definition of clear, which is what you used.
accessibility != clearness
Just have anarchy and give everyone admin
Lol
Everybody is equal
nah md_5 is our dictator now
that would be the opposite though :D
Or give me admin and I start a revolution and create Faucet
how would one fork, and compile a github MC plugin project (using intelij)
Depends on the project
But in general;
Fork -> Clone -> Open folder with IJ -> hope that it's a maven or gradle project -> wait for all dependencies to load
Then look for the Build or Package tasks in the gradle/maven sidebar on the right
git clone is the command
(had to log into my old github account)
considering i failed my github project in highschool and i havent used git for 3 years i cant remember how to 😭
ChatGPT rules might be funny
Or just boring
You can install github desktop to make it easier for you
thats a good step
But I recommend looking at a couple tutorials
Sure! Here’s a solid set of general Discord server rules you can use as a base. You can modify them to fit your community's specific needs:
Discord Server Rules
Be Respectful
Treat everyone with kindness and respect. No harassment, hate speech, racism, sexism, or discrimination of any kind.
No Spamming
Avoid spamming messages, emojis, links, or voice chat disruptions.
Keep Content Appropriate
This is a [family-friendly/mature] server. Follow the content guidelines appropriate for the age group. No NSFW, excessive profanity, or illegal content.
No Self-Promotion or Advertising
Don’t promote your own or others’ servers, content, or social media without permission from the staff.
Use Channels Properly
Post in the correct channels and follow any specific channel rules pinned at the top.
Respect Staff Decisions
If a moderator or admin makes a decision, respect it. You can appeal in a calm and respectful manner through the proper channels.
No Impersonation
Don’t pretend to be someone else, especially staff or public figures.
Protect Privacy
Do not share personal information—yours or others’—without consent.
Follow Discord’s Terms of Service
All members must comply with Discord's Terms of Service and Community Guidelines.
Have Fun and Be Cool
Enjoy your time here! Let’s keep the community welcoming and enjoyable for everyone.
Would you like me to customize these for a specific type of server (gaming, study group, art, etc.)?
4o
Tools
ChatGPT can make mistakes. Check important i
LGTM
ship it
omg should i find my old github project i was doing in highschool and try finish it?
If you want to
i cloned it and opend it, im asuming its the same build method to my projects?
this is what we have over at another server
It's a maven project so you can just hit the build button or you can use your console and type "mvn clean package" - praying that you don't need any local dependencies in your .m2 repo
this is too unclear for my liking
https://paste.md-5.net/rules.md these r what i wrote in one of my servers, theyre a bit Ehh but maybe an okay starting point
oh what
LOL
😭
nice rules
pressed build, didnt work
https://paste.md-5.net/sarayabube.md there we go lol
dependencies didnt get resolved
oh so i need to let them load?
why didnt you dm me, coulda done it for you
pff learning fuck that
can you try if "mvn clean package" from a terminal in that folder works?
these rules are for a server with very Me-only administration so thats why theres first-person writing in it
Requires you to have maven installed though. Otherwise you'll have to use the bundled one in intellij from the run configs
good idea, i forgot where terminal is
bottom left :D
u can do Clean and then Package in the Maven sidebar
Just click maven on the side? I doubt she's going to have maven
click maven on that sidebar
Well could be a reason to install it. But yeah you can use the bundled one, I just usually don't
i will never understand why intellij opens that sidebar SO huge.
when it spawns, it expands for the width of the content, even if not expanded. under respositories, there are a lot of long strings
maybe they expect you to increase your font size for all windows by 1000% and account for that
all Windows? what if im using linux...
xD
anyways, what do
Java
A group of penguins in the water is called a raft, while a group of penguins walking on land is called a waddle.
Would you call a group of linux distros, a "waddle"?
damn, I spent years learning to code. I could have just done Java. Where have you been a decade ago?
PHP
did it build?
distributions
god forbid, people have some humor, mr robot
no thanks :(
😭
i pressed build project again and nothing happened :?
maybe something did happen and i dont know
did u press THIS "build project"? #help-development message
bestie, when you expand "lifecycle" there is a button that says "build"
pressed again* after the maven part
i pressed it again and this came up
that's an error in your terminal
OHH THERES A BUILD BUTTOON
Unrelated to the button
thats the same error from before when they ran mvn in the console 😅
i was pressing
yeah I know
i pressed the build button with the hammer
damn don't destroy our favorite ide with a hammer. We are developers, not builders
.
im looking for pachage
if not package, then "install" works I think
Install runs package as well yes
install runs package as well. It additionally installs the project in your local maven repo so that other maven projects can find it via their pom.
build succsess, now how find .jar
target
target folder
lol
You want the one without a suffix
good news, it worked
bad news, its 22.4 again
or maybe they didnt bump the version, but have had commits since then
yeah they just never bumped the version in maven @crude zephyr
its atleast 50 commits new
chill
ik what u meant
it means they have made changes, a lot, but haven't physically changed the numerical version
This means you have the latest version if you just pulled the repo and ran package on the project.
^
just because it has the same version number, that is on Modrinth / Spigot, doesnt mean its the same code
sense
errors not coming up now
am happy
NOT HAPPY
NOT HAPPY
core protect not working
read ur console, chud
Go back to intelliJ, go into pom.xml
its a file
in core protect
Do you see:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.coreprotect</groupId>
<artifactId>CoreProtect</artifactId>
<version>22.4</version>
<properties>
<project.branch></project.branch>
insert "development" as the project branch
such that it will look like:
<project.branch>development</project.branch>
then redo the package thing
re-get the jar
^
this
yes maam
i forgor
works now thanks
fuck am now still getting erros
is spamming
very much spamming, any messages that get outputed get buryed
rip
omg thats not a good responce
delete the coreprotect stuff in your DB if you don't need it would be my guess
do they not do migrations?
DB im asuming is the config?
nope
the sqlite database in the configs somewhere
I'm developing a marker system in my mini game can you advise me on the best way to do it? My first attempt was when registering a marker to hash the center of the location and its locations on the radius through map to get it already in the task
no they do, just not from different branches
sorry i dont understand
in plugins/<whatever coreprotect folder is called> there will be a .sqlite or .db file
there should be some .sqlite file in the configs
yes
delete that
Delete it... if you dont care about losing CO stuff
otherwise you can manually add the table, but who knows if itll ask for more
yea
yes
i get this
shame, i liked knowing what every block had done to it
