#help-development
1 messages · Page 2100 of 1
..
How i stop the scoreboard flickiring
I want it to update without flicker
Any anwsers?
Oh I can do so much wonky shit with this https://www.graalvm.org/22.0/reference-manual/embed-languages/
I'm trying to get into plugin development and I've seen talk about maven for plugins, where should I start?
Time to make a legitimate JS api for spigot by accessing java classes in JS to make a friendlier JS based API for spigot plugins?
get the time it starts and time it ends
By actually registering the JS object as a spigot plugin within spigot itself because objects are on the JVM?
🤡 this may be a bad idea but it might be a good one
Alright real talk, how would you guys like an actual legitimate Javascript API for Spigot plugins
Like theoretically if it was possible would you support it or no?
And what if it stopped caring so much about compatibility because and keeping everything the same because its not plagued by people who can't update code and a dumbass license lawsuit for the past 10 years
i mean theoretically it’s possible
chattriggers did it for client side modding
although i’m not sure what purpose it would serve for spigot though and it might get pretty complicated
I've been looking into Graal and its Java interop is a bit interesting to me
You could theoretically get direct access to the bukkit instance and register a JS class instance as a plugin
So it wouldn't be an adapter API host that just runs stuff like a proxy. It would actually be a small library that adapts directly to java classes and makes wrappers to make it all look nice
How i stop the scoreboard flickiring
Creating unique string from two integers.
So, depending on what you are doing you don't actually want to use the vanilla scoreboards provided
You want to do packet magic, this is difficult for most people so I always refer them to this https://github.com/MrMicky-FR/FastBoard
It does not flicker and does not require convoluted teams and stuff like that
The spigot wiki has resources to get you started with maven but i recommend you go with Gradle instead, it's like maven but better
so i know "(serverMessages.en).getKeys(true) returns all children and sub childrens, but how could i filter what im looking for? in this case i have serverMessage.en. and i want all displays and messages
it would be something like get(serverMessages.en.ANYTHING.display ?
loop over servermessages.en.getKeys(false) and use the string param to get servermessages.en.string's display string
you can literally filter if by seeing if you find the key you need in the path but it probably isn't a good way of doing things
or even split by full stop and match the last element, which again would probably not be great
if you need to correlate the data in any way I'd make an object that parses and stores all of this data in an easy to access way
why isn't this replacing anything?
the string returned is just like the one i've entered
no changes
this is the whole enum
ignore that
i was just trying to find the problem
basically it works by getting a string, replacing all the values according to the enum and then sending to the player the colored one
like Hypixel if you know how do they do that
ah wait
String#replace is returning a new string object so you need to assign it
strings are immutable remember
so like this?
More or less
wdym?
That’ll work, it’s just that there are cleaner ways to write it.
and chatColor.getColors().toString() instead of creating new empty string which is dropped directly
uh.. could you teach me?
really? I thought it would just say like REDmymessage
isn't it an enum?
uhh i see
i mean ""+chatColors.getColor() -> chatColors.getColor().toString()
why can i serialize an empty inventories content but not while holding any item
empty inventories will just serialize to null i guess
empty ```txt
¬í ur ![Lorg.bukkit.inventory.ItemStack;–lr¤Ï xp )ppppppppppppppppppppppppppppppppppppppppp
with content
¬í ur ![Lorg.bukkit.inventory.ItemStack;–lr¤Ï xp ){sr java.io.NotSerializableException(Vx ç†5 xr java.io.ObjectStreamExceptiondÃäk9ûß xr java.io.IOExceptionl€sde%ð« xr java.lang.ExceptionÐý>;Ä xr java.lang.ThrowableÕÆ5'9w¸Ë L causet Ljava/lang/Throwable;L
detailMessaget Ljava/lang/String;[
stackTracet [Ljava/lang/StackTraceElement;L suppressedExceptionst Ljava/util/List;xpq ~ t 8org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStackur [Ljava.lang.StackTraceElement;F*<<ý"9 xp sr java.lang.StackTraceElementa Åš&6Ý… B formatI
lineNumberL classLoaderNameq ~ L declaringClassq ~ L fileNameq ~ L
methodNameq ~ L
moduleNameq ~ L
moduleVersionq ~ xp pt java.io.ObjectOutputStreamt ObjectOutputStream.javat writeObject0t java.baset 17.0.1sq ~
opq ~ q ~ t
writeArrayq ~ q ~ sq ~
£pq ~ q ~ q ~ q ~ q ~ sq ~
bpq ~ q ~ t writeObjectq ~ q ~ sq ~
.pt utils.Utilst
Utils.javat serializeToFileppsq ~
ÿÿÿþpt -jdk.internal.reflect.NativeMethodAccessorImplt NativeMethodAccessorImpl.javat invoke0q ~ q ~ sq ~
Mpq ~ q ~ t invokeq ~ q ~ sq ~
+pt 1jdk.internal.reflect.DelegatingMethodAccessorImplt !DelegatingMethodAccessorImpl.javaq ~ "q ~ q ~ sq ~
8pt java.lang.reflect.Methodt Method.javaq ~ "q ~ q ~ sq ~
*pt utils.SystemControl$Utilst SystemControl.javaq ~ ppsq ~
)pt #admin.commands.ViewInventoryCommandt ViewInventoryCommand.javat onPlayerQuitppsq ~
;pt main.maint main.javaq ~ /ppsq ~
ÿÿÿþpq ~ q ~ q ~ q ~ q ~ sq ~
Mpq ~ q ~ q ~ "q ~ q ~ sq ~
+pq ~ $q ~ %q ~ "q ~ q ~ sq ~
8pq ~ 'q ~ (q ~ "q ~ q ~ sq ~
2pt )org.bukkit.plugin.java.JavaPluginLoader$1t ...
and while holding an item?
It worked! ty @tardy delta
ah
i serialize the ItemStack[]
isnt it serialized?
wdym
ah its an exception
i saw those weird and i thought that was serialized stuff
it is
partially it serializedf
the itemstack array itself serialized
but its content failed to
partially serialized
partially error msg
any help maybe?
isnt there a packet for the skin?
I think that's player info
and I just found out what's wrong -_-
of course, the moment I send it
it's cause I remove the player info the same tick I think
its the same as Bukkit.getScheduler().runTaskLater(/* */, 1)
basically runs it once, after one tick
nope
@tardy delta okay i prob figured how, the ItemStack implements its own serialize() method which puts its own content into a map thats returned which i then can serialize to put it onto the harddrive
ah, the thing is happening now
having removed the player info, if the player moves out of render distance then the entity will no longer render back in
so it serializes a map?
ItemStack.serialize() returns a map
so i create an ArrayList that holds one map per item
and then serialize this ArrayList
public static void onPlayerQuit(Player p)
{
File invDir = new File(Utils.getOwnDir + "inv");
if (!invDir.exists()) invDir.mkdir();
ItemStack[] itemArray = p.getInventory().getContents();
ArrayList<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
for (ItemStack is : itemArray)
{
list.add(is.serialize());
}
Utils.serializeToFile(list, invDir.getPath() + '/' + p.getUniqueId().toString() + ".bin");
}
``` this is a yet untested prototype
ItemMeta probably wont get serialized automatically and you need to access it with reflection
If your item has an itemMeta
ill test that
itemstack implements ConfigurationSerializable
and the ConfigurationSerializable interface has a Map<String,Object> serialize() member
Look how it serializes itemmeta
You are better of converting to nms itemstack and storing the itemstack.gettype + " " + itemstack.getamount + " " CraftItemstack.getnmscopy.gettag or sum
cant remember
nbt
same
i did it by storing type, amount and nbt
in a single string
and splitting it
how are you trying to store it
in a VARCHAR[] if you are using a sql database
binary file
i use the ObjectInputStream which should cast it to a byte stream thats then written to the harddrive
Using serialize method in Itemstack wont work
and why not?
¬í sr java.util.ArrayListxÒ™Ça I sizexp w sr java.util.LinkedHashMap4ÀN\lÀû Z
accessOrderxr java.util.HashMap ÚÁÃ`Ñ F
loadFactorI thresholdxp?@ w t vsr java.lang.Integerâ ¤÷‡8 I valuexr java.lang.Number†¬•
”à‹ xp
Ÿt typet DIRTx x
``` tried to serialize a dirt block
at least it got the type and the number
using this
public static void onPlayerQuit(Player p)
{
File invDir = new File(Utils.getOwnDir + "inv");
if (!invDir.exists()) invDir.mkdir();
ItemStack[] itemArray = p.getInventory().getContents();
if (itemArray.length > 0)
{
ArrayList<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
int i = 0;
for (ItemStack is : itemArray)
{
if (is != null)
{
list.add(is.serialize());
}
else
{
Bukkit.getServer().getConsoleSender().sendMessage("empty slot " + Integer.toString(i));
}
i++;
}
Utils.serializeToFile(list, invDir.getPath() + '/' + p.getUniqueId().toString() + ".bin");
}
else
{
Bukkit.getServer().getConsoleSender().sendMessage("couldnt get inv");
}
}
Do the itemstacks have an itemmeta?
not yet
sure lemme try its done easily
ill just ench a sword sec
it threw an exception for the itemmeta
so
best shot = splitting type amount and meta in a wrapper class and serialize a wrapper class array?
hm?
cuz you dont need it for string
.
like use "__" or sum
something that nbt doesnt use
to split your string later
nbt uses _
so i used __
so how could i have default values? i want to have a lan: "en" and a few other values and i want to save them in cofig, i already tried with addDefault and this https://www.spigotmc.org/threads/loading-default-config.206088/#:~:text=brkpnt-,The easiest,-way is to
also i added the stuff i want in the config.yml and they still get overridden whenever i saveconfig
its not complex
the other way of doing it would be a list of values and paths, with a for loop i would check
if path != null : path = value
okay @cerulean mirage ive managed to cast the item type to string and create new itemstack with it then add it to the player like this
ItemStack[] itemArray = p.getInventory().getContents();
itemArray[0].getType().toString();
ItemStack test = new ItemStack(Material.valueOf(itemArray[0].getType().toString()), 1);
p.getInventory().addItem(test);
.options().saveDefaults()?
Hi, how to get how many bars that the consumed item filled?
didint quite work
or ii might have done something wrong
Why you adding it to the player inventory, dont you want to store it first?
as in food?
Yes.
its a test if i can create a new material type from string
so i can serialize the type as string
ow ok
then the itemmeta is serializeable
and primitives like ints are always serializable
so i can serialize the item using a wrapper class
How you send text here? So used to sending pictures
Like the way you did
Is there a maximum inventory size?
wym
yea
i’ve gotten up to like 99999 before it crashes anyone who opens it
When I create an inventory, I specify a size, what is the maximum?
54 i think
and u cant access all slots at a certain point anymore
./crashban be like xD
😂
why you serializing the itemmeta?
just put it in a string
and how do i then create an itemmeta from string later on?
MojangParser.parse
convert itemstack to nms, do setTag
then parse nbt into that
can anyone help me use nms on 1.18.2
MojangsonParser*
What part do you need help with
Idk how to use the specialsource plugin
Copy paste that in to your pom that's it
Specialsource removes the obfuscation right?
It maps methods and fields with the mappings provided by mojang. So yes it mostly removes the obfuscation
MojangsonParser is called TagParser with Mojmaps if you want to use them
i do install-remapped-file?
Its possible to create custom placeholders with arguments like:
%bungee_status_[server-name]%
on intellij how do i get 1.8?
hat?
I didnt understand your question
i mean i get only 1.12 if i go last version then change the version from pam.xml
this plugin for Intellij
you are trying to get the 1.8 spigot api?
yes
change the version tag in your pom
compiler says that or what?
1.8.8-R0.1-SNAPSHOT
teye
it works?
Hey guys, I'm trying to recreate the fixSkinHelmetLayerForPlayers function from this
press the reload button on the top right
ah thanks
This is my attempt
talking to me?
yeah
im eating checking in abit
just tried reloading and joining again, same thing
lemme look at my code
perhaps the byte data has changed from 1.16 to 1.18?
I think I translated the classes correctly...
why do i have access to my windows data when im on linux 🤔
🤔
I've done a lot of this packet stuff before when I was making a tab menu
but one thing I never got working was the extra layer
I dunno why it's so much more complicated that everything else
my maid dream npc
i should watch his video again
is working perfectly
but im too lazy
but is missing the bow and cat ears
cause the outside layer isn't showing
or at least on the head
then you just need this
yup ik
look at the screen shots I sent
that's exactly what I'm trying to replicate
I knew how to do the other stuff
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
there's my full class
the last bit of the display() function
the names are diffrent cause I'm using the mc nms mappings
i dont see EntityDataSerializer in my code
use this website here
it shows the link between the spigot mappings and nms mappings
Hi; who use intelij ?
I do
EntityData = DataWatcher for actual mc mappings
thats why people say nms is a pain
yup it is
I had to use it though cause otherwise all the functions were just a() b() etc and same for fields
I have "File is ready-online" and i can't do anithing
Do u know what i have to do ?
reading decompiled code?
yes
Yet it's my plugin, my code
what code are you looking at?
some api?
bruh why are people dming if they can send it here
I can"t send here
you could send a pastebin link or similar
spigot-jar for 1.8.8 doesnt work but for 1.18 yeah
What do you think?
any luck?
Can you send send me the equivalent code you used for fixing the outside layer even if it's not the same mappings?
nothing
ok so one thing which is kinda weird
now I'm not gonna pretend like i know exactly how this stuff works however
the registry is set to 16, but it looks as if 17 is the value which lets the skin layers be changed??
But why doesnt work?
what are we talkin about?
How do I stop the player from placing down a block
cancel blockplaceevent
@EventHandler
public void onPlace(BlockPlaceEvent e) {
Player p = e.getPlayer();
if(p.getInventory().getItemInOffHand().getItemMeta() == null || p.getInventory().getItemInOffHand() == null) return;
if(p.getInventory().getItemInMainHand().getItemMeta() == null || p.getInventory().getItemInMainHand() == null) return;
if(p.getInventory().getItemInMainHand().getItemMeta().getPersistentDataContainer().has(Constants.FACT_BOOK, PersistentDataType.STRING) || p.getInventory().getItemInOffHand().getItemMeta().getPersistentDataContainer().has(Constants.FACT_BOOK, PersistentDataType.STRING))
e.setCancelled(true);
if(p.getInventory().getItemInMainHand().getItemMeta().getEnchantLevel(Enchantment.BINDING_CURSE) == 252 || p.getInventory().getItemInOffHand().getItemMeta().getEnchantLevel(Enchantment.BINDING_CURSE) == 252)
e.setCancelled(true);
}
}
this doesnt work
when i hold the item in my off hand
THIS WORKEEDDD
Bugs: 1. When holding the item in my off hand, when placing a block on my main hand it will cancel the place event
2. You can place the block using your off hand
ty
How do I make a custom crafting recipe and an additional crafting recipe that when you put the custom item in the crafting recipe it gives you back your items you used to craft it. Btw this is a plugin im working on already and have tried many ways to get this to work but for some reason nothing happen i don't even get an error ill send the code of it as well.
package me.chr1s.weedz.items;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.entity.Item;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.RecipeChoice;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.ArrayList;
import java.util.List;
import static me.chr1s.weedz.items.Bud.bud;
public class Ounce {
public static ItemStack ounce;
public static void init(JavaPlugin plugin) {
createOunce(plugin);
}
private static void createOunce(JavaPlugin plugin) {
ItemStack item = new ItemStack(Material.WHEAT);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(ChatColor.translateAlternateColorCodes('&',"&aOunce"));
List<String> lore = new ArrayList<>();
lore.add(ChatColor.translateAlternateColorCodes('&',"&7A Ounce of Weed."));
meta.setLore(lore);
item.setItemMeta(meta);
ounce = item;
NamespacedKey key = new NamespacedKey(plugin, "ounce");
ShapedRecipe recipe = new ShapedRecipe(key, item);
recipe.shape(
"BBB",
"BBB",
"BBB");
recipe.setIngredient('B', new RecipeChoice.ExactChoice(Bud.bud));
Bukkit.addRecipe(recipe);
ItemStack item2 = new ItemStack(Material.WHEAT, 9);
ItemMeta meta2 = item2.getItemMeta();
meta2.setDisplayName(ChatColor.translateAlternateColorCodes('&',"&aOunce"));
List<String> lore2 = new ArrayList<>();
lore2.add(ChatColor.translateAlternateColorCodes('&',"&7A Ounce of Weed."));
meta2.setLore(lore2);
item2.setItemMeta(meta);
ounce = item;
NamespacedKey key2 = new NamespacedKey(plugin, "ounce1");
ShapedRecipe recipe2 = new ShapedRecipe(key2, item2);
recipe2.shape(
" ",
" E ",
" ");
recipe2.setIngredient('E', new RecipeChoice.ExactChoice(Pound.pound));
Bukkit.addRecipe(recipe2);
}
}
construtors exist for a reason
is there any way to detect for when a player opens its tablist?
in a way yes a custom recipe for a custom item
ShapedRecipe feedboks = new ShapedRecipe(Constants.FEED_BOX, items.FoodBox());
feedboks.shape("CSC","CNC","CSC");
feedboks.setIngredient('C', Material.COOKED_BEEF);
feedboks.setIngredient('S', Material.SHULKER_SHELL);
feedboks.setIngredient('N', Material.NETHER_STAR);
Bukkit.addRecipe(feedboks);
this is how i did it
so you create an item FoodBox in another file and heres the item...
@Deprecated
public ItemStack FoodBox() {
ItemStack foodbox = new ItemStack(SkullCreator.itemWithBase64(SkullCreator.createSkull(), (key);
return foodbox;
}
i just removed the lore and custom name
and it works
you can create a new file called "Items" where you have custom items
and when you want to get an item you do "Items item = new Items()" and item.MyItem()
ok thank you but i guess i worded it wrong i know how to make a custom recipe but i can't get it to do what i'd like it do which is when you put the item you just crafted back in the crafting table it gives the items back and the items used to craft it is just a single material
oh
ye sorry if i wasn't specific
use shapeless recipe for the "ounce of weed" to get weed
anyone?
i've tried doing it with a shapeless recipe and it never worked even before I added the second rcipe
recipe*
There isn't F
whats Pound.pound?
Pound is the class and pound is the item
thats the problem i think
bc of the same name?
you need something like this
it has "return (nameOfItemStack)"
hm let me try that rq
Does anyone know a scoreboard plugin that i can set to only show in certain worlds
Yes
ok thanks
Thx
np
what means CSC. CNC, CSC¡
Do you have any others
Okay
their placeholders
Its just the letters I use for the recipe
you see
C is cooked beef
S is shulker shell
N is nether star
you cant it has to be a character
quick question
hm didn't seem to work
does the ArrayList get(); start from 0 or from 1?
i think 0
okayy
Yea, from 0.
can u send error?
ye 0
and ye gimme a second
Error occurred while enabling Weedz v0.0.0 (Is it up to date?)
java.lang.IllegalStateException: Duplicate recipe ignored with ID weedz:ounce
at net.minecraft.world.item.crafting.CraftingManager.addRecipe(CraftingManager.java:92) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3432-Spigot-699290c-cc5ddd7]
at org.bukkit.craftbukkit.v1_18_R1.inventory.CraftShapedRecipe.addToCraftingManager(CraftShapedRecipe.java:59) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3432-Spigot-699290c-cc5ddd7]
at org.bukkit.craftbukkit.v1_18_R1.CraftServer.addRecipe(CraftServer.java:1273) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3432-Spigot-699290c-cc5ddd7]
at org.bukkit.Bukkit.addRecipe(Bukkit.java:852) ~[spigot-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at me.chr1s.weedz.items.Ounce.createOunce(Ounce.java:46) ~[?:?]
at me.chr1s.weedz.items.Ounce.init(Ounce.java:22) ~[?:?]
at me.chr1s.weedz.Weedz.onEnable(Weedz.java:20) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at com.volmit.bile.BileUtils.load(BileUtils.java:128) ~[?:?]
at com.volmit.bile.BileUtils.reload(BileUtils.java:75) ~[?:?]
at com.volmit.bile.BileTools.onTick(BileTools.java:548) ~[?:?]
at com.volmit.bile.BileTools$2.run(BileTools.java:324) ~[?:?]
at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftTask.run(CraftTask.java:82) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3432-Spigot-699290c-cc5ddd7]
at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:415) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3432-Spigot-699290c-cc5ddd7]
at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1255) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3432-Spigot-699290c-cc5ddd7]
at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:428) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3432-Spigot-699290c-cc5ddd7]
at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1206) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3432-Spigot-699290c-cc5ddd7]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1034) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3432-Spigot-699290c-cc5ddd7]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3432-Spigot-699290c-cc5ddd7]
at java.lang.Thread.run(Thread.java:833) [?:?]
Don't register your recipe twice
Can you execute a command, and get its output as text? (Would a custom command sender be required?)
Yeah a custom sender would probably work
alright
But why do you need the message?
do you mind if i make a thread for this?
I just have a server I want to put in as little maintenance as possible, as it needs to be highly available, so I just want to run version checks on other plugins, and if they have an update, collect them, download, and restart (I have a set of plugins I need to be constantly up to date)
Does anyone have an example of retrieving data with MongoDB? I can't figure it out :(
you can create it, more people will notice the problem
send your code and error
I had to use mongo there
check MongoHandler.java
I need to go sleep rn maybe someone will help
Which part? The wiki covers what you need https://www.mongodb.com/blog/post/getting-started-with-mongodb-and-java-part-i
ok thank you for your help tho!
Here:
DBObject query = new BasicDBObject("_id", p.getUniqueId().toString());
DBCursor cursor = mongoCollection.find(query);
Java always starts at index 0 (any method)
For future references
Guide was outdated. Try this https://www.mongodb.com/developer/quickstart/java-setup-crud-operations/
Anyone have an alternative to SWM that works with 1.18 and has a larger world limit/can store worlds in database chunked?
?paste
Which are the items flags?
When trying to teleport to a world I'm getting this error, any idea why?
https://paste.ofcode.org/tHer77cZFfzDpYm87EuPP4
Thanks so much, I was looking at an outdated guide this whole time xd
Send your MiniGames onCommand method
In a paste
To save location objects with gson would I make a custom gson serilizer and deserilizer?
no
hey, im trying to block chest opening in creative mode, but still not working, any suggestions ?
Location#serialize
Location.deserialize
https://paste.ofcode.org/34uhbux6TRy324LtDDGsrJb
I used to goTo command
Which line is 261
The 'return true' line at the goTo command
wot
Yeah this is really weird
Would gson automatically call those methods or would I have to tell it to?
Oh, its the p.teleport(loc); line
It should detect it, I will check for both the location and the world
Well you don't return if it's null
So
It just sends null to the sender and then carries on
Ah, the world returned null
I ended up 'creating the world' and then it finds the world
And this makes it work for some reason
When I do this
Bukkit.getPluginManager().disablePlugin(Bukkit.getPluginManager().getPlugin("WorldEdit"));
the WorldEdit commands are not unloaded. How can I change this?
you would have to
How can I make it JSON?
Document uuid = mongoCollection.find(new Document("_id", p.getUniqueId().toString())).first();
String uuids = uuid.toJson();
JSONObject json = (JSONObject) JSON.parse(uuids);
p.sendMessage(json.get(1).toString());
does anything know how to make a second crafting recipe for the same itemstack item?
Use simplejson tojson method?
JSONObject uuids = uuid.toJson();
IDK what lib that is, but spigot comes built in with GSON, you can just serialize that list of uuids/document/string to json
so basically 2 recipes for one item?
Thanks!
the best way to put it in words is i have a itemstack item that i can craft with 9 of the same item i want to be able to put the crafted item in the crafting table and get the items back
the items used to craft it are also an itemstack item
Is it ok to have like 3-5 event classes for different things? Like one for general stuff, one for enchants and one for crates
Ok
typically you want to keep classes relatively short and not have them handle a million different things at once
Makes it a lot easier to handle your project down the line & easier to find fixes for something
ye the general principle you could consider here would be single responsibility, "a class must only change for one major reason"
Not sure about that, normally you would just have recipes for one item to get back (IE gold blocks giving gold ingots)
You could
ye thats what i want to do
set a PDT to the item on what material was used to craft them
then when its put into the result slot set the material to the one you have stored in PDT
IE if you use wood to make gold blocks
set a PDT of the type of wood you used, then when its put into the crafting slots, use that item as the result slot
cant do this with the crafting recipe api though
youll have to handle with either
the prepare crafting event, or inventory click event
thanks and do you think it'd be easier to do if i made a custom crafting table like as a gui?
You can do this with just the vanilla crafting inventory/crafting table
yes but im unfamiliar with PDT so im not sure where to even start
?pdc
:3
i think i need to get more coffee
thank you
only just woke up an hour ago

thats nic
i didnt make the PR LMAO

ngl I wasnt expecting a fix so fast
just realized i afk'd on my test server all night
im still a little confused but im kinda getting it so basically i'll store my itemstack item with PDC and whenever i put the item i want the recipes items back for i change the return item to the item i want?
Yep!
store the material used to craft it as a string, or you could make your own custom PDC for Material
thats still really confusing but at least im moving forward lmao
if i store it as a string is there anything that could interfere with it
can you explain by interefering
like if i put the original item that isn't an itemstacked item does it have a change to still give the items im wanting?
i mean every item is an ItemStack
BUT
if its a block type
and you place it
pdc is lost
ok thank you
will a plugin treat the directory it is in as the root directory?
iirc without the getDataFolder parent file it treats it like your in root yes
i could be wrong though
is there any reason not to use the built in file reader /writer objects?
under the hood spigot just writed to files using java InputStreams/OutputStreams (for yaml)
I don't know if spigot has any that would be better
else im just going to use javas
your fine using spigots, its just using javas code under the hood
The most common writer u want to use is probably BufferedReader/Writer
buffered writer ever?
which when working with file io are instantiatable through Files using Path objects
mye
well just make sure u're not double buffering
This is bukkits code for writing with saveResource()
Not sure where the yaml file writers are but i can probably find
anybody now how to remove the mongodb connection warnings from console?
it just uses Yaml from snakeyaml and invokes dump respectively load
what type of warnings are you getting?
too lazy to find that in snakeyamls code base 
🥲
like when I connect a thread to my database it just warns me that someone connected, cause I have a change stream up
looks like mongo hooks into ur logger system
yeah
so how can I remove it
is this a fix?
import org.slf4j.LoggerFactory;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
...
static Logger root = (Logger) LoggerFactory
.getLogger(Logger.ROOT_LOGGER_NAME);
static {
root.setLevel(Level.INFO);
}
i got that a lot too
had to change something with the logger settings like what you did
mye
what I just pasted?
i think i had to provide the mongo name somewhere
well idk if spigot uses logback
but it'd be sth like that, altho that looks like itd disable all warnings
could you check for me? these connection logs are so spammy and annoying, hard to actually know what im doing
yeah I just wanna disable mongo warnings
yea one sec
Thanks
Is it possible to save a list of lists in the config?
thanks!
Thanks i'll test it out! 😄
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryInteractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
public class Compass implements Listener {
@EventHandler
public void onPlayerInteract(InventoryInteractEvent event){
Player player = (Player) event.getWhoClicked();
if (player.getItemInHand().getType() != Material.COMPASS) {
PlayerInventory inventory = (PlayerInventory) Bukkit.createInventory(null, 9*3, "§d§lErze");
player.openInventory(inventory);
}
}
}
how can i make cliable items
thats what i got so far
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
i already saw that but it does not explain how to open a gui by clicking on a compass
like i need an funktion that makes so I can click on a compass and a gui is openning
listener
it doesnt work for me
im talking about mongodb disabling their logger warnings
oh
@EventHandler
public void onJoin(PlayerJoinEvent event){
Player player = event.getPlayer();
event.setJoinMessage("§7§lWelcome§r " + player.getName());
player.playSound(player.getLocation(), ENTITY_PLAYER_LEVELUP, 500.0f, 1.0f);
player.getInventory().setItem(1,ItemManager.createItem(Material.SLIME_BALL, 1, 0, "§cSpieler verstecken"));
player.getInventory().setItem(4,ItemManager.createItem(Material.CLOCK, 1, 0, "§cNavigator"));
player.getInventory().setItem(7,ItemManager.createItem(Material.ENDER_CHEST, 1, 0, "§cExtras"));
}
}
```why am i getting errors at ItemManager
Cannot resolve symbole ItemManager
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
it's pretty clear what the problem is
public void openInventory(final HumanEntity ent) {
ent.openInventory(inv);
}
public class NAME implements Listener {
@EventHandler
public void onPlayerUse(PlayerInteractEvent event) {
Player p = event.getPlayer();
if (event.getAction().equals(Action.RIGHT_CLICK_AIR) || event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
if (p.getInventory().getItemInMainHand().equals(Matieral.COMPASS)) {
ent.openInventory(inv);
}
That should work haven't tested it thought
it works with the article that person sent you
I will try it thank you
also its prolly hella messed up with indents bc i typed it in discord but you can just fix em up a bit
np
that won't work
also please use variable names that are helpful rather than just a single letter
p.getInventory().getItemInMainHand().equals(Matieral.COMPASS)
getItemInMainHand() returns an ItemStack
you also shouldn't use equals() for this type of comparison
ye its prolly hella wrong sorry i grabbed it from some old code
that gives me allot of errors
yeahhh don't use that
just google it like "how to run a command when you click and item spigot" or something like that to find some similar and piece it together
helps you learn more than ppl just giving you the code
don't just copy code without understanding it
^
thank you
Inventory API requires a living entity, which implies we can open inventories to mobs
make sure you read the code slowly and try to understand why it works
Now someone make an AI for the mob to click items in an inventory
just make an AI of a zombie beating minecraft entirely XD
i wanna do something like that one day
that'd be impressive
Use a markov chain that when players do something on a server, the entity will learn from it and play the server accordingly
i beileve theres a method literally called setMaxStackSize iirc
thats possible
wether they work correctly or not, dunno
use essentials /i command
I don't see that method
/i dpick
gives you a stack of 64 diamond picks
however the actual functionality is broken and you cant really use it, or take one and palce the stack in your inventory
yep that too lmao
i wish MC supported stacks like these ngl
hey burchard im still messing with the PDC just wanna know if this looks right for the saving its value
public class Bud {
public static ItemStack bud;
public static void init(JavaPlugin plugin) {
createBud(plugin);
}
private static void createBud(JavaPlugin plugin) {
ItemStack item = new ItemStack(Material.FERN, 1);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(ChatColor.translateAlternateColorCodes('&',"&2Bud"));
List<String> lore = new ArrayList<>();
lore.add(ChatColor.translateAlternateColorCodes('&',"&7Freshly Harvested Bud."));
meta.setLore(lore);
item.setItemMeta(meta);
bud = item;
NamespacedKey Key = new NamespacedKey(plugin, "bud");
meta.getPersistentDataContainer().set(Key, PersistentDataType.DOUBLE, Math.PI);
item.setItemMeta(meta);
}
}
^ i havent really touched pdc in so long though
i made a wrapper around the api so i havent touched it in a long time
yeah im actually fix that rn ive been putting if off
lol
yep definatly really usefull
most shit in bukkit i havent touched in so long because i use my own API
the other day i tried to use the normal extends BukkitCommand api and lord
took me like 20 mins to relearn it lmfao
redo the inventory and command apis'a re the main ones
current inventory api is aids to handle
https://github.com/Burchard36/BurchAPI/tree/main/src/main/java/com/burchard36/inventory
I used mine as a functional interface style, allows super simple creation of inventories and handling click events
I fixed it, I had multiple slf4, plus you only need api, not simple pac
when im retrieving the value does it come before or after the itemstack method? because if its after how would I put the value for the itemstack output?
command api is done in a very similar way, in fact i even made a step by step guide on how to do this on spigot
well
I'm currently making use of a change stream using mongodb, plus im about to make a chat core with essential commands all custom
the code u wrote up there is a bit ugh... weird
why are so many ppl making drug plugins lately lmao
usually you get the item meta, then you get the pdc from the item meta, then change the pdc, then set the item meta back
XD ive been making mine for probably almost a year but i just got back into it since i got a lotta free time now
indeed and theyre both optional, so if you only want console executors you only need to call onConsoleSender
i need to add tab completion to it
theres been 6 different people in here this week making drug plugins lmao
yep and the code ive seen from them is....
okay i cant shit talk anyones code cause sometimes mine is rather questionable
but the code ive seen is rather questionable lmao
i meeeaaaan
50% of the time im drunk or high when coding, but hey it works
havent smoked in months though
💀
youd be surprised
how many spigot devs actually drink/smoke
alex has a bottle of jaeger on the daily it seems
i need to stream when i code my dogshit plugin(s)
only issue is
i dont wanna answer peoples coding questions
cause when i talk about this shit irl i make no sense when i try to talk about it
like i can type what i want in text just fine
but when i try to speak it i literally sound like a sped dude
drunk texting perhaps?
im like the exact opposite tbh
i havent drank this month
im turning 21 in almost 2 weeks
oh
so im holding off on everything
btw in PDC the container is the recipe box right?
wym?
if(container.has(key1, PersistentDataType.DOUBLE)) {
}
just tried it is
like thats checking the crafting table and whats in it?
what is container
the result slots pdc?
idk thats what im asking you XD
im trying to go off the post you sent me
im trying to mess with it and test it to understand it better
wait
well thats how you check if a key exists so that part is right yes
code blocks or github
wait so container is the saved itemMeta?
container is the ItemMeta#getPersistantDataContainer() return value (it should be at least)
I know a dude that the more complex the problem is, the more he drinks to fix it
I honestly hate when I'm not sober
I think your talking about @tender shard right
i honestly cant wait until im old enough to buy my own beer and crack a few while ripping some code out
made a client-side hologram menu system with hitbox detection
grow some facial hair and you don't need to be old enough
oh dayum
i mean guys at the liquor store already let me buy it
but its a different feeling when i can go anywhere and buy it
or order it to my house
I know an indian dude buying beer at 15
man can buy beer but they asked for his ID when he wanted a red bull 💀
i once got asked to show my ID when buying cough syrup one time
lmao wtf
sometimes you get asked for one when buying nail polish remover too
acetone
that dude's a brazilian youtuber 💀
he got popular doing those hot knife videos
OHH
and tasting MRes from the entire world
that dude
he's the crazyrussianhacker of brazil
I should just make a spigot youtube series
ive been wanting to do that
"hey welcome to my programming series where we use colorful language against static abuse"
but I have a horrible accent and a very monotone voice
but i feel like i wouldn't be good at explaining things
my voice aint too bad
sec
https://www.youtube.com/watch?v=31MycSZZGko heres one of my vids
mic quality is meh in it though
sounds like im some shy sheltered 20 year old
okay your voice is not monotone
sounds pretty good id just suggest using something like kripst for back ground noise other than thats its not bad
and get a decent mic
whats that mean
I picked mine up for like 80 bucks
my headset mic is actually decent but that video wasnt make with it
emotion
headset mic kinda poopy
sure it does the job
crisp aint a bad thing tbh
when i talk in vc it aint too bad actually
"aint too bad" isn't "god tier"
ye its good just it has a limit on the free version

coding tutorial with autotune when
if its a coding tutorial i dont need a god tier mic
true
just something that gets your point accross in a fun way
if you can hear the laptop fans and the track pad being scratched
then you know it's good
💀
in discord calls you cant hear it haha
my laptop fans are super quiet too
so its pretty amazing you hear that
through a 40$ headset too
¯_(ツ)_/¯
my water pump starts making a funny rattling noise which shakes through my very thin walls
mic surprisingly doesn't catch it
i need to re-setup my desktop
i just need a better cpu for it
everything else is good
I think my gpu is kinda garbage compared to the rest of my system
my laptop has a 2060, and dekstop has a rx580 iirc
yeah laptop only has 16gigs
a water-cooled 5600x
doing development on it is aids
just because
lmao my laptop has 12gb and it works f i n e
well i need to run
1 intellij tab
30 chrome tabs
3 mc servers
2-6 clients depending on how fast i want to test multiversion support
you guys can run chrome?
ehh don't worry we've all been there
me bc i hate waiting for jars to upload rmeotely
i do have a 64gb ram dual cpu server in my house though
my first like 3 years of spigot were on a laptop with a 4th gen i3 and 4gb ram on a hdd
oml you poor thing
then I took some commissions and built a pc
and I had no monitor so I had to use a book on my lap to hold the mouse and keyboard
and code on my 720p tv
i think morice just humbled me XD
i need to wait another month to get paid for ae work, then im doing some hard upgrades
6 gb ram and a gt 630
rip wood pc
instead of upgrading my rig imma get those fancy nanoleaf lights because rgb = fps right?
just gotta finish this commission so I can afford more than like 2 lights 💀
you can just download more ram
i cant stand commission work
people always change shit when i have a whole system setup
and theyre addition normally means rewriting my entire system i have written
they just provide you with a document
lmao
preston and socksfor1 have always been fine for me
maybe you just had a bad experience
oh your on senior team arent you
nop
uhmm
socks has a private team
ahh
preston has media companies
youtubers do pay bank though
depends
they typically over pay for most things
ehh
what'd you do for brokeskies?
I was a dev on his server GalacticPrison
and i had to rewrite songoda's skyblock to basically be a prison thing
oh damn
nope hes a fortnite dude now
not sure about server work, I mostly just do individual videos
they're extremely technical but all the technical stuff never appears to the audience
me when i see the slightest oddity on a youtube video: "I could of made that plugin so much better"
lmao
I made a plugin where you could literally eat any block
to do that, I only had to rewrite half the server
because everything was a retextured golden apple 💀
yea i remember that one vid you sent eating bedrock
was kinda of bullshit (in a good way)
you should release it as a public plugin
nah I got paid good money for it
I can resell it but uploading it is kinda ehhh
it's also not that good on an actual server, just decent for a video
bro I had to write a second project to write the .json files automatically from the game's assets
thank god you didnt do that by hand
but whatever I had fun doing it
now I'm messing with pathfinders to make satanic mobs
override zombie ai, set entity speed to 10
that's way too easy
cows with spinning pentagrams that fly up and down and shoot fireballs at nearby entities just like a blaze
that actually sounds kinda fun to make
ight thanks bro
it's all nms
I only use spigot listeners to inject the nms pathfinder when chunks load
fun thing I discovered
all entities have a target, even passive mobs
fire breathing zombie that can attack you with the guardians ray thing i can't rm the name of and then have it crawl underground and move around you
you can add a pathfinder and passive mobs now have a target that you can grab and make them attack
too easy
too easy? damn lmfao
does anyone know what WorldType.VERSION_1_1 is in spigot 1.8.8?
i mean if you want a challenge i can give you some better ideas
I'm not looking for challenges
if I want a challenge I can just start optimizing all my client-side block code to work with chunk packets
that gave me a headache just reading it
or make reverb by sending packets quicker than 20tps
reverb?
yeah like a sound engine
oh ok thats what i thought i wasn't srue tho
listen to a sound packet, do some async processing and resent more packets
make intellij on minecraft
is that even possible?
i was just finna ask how you'd even do that
no ik but i mean like how someone would even go about doing it
also if you type a / in the chat
all characters written after that will send an individual packet
(for command completion)
kinda reminds me of that old captain sparkles video with the verizon phone
modding minecraft is totally different from plugin developing
that is possible but quite technical tbh
a bit
but I mean from a certain pov not so
you could run a server, do some image processing and conversion and render it in-game
oh true wasn't thinking of it as a mod
yes of course
the audio part isn't really that possible
its modding making them do things not implemented into the game
commands are just what execute what code you have
executing mods make it a mod
ehh
executing commands to do bukkit things is a plugin
you can always abuse the minecraft protocol
so modding is easy if you learn how
instead of banning cheaters why don't we just crash their client 🤔
Good idea
use reflection and you can register client sided commands as a mod
just mostly using an abstraction as opposed to nms itself
but they cant implement fire breathing zombies 🤣
but modding also requires server sided stuff if you plan to have multiplayer support to the server
they can
I mean they can
spigot is event based
you can pretty much do anything in plugins
yeah but it would considerably take a large amount of code
besides registering GUI,s keybinds and other things
not even events
just nms pathfinders
if you're doing custom mobs, pathfinders are the way
you can use the offhand-key as a hotkey for plugins
and that's about it
sth like paper does offer a goal api so no need to use nms pathfinders for trivial stuff
oh one is for deciding the target
and one is for deciding where to walk
and so they run independently from each other
bruh
mye its a bit dodo altho Ig it has its advantages
only thing I don't like is how if you return true for the a() method, no more pathfinders will run
so I just call the e() method and return false
:)
a
public abstract boolean canUse();
/**
* @return whether the goal should continue executing
*/
public boolean canContinueToUse() {
return this.canUse();
}
public boolean isInterruptable() {
return true;
}
/**
* Called when the goal is about to start executing
*/
public void start() {
}
/**
* Called when the goal stops executing, usually to reset the mob's state.
*/
public void stop() {
}
public boolean requiresUpdateEveryTick() {
return false;
}
/**
* Called every tick to update a goal that is in progress.
*/
public void tick() {
}
mojmaps
bruh
ye lol
I don't use mojMaps
figures 🥲
lack of groovy tutorials
for gradle?
yeh
ah I just use kotlin dsl
yuh
