#help-development
1 messages · Page 655 of 1
how is yaml ugly 💀
also hashsets in json are just lists
Never heard of it but i‘ll take a look into it thanks
Have you looked at it?
It‘s a literal bullet point list
doesnt look like it to me
It‘s the same reason I don‘t really like python for example
Json is beautifully wrapped in objects
gson is just json but from google
its supposedly a good library for making json files
since thats what you want
Ah ic
It's ugly
It's terrible if you need to do nesting at all It's prone to errors when nesting and it's unreadable
im sending a cat hitman
Gambling-> Yamling
yml is good for when you want users to write stuff in it
writing json or xml manually is a pain
I love XML though I always use a good text editor for it like usually vsc with XML redhat plugin
same with json and yaml
yeah you can do this is yaml in like 5 lines xD
but hey, if the computer generates it it doesnt matter
like you aint writing these items by hand I hope
I mean I use redhat xml at work too sometimes but its just annoying still
its way more uggly in yaml imho look
container:
source: sh.miles.inventory.ContainerResponder
title: "[Example Title](color=#fff-#000)"
rows: 3
columns: 3
vgroup:
column: 1
item:
item-type: DIAMOND
name: "[Example Diamond](color=#fff-#666)"
lore:
- "[Example Lore Line](color=#111-#222)"
- "[Example Next Lore Line](color=#333-#444)"
item:
item-type: IRON_SWORD
click: onSwordClick
name: "Example Iron Sword"
enchantments:
enchantment:
key: unbreaking
level: 5
ignore-level-cap: true
enchantment:
key: sharpness
level: 3
ignore-level-cap: false
item:
item-type: dirt
row: 1
column: 2
```\
I fucking hated writing this in yaml
at first I'm like oh this'll only takea second then I'm counting my spaces like uh where does this go again
yeah I guess to each their own
this reminds me I still have to make the data driven menu thing I wanted to do
instead of creating menus in code all the time
NERD
events arent important anyways
the way I'm doing it they are important
look at the xml I bind specific methods to each item in a class
like open_menu or whatever?
only events with predetermined results?
or like a crazy scripting thing
I'll have a ContainerResponder class atleast in this example that will contain all methods mentioned in the xml
responder="sh.miles.inventory.ContainerResponder">
<item item-type="IRON_SWORD" click="onSwordClick">
nerd x2
@AnnotationMaybe
public class ConatinerResponder implements OrSomeInterfaceMaybe {
@MaybeAnnotationIdfk
public onSwordClick(InventoryClickEvent event){
// fancy code here
}
}
wait so are those xmls just for you? like who decides what onSwordClick actually does
its for me as a developer
I plan to have links to something like json or yaml that would link elements to a config file
oh so users can make their own menu with existing settings
@Id("onSwordClick")
e.g. I might do some sort of ID system in XML or something else, but I'm going to have at the top a setting like link-config: menus/test-config.json
then in the xml I might do something as the value like {link} which will retrieve the value from the link
probably on an ID based system with JSON keys
well if I want to do something in the config I can just port over my config class into my ContainerResponder
I plan to just take in a supplier when building the XML file with the resonder
I'm going to mock this linking think really quick
maybe something like this I think
<?xml version="1.0" encoding="UTF-8"?>
<container title="[Example Title](color=#fff-#000)" rows="3" columns="3"
responder="sh.miles.inventory.ContainerResponder" link="test-menu.json">
<item id='element1' row="1" column="1"/>
</container>```
```json
{
"element1": {
"item-type": "IRON_INGOT",
"name": "item name"
}
}
I'm still theorizing how I'm going to do the entire file system, but I want to beable to do everything, but the events in files
some internal some user editing
do the entire file system, what do you mean
basically want to iron out how the files will work before I code anything
I want to set out a strict set of rules for the way the files can work before even writing any code
then I'm going to write the API, then implement it
make an abstract syntax tree of the types of entries
never done that before brief example? idk what you necessarily mean ig
well you know how xml, json, yaml, toml etc all have scalar values, list values and map values
yes
just define the format/structure in terms of how one structures the relations between them
and then u choose the file format
if that makes sense
kind of, but not really I'd probably wanna see a code example if you have a link to any
well I just meant like,
lets say I wanna have this config:
{
"items":[
{
"name": "SomeItem",
"count": 3
}
]
}
this can be well written in terms of yaml, xml, toml, hocon or other file formats
the abstract tree here is just the items pointing to a list of maps right?
yeah
hey, I have a problème, my eclypse not see a spingot bibliothèque
what
which version?
so Id just try to map out the different relations between ur values and keys
1.20.1
and not worry about the file format too much, just rather getting the tree itself structured in ur preferred way
spigot or apigot-api?
so like in my xml example https://paste.md-5.net/qagiyuwene.xml
vgroup just points to a list of items and items just point to a map of attributes so I could kinda imagine my data as a
List<Map
on superclass, I not see JavaPlugin
using Maven?
eclipse
sorta yea
or manual import jar?
basically, get ur tree planned out, then u can start worrying about how it looks in xml
how i can remove my old resource from spigotmc?
ahhh, so you're saying I should write the data I'd end up parsing before even writing the parser or the data in the XML
report it and ask to delete
yeah in principle
think of the data in terms of java classes
then just "orm" it
honestly never heard of orm before, this is why even though I'm self taught I'm still going to school xD
ty
object relational mapping :,)
I'm still in hs I've got a long way to go in my knowledge still sir
:)
okay I'm going to see if I get this right I should have something kinda like this
**ContainerData**
String title
int row
int column
String responderClassPath
List<VGroupData>
List<HGroupData>
List<ItemData>
**VGroupData**
int column
List<ItemData>
**HGroupData**
int row
List<ItemData>
**ItemData**
int row;
int column;
... Item Attributes
I'm breaking my data down into what I want to see in their respective types
then I could easily write a parser and express this because each VGroupData is parsed the same each HGroupData is parsed the same and each ItemData is parsed the same
perfect
is there a catch-all event that would detect when a player fires a projectile?
like listening to Event and all of its subclasses?
catching bows, crossbows, tridents, snowballs and so on?
declaration: package: org.bukkit.event.entity, class: ProjectileLaunchEvent
perhaps?
can I get the shooter from the projectile entity itself?
I should be able to, right?
getEntity().getShooter() i think right?
yeah
I've got this annoying thing where I need a custom data object for projectiles so I can tell what they were fired from
because people are bypassing some stuff I made by putting crossbows in offhand
Is there a way to cancel sculk sensors from activating? I'm not finding an event for it
Does anyone know an alternative to ChatColor.of in PaperSpigot 1.20 as it's deprecated?
I have a gradient hex color codes system, but it seems as if it's not working because of this problem in it
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
Jesus christ, it's just a question 😂
Do you know the answer to it or not?
thats just an answer
how do i get the material value of event.getcaught from playerfishevent
Can I report leaker if I know NONCE_ID of the purchase?
If player has fished successfully, the result may be cast to Item.
From javadoc
thank you for trying to help, but i found the way item.getitemstack.gettype
I mean that's basically what I told you to do
You cast to item and then get the itemstack and type from it
Can someone tell me why this isn't working?
// Original gradient color codes - gradientColor.getColorCodeOne().getRed(), etc are all integers (I've debugged this to make sure of it)
// This doesn't work
ColorSet<Integer, Integer, Integer> colorSetOneTemporary = new ColorSet<>(gradientColor.getColorCodeOne().getRed(), gradientColor.getColorCodeOne().getGreen(), gradientColor.getColorCodeOne().getBlue());
ColorSet<Integer, Integer, Integer> colorSetTwoTemporary = new ColorSet<>(gradientColor.getColorCodeTwo().getRed(), gradientColor.getColorCodeTwo().getGreen(), gradientColor.getColorCodeTwo().getBlue());
// These are my debug values to see if the system works or not and it does
// This works
ColorSet<Integer, Integer, Integer> colorSetOne1 = new ColorSet<>(119, 255, 51);
ColorSet<Integer, Integer, Integer> colorSetTwo2 = new ColorSet<>(51, 66, 255);```
a task is not as expensive if the checks are reduced to a minimum
and you need the least amount of instances
i was find WorldTimeEvent but this event works every tick apparently
then a task is better for you
do it every second instead
or even less depending on what you wanna achieve
im pretty sure normally it doesnt go day to night that quick
if you still dont know, just use bungee's chatcolor.of
that will be deprecated on paper too
oh is that how that works?
task mean sholder? or
the more you know I guess
paper deprecate all bungee chat api and string spigot methods
the main reason i refuse to use paper api
does paper have alternatives for those?
adventure components
i'll keep using md's components
oh
they're amazing
if paper wanna remove those they'll lose any plugin making use of them
so it's up to them
Why dont i get a potion effect?
Player victimPlayer = (Player) victim;
Player attackerPlayer = (Player) attacker;
if (attackerPlayer.getItemInHand().getType() == Material.STICK){
victimPlayer.sendTitle("Hello!", "This is a test.");
victimPlayer.addPotionEffect(PotionEffectType.BLINDNESS.createEffect(5, 5));
}
Truely BaseComponent[] is superiour to Component
Yeah, they apparently are working on the big guns now
there might be some small nuisances like how to make a hover event but tbh it's alright
They are very active in the vineflower discord
thank you jasmine
The hard fork can't be far away
*soft spoon
and i looked through adventure, it's not that fancy
It's okay I guess. But does what you'd expect and that counts
As in there are no truly arbitrary limitations
?
yes I will take code that does the job well over code that looks complicated
I mean, 5 ticks isn#t long
beyond that
Isnt it seconds?
durations for anything are usually in ticks
Giving the player the hint of a potion effect
Isn't getItemInHand deprecated?
yes
this is like gaslighting them with a potion effect
It should be finally removed. Deprecated for a few years now
(that would break compat)
Meh, it's quite a dangerous method
If i am setting it to 100 i am still not getting a potion effect
did you change the right one
Like yes, implicitly that means the main hand but eh
Is this inside a listener?
is the victim getting the title ?
Here is the class:
public class PlayerDamageListener implements Listener {
@EventHandler
public void onPlayerDamage(EntityDamageByEntityEvent e) {
Entity victim = e.getEntity();
Entity attacker = e.getDamager();
if(!(victim instanceof Player && attacker != null)) return;
Player victimPlayer = (Player) victim;
Player attackerPlayer = (Player) attacker;
if (attackerPlayer.getItemInHand().getType() == Material.STICK){
victimPlayer.sendTitle("Hello!", "This is a test.");
victimPlayer.addPotionEffect(PotionEffectType.BLINDNESS.createEffect(100, 5));
}
}
}
Is it registered?
that if is cursed
Yeah
if (attackerPlayer.getItemInHand().getType() == Material.STICK){
blind cast all the wayy
cant wait for something to be attacked by a zombioe
Or hit by an arrow
I'm using protocol buffer. Why generated classes from generated-sources folder can't be found be Intelji ?
@EventHandler
public void onPlayerDamage(EntityDamageByEntityEvent event) {
Entity victim = event.getEntity();
Entity attacker = event.getDamager();
if(!(attacker instanceof Player)) {
return;
}
if(!(victim instanceof Player)) {
return;
}
Player victimPlayer = (Player) victim;
Player attackerPlayer = (Player) attacker;
ItemStack attackerWeapon = attackerPlayer.getInventory().getItemInMainHand();
Material weaponType = attackerWeapon.getType();
if(weaponType != Material.STICK) {
return;
}
victimPlayer.sendTitle("Hello!", "This is a test.");
victimPlayer.addPotionEffect(PotionEffectType.BLINDNESS.createEffect(100, 5));
}
Did you add it to your pom? Is it in your local maven repo?
No I'm doing this stuff for the first time. What should be added in pom?
The dependency
like I have dependecy to Protocol buffer plugin if you are asking about it
And you defined your protocol?
@spare hazel you joined my discord server
Those classes are already generated but can not be found be Intelji. IdeaProjects\TEST\Client\target\generated-sources\protobuf\java\io\github\jwdeveloper\generated\EmoteDetails.java
Thanks, but its just dosent make sense, 20 ticks = 1 second, and it is 100 so that should be the potion effect for 5 seconds, but it is there for around 1.5 seconds
Spigot version?
calling 1.8
Yeah
Got a quick question about maven compiling:
Is there a way to tell the compiler to replace a certain string with some value/string?
So for example I want "%%url_param_id%%" to be replaced with "id".
I have some JS files and some java files and I want to make sure both have the same value for it.
Ok I found solution. There should be in Pom link to generated source directory <sourceDirectory>/Client/target/generated-sources/protobuf/java</sourceDirectory>
Might have found smth
1.8
if the server restarts/reloads, what happens to scheduled tasks?
https://paste.md-5.net/dafafupaka.cs - I made a task scheduler to check the presence of the night by specifying how many seconds to set for the loop
depends what kind of tasks. Async or sync?
sync
Cancelled
how math need sec for check your recomindation?
at least 2
*If you dont want to solve any integrals
I can't work out if I'm doing something real dumb but I've managed to create a custom command system but I can't work out how to make the server detect when the plugin is ran and if it's ran how to execute the method
does someone know how to load multiple yml files on the initialization of the plugin so just like the config.yml i want to use a rounds.yml to be able to controll the amount of mobs spawning in each round. With the way that i tried it i got newPosition < 0: (-1 < 0)
Hi, is it still true that bungee has no method to simply create config.yml from file in Resources?
It should be simple enough to do yourself if it doesn't exist
Get Inputstream and write it to fileoutputstream
Yes it is simple
I'm new in Bungee. If I throw exception in onEnable() method for any reason, will plugin disable please? Or just show exception in logger? Or does it depend on whether the exception is checked/unchecked?
Thanks!
(I'm asking because there is no disablePlugin in PluginsManager)
Does anyone know how ticks work? 1000 ticks is somehow 12 seconds?
ideally a second is 20 ticks
laggy server
nope, his 1000 ticks doing 12 seconds is faster than any server can run
his math is bad or his code is bad. Or his watch is broken
hmm, shouldn't this be detecting if the falling block landed?
@EventHandler
public void changeEvent(EntityChangeBlockEvent e) {
Bukkit.broadcastMessage("Something");
if (e.getEntity() instanceof FallingBlock fallingBlock) {
Bukkit.broadcastMessage("Falling block");
Block block = e.getBlock();
block.setType(fallingBlock.getBlockData().getMaterial());
}
}```
kinda weird
Or he uses some kind of fork with functionality to catch-up missed ticks
i've seen multiple spigot resources and this is how they do it
i've also tried e.getEntityType() == EntityType.FALLING_BLOCK
How do i do so the time of the potion effect dosent stack? its becuase you get 3 seconds blindess every time you get hit and i dont want so you can hit a person 10 times so its 30 seconds i just want so it dosent stack
Uh that's a thing?
who know were i can gat this api
Is there a way to bold, underline, etc a message which has been formatted by using hex color codes?
Failed to create log file: BuildTools.log.txt
Loading BuildTools version: git-BuildTools-2836244-160 (#160)
Java Version: Java 17
Current Path: C:\Users\Niklas\Desktop\Build-Tools\.
*** Using downloaded git PortableGit-2.30.0-64-bit\PortableGit ***
*** Please note that this is a beta feature, so if it does not work please also try a manual install of git from https://git-for-windows.github.io/ ***
git version 2.30.0.windows.1
Niklas326
root@niklas326.de
Picked up _JAVA_OPTIONS: -Djdk.net.URLClassPath.disableClassPathURLCheck=true
java version "17.0.7" 2023-04-18 LTS
Java(TM) SE Runtime Environment (build 17.0.7+8-LTS-224)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.7+8-LTS-224, mixed mode, sharing)
Attempting to build version: 'latest' use --rev <version> to override
Found version
{
"name": "3844",
"description": "Jenkins build 3844",
"refs": {
"BuildData": "faff587dcbe915bc565bf01f2d54c6af86039414",
"Bukkit": "f83c8df43a0d48d0743834730abee046c1fa1d3a",
"CraftBukkit": "c335a555fb8cf6efda5b99d89bda26393199fa92",
"Spigot": "b41c46db51ec4aca746def5ac9080ec319c4abdb"
},
"toolsVersion": 148,
"javaVersions": [61, 64]
}
Starting clone of https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git to CraftBukkit
Exception in thread "main" org.eclipse.jgit.api.errors.JGitInternalException: Could not rename file CraftBukkit\._LGPL.txt10782082938263398985.tmp to CraftBukkit\LGPL.txt
at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:215)
at org.spigotmc.builder.Builder.clone(Builder.java:1140)
at org.spigotmc.builder.Builder.main(Builder.java:365)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
Caused by: java.io.IOException: Could not rename file CraftBukkit\._LGPL.txt10782082938263398985.tmp to CraftBukkit\LGPL.txt
at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:1516)
at org.eclipse.jgit.dircache.DirCacheCheckout.doCheckout(DirCacheCheckout.java:563)
at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:467)
at org.eclipse.jgit.api.CloneCommand.checkout(CloneCommand.java:385)
at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:212)
... 3 more
Caused by: java.io.IOException: Could not rename file C:\Users\Niklas\Desktop\Build-Tools\CraftBukkit\._LGPL.txt10782082938263398985.tmp to C:\Users\Niklas\Desktop\Build-Tools\CraftBukkit\LGPL.txt
at org.eclipse.jgit.util.FileUtils.rename(FileUtils.java:323)
at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:1514)
... 7 more
C:\Users\Niklas\Desktop\Build-Tools>```
help.
probably permissions problem
I have started CMD in Admin mode
d
public void setMoneyValue() {
OfflinePlayer[] players = Bukkit.getOfflinePlayers();
YamlConfiguration cfg = YamlConfiguration.loadConfiguration(getMoneyStats());
for (int i = 0; i < players.length; i++) {
cfg.set("money." + players[i].getName(), RecklessGD.getInstance()
.getPlayerHandler()
.getCurrency(players[i].getPlayer(), PlayerHandler.Stats.MONEY));
}
try {
cfg.save(getMoneyStats());
} catch (IOException e) {
throw new RuntimeException(e);
}
}```
Why do I get a NUllPointerException
getCurrency return me an Integer of the Players Balance, it is safed in an another Config
which line is giving npe?
[19:36:20 WARN]: Unexpected exception while parsing console command "money"
org.bukkit.command.CommandException: Unhandled exception executing command 'money' in plugin recklessgd v1.0
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchCommand(CraftServer.java:1003) ~[paper-1.20.1.jar:git-Paper-60]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchServerCommand(CraftServer.java:966) ~[paper-1.20.1.jar:git-Paper-60]
at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:501) ~[paper-1.20.1.jar:git-Paper-60]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:448) ~[paper-1.20.1.jar:git-Paper-60]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1394) ~[paper-1.20.1.jar:git-Paper-60]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1171) ~[paper-1.20.1.jar:git-Paper-60]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-60] at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.Player.getUniqueId()" because "player" is null
at us.recklessgd.handler.PlayerHandler.getCurrency(PlayerHandler.java:69) ~[recklessgd-1.0-SNAPSHOT-all.jar:?]
at us.recklessgd.handler.FileHandler.setMoneyValue(FileHandler.java:74) ~[recklessgd-1.0-SNAPSHOT-all.jar:?]
at us.recklessgd.commands.ReloadMoneyConfig.onCommand(ReloadMoneyConfig.java:15) ~[recklessgd-1.0-SNAPSHOT-all.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
... 9 more
soo.. uhh
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.Player.getUniqueId()" because "player" is null
Is that player online?
instead of normal Player?
Players are only for those online
ahhhh
Hence the distinction.
and OfflinePlayer for both?
Yes
yes
Then which jar do I need to take at build tools so that I have the following imports: org.bukkit.craftbukkit, net.minecraft.network
You need the mojang mappings. java -jar BuildTools.jar --rev latest --remapped
OR
Use the WIP GUI #1117702470139904020 message
?nms
Spigot doesn't support gradle for nms natively
Use maven if you're using spigot
but it works (so spigot does)
I use gradle and have now run java -jar BuildTools.jar --rev latest --remapped, what do I need to use now?
what
which jar
paperweight is a thing???????
He's using mapping buddy
That's not spigot
ah okay
what is mapping?
Notice how I specifically said spigot and not paper
like what its jobs
Their apis are different
This is spigot, stop recomending gradle/paperweight
How are you going to suggest gradle if you don't even know what the mappings are?
idk, my friend told me to use it
We're not telling you what to choose
Just saying paperweight isn't compatible with spigot easily
im using paper for server 🗿
wait im confused
paperweight isn't compatible with spigot easily?
w/e
wrong server i guess 😄
I use SPigot PLugins but server is running with Paper
It doesn't matter what server you run. If you build for Spigot use Maven
what are the advantages of maven?
Spigot is designed to use Maven for building/mapping
ohhh.. thats why it is good to use Maven.
Right tools for the right job.
It doesn;t support Gradle for NMS
bro what are u saying 🤣 🤣
the truth, why are you grinning?
Idk how much simpler it can get.
Spigot = Maven
Paper = Gradle
Paperweight = Paper = NOT OFFICIAL/UNRELATED TO SPIGOT
👍
MyPlugin.getInstance().doSomething()
or
MyPlugin.doSomething()
public static MyPlugin getInstance() {
return JavaPlugin.getPlugin(MyPlugin.class);
}
Discussing with my friend about this (I am pro-getInstance for APIs)
as a plugin you shoudl use getInstance
If it's not a plugin and you have full control over instancing you are fine without getInstance
then dont go over the main class
if its an api you should have another access point which is NOT your entry point
Fair enough
Though I still need a plugin class to register some listeners which are required
yeah but that should not be the access point for the enduser
Yeah
Hey guys do somenone knows a prophunt (hide and seek) plugin with some taunts on 1.8.9 pls or higher but I prefer 1.8.9
Too old! (Click the link to get the exact time)
Sry
is there a way to auto complete chat like command arguments?
chat like?
declaration: package: org.bukkit.entity, interface: Player
How I can sort a Map<String, Double> by the values from high to low and return the top 10 Strings in a List?
use a TreeMap and pass a Comparitor Map.Entry.comparingByValue()
hi, let's say I have a plugin that displays the number of broken blocks on my server. On a bungee proxy, how can I make it display the same number on the 2 servers?
How are you detecting broken blocks on proxy?
I haven't yet developed a proxy, so that's why I'm asking. I can't detect the event on all the servers? I have to have the plugin on each server?
What do you think, with this change there will be possibility register custom packets in spigot?
Yes, proxy is not really aware of minecraft related things, it's really just a proxy
I would connect all those plugins to same database
To keep count synchronized
ah yes, but then I can't do any more caching
I mean you can sure make a system that will send message to proxy on every event via some messaging service(redis, plugin messaging channel etc)
But idk how performant will it be
I wouldnt say its best idea
ah yes so the best is to go through the db
nvm
there are alternatives for spigot for gradle
Hi, Im trying to do something similar of this thing
But the thing is that I need code that the player have 2 options, proceed or gets disconnected from the server
Hey I want to build a nick plugin...Is there a DB where I can get Skins and Names of players?
But I just can do that:
I don't need the option No because is forced
Can somebody help me?
i wonder how he did this
is getConfigurationSection("test").getKeys(false).isEmpty() true while configuration file looks like this:
test:
so why this happens:
[01:05:26 ERROR]: Error occurred while enabling NLGangs v1.0.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.getKeys(boolean)" because the return value of "org.bukkit.configuration.file.FileConfiguration.getConfigurationSection(String)" is null
yes
its like saying test: null
how does YAML know that's a section, its just a key, so yeah its null
well it just looks for another key presumably
I am currently making a spawn plugin. When you type /spawn, you have to stop for 3 seconds, but I don't know how exactly to do that? At least I don't know what to use, I think it's called a boolean. On the screenshot you can see more exactly what I mean. Can someone help me or at least tell me how I can solve this?
put them in a List when they do /spawn and check in PlayerMoveEvent for movement
just check if getConfigurationSection returns null
fucking intellij says ConfigurationSection is not null at all
Lets play a game called getting an old driver to work on a modern pc
(Coded in C)
yes
likely because getKeys returns a collection
and if there are no keys, it will be an empty collection, not null
intellij doesnt say anything about getConfigurationSection I guess
Best part? Single monitor, so it's all phone screenshots lets gooooooooo
How can I get a skin for a NPC in 1.8 with NMS?
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.getKeys(boolean)" because the return value of "org.bukkit.configuration.file.FileConfiguration.getConfigurationSection(String)" is null
while i'm checking for null:
if (data.getConfigurationSection("test").getKeys(false) != null) { ... }
How do I do that? I have not been programming with java for so long.
are you not listening?
I said check if getConfigurationSection is null
null.getKeys() does not exist
ow, thanks
do you know how events work in spigot?
okay, then listen for the player move event
have some kind of hashmap with player ids and something like the time they went to spawn or whatever
I mean this isnt a very basic thing
Do you mean i should do that?
Why not have HashMap<Uuid, bukkittask>, task would be repeating task on every 20 ticks for 3 seconds, listen to Player move event, if move get task and cancel it
okay but thats in a other file how can i use that in the spawncommand file?
import the file and then?
this is where you need to learn about object oriented programming I guess
you could just listen for it in the command, but thats not a very common way to do it
but in short, you should have some way to access the hashmap of players
like maybe i your plugin class
then you can reach it from both the command and the this event listener
Trying to get the craftbukkit project loaded up in IntelliJ and it's for some reason having trouble resolving the bukkit api dependency. Did I miss a step along the line somewhere? nevermind just needed to mvn install the Bukkit project
I have run BuildTools and have appliedPatches pointing to the correct working directory
would having protocollib stuff screw with my vanish plugin?
im not using it to vanish players but im starting to think that it may be responsible for my vanished players becoming visible when they click things
how do i put hex colors on ItemMeta.setDisplayName()? Im currently getting the string from the config but its not parsing that hex
Too old! (Click the link to get the exact time)
ChatColor.GREEN + "your name"
my b
probably
i will start learning it how it works tomorrow but can you tell me how i can do that now? maybe.... 😄
well I told you a general approach
for any specifics that would just be java stuff mostly
but in this server its assumed you atleast know basic java
which includes oop
i watched one tutorial about this right now and its so simple thanks for helping me a bit to learn spigot (java)
how would one set the block display type?
using packets
because i need it client sided
using this rn:
which isn't working
then the method:
Are you sending the meta packet
I assume so
My event isnt firing
You haven’t really shown much of the code so it’s hard to say
It needs the color code too
Also please don’t identify items by lore
?pdc
👍
hmm
still doesn't show the block type
the entity does spawn
i can see it in my F3 menu
just cant see it
which is why i think its display.setBlockState(getBlockState(blockData));
nvm
okay i have another issue now, it is setting the state
but how do i spawn it at a location?
how am i supposed to spawn it at an itemstack
setPos
ayyy
ty
hmm
transformation doesn't seem to be working
i've also tried to set it when i send the packets
that refers back to
which seems correct
then setting it:
Iirc there’s a setTransformation
ye
still doesn't work tho, i've tried to set it in the constructor of the builder class
and then the .build method
neither of them work
What are you setting it to
wdym?
transformation itself is this:
private Transformation transformation = Transformation.identity();```
Yes but what values are you using
alr
tried doing this: java private Transformation transformation = new Transformation(new Vector3f(), new Quaternionf(), new Vector3f(), new Quaternionf());
which completely broke it
no, but i set it to 0.5
@wet breach Maybe you'll know
I meant try constructing a new transformation when you want to edit it
i don't know the problem
probably just needs to be added to modprob
No, it has specific compile instructions
Those are the errors I get currently
Can't add it if it doesn't compile kekw
what errors?
.
They're all code related issues
If I can get it and the PCs nic working @wet breach then it would allow me to have a PC dedicated to just cyber security, and make it worth at least slightly improving
Could give it a slightly better CPU (maxes out easily currently) throw ssh & ftp on it, and make it an ok-ish home lab until I can buy a laptop
Is someone able to explain why this is happening? I am using this code to write my HashMap<String, Syndicate> (Syndicate is a custom data type) to yaml and it's all working properly except for the !!com.playharth.syndicates.Syndicate after the String:
for (Map.Entry<String, Syndicate> entry : syndicateList.entrySet()) {
syndicateData.getConfig().set("data." + entry.getKey(), entry.getValue());
syndicateData.save();
}```
The serialiser has to know what class it’s using. Pretty sure you’d have to manually parse it if you don’t want that
Alright
I've heard so many conflicting things on the player uuid thing
Oh alright
So I do actually have to
alright
mhm
would it be easier to load this back to memory as is or should I just manually parse it?
well yeah that's a given
What conflicting things have you heard about player serialization?
It’s pretty cut and dry
yeah I realize that now
So that post it technically right but if you keep the reference in the collection gc wont pick it up and it will cause a mem leak
And knowing most new devs wont manage their memory it will become an issue
But yes if you properly manage memory it will be fine
Not in config though thats a different story
that first point is some astronomical bullshit if I've ever read one
a List object with five million elements occupies the same space as an Integer because they're both references, not the values themselves
the underlying values occupy the bulk in memory
zzz
You know that a list with 5 million elements has to store 5 million references, right? It's not a single reference
Of course. The array holds 5 million references though
Probably 1. and 2. go together. It is the same space until the players logs out. Because then you keep a player instance alive - that one has more fields than a UUID instance
My point is that saying that is disingenuous, it's why the 1st point is bullshit because the ServerPlayer has more fields than UUID, so they don't take the same amount of memory just because they're references
The opionion about saving player instances differ
I personally don't mind as long as you clear them on PlayerQuit
Other state that Players are Entities and can get unloaded and loaded again (therefore having a different reference) in the future. That they are constantly loaded is an exception among entities
Oh I didn't read the second paragraph and therefore misunderstood you - I was kinda distracted.
However the ServerPlayer Object is also just an Object that holds other references that then gets carried on as a single reference which therefore needs the same space
Is it better to make 1 plugin with all the features like making holograms making crates, etc, or make separate plugins for each thing?
okay
You can have a core plugin that handles common things better them
would that make it more lightweight?
sure, which is also the same as saying a list ref with 5 million elements occupies the same space as an Integer ref
do you see why i say it's disingenuous to say that?
So I'm back to working on this. I attempt to load the data and I get the following:
Is my only option to manually parse it or is there something else I can do?
this is not true at all
yes it is
no
yes
well I don't acknowledge you as an expert in regards to the JVM
okay and?
what you are saying is incorrect in regards to the JVM
List<Object> l
l.add(ArrayList.asList(new Object[5000000]))
l.add(Integer.valueOf(1))
shallowly, l is just as wide as the Integer which is just as wide as Arrays$ArrayList
that's what the thread is trying to say
"not true"
"yes it is"
"no"
"yes"
lmao
they do not take up the same amount of space. But do point me to your reference material that states they do?
the reference itself does, yes
it's just an Object reference at the end of the day
rather, what makes you disagree?
the reference is the same size, yes
but the literal allocation for the object is definitely larger

sure? the underlying data, but the reference itself is the same width
the object itself is not
sigh
I don't care about references and they are pointless to compare with
this is exaclty the point
that is exactly why i say it's disingenuous to claim this
that is exactly why i say the thread is silly
claim what? that the objects actually differ?
claim that the references itself inside the list are the same width
not the real data in memory
but the reference that points to said data
depends how the list is filled
I thought this was a thread to help with Spigot Development questions? Why are we arguing about references and objects?
https://www.spigotmc.org/threads/psa-player-vs-uuid-objects.290611/ i've scrolled to see what started this
and that thread makes complete sense
not sure how this argument started
the first claim in that thread is stupid
the one that literally reads "first"
primitives are not instances or references
The thread you linked starts out stating a false premise
It's a pretty common misconception that
You should store UUIDs instead of Player objects because UUIDs occupy "less space"
Thats not the reason at all to use UUID
who brought primitives into this?
explicitly talking about references
when you asked why it depends
but I assumed you read the jvm spec
I'm not saying he is right, I'm saying that the anti claim makes sense. The point of Map<UUID, V> vs. Map<Player, V> is NOT because it occupies less space, because it occupies equivalent space
I must have been mistaken
you assumed right
again, explicitly talking about references
"except for this thing that has nothing to do with what you are saying"
then don't make remarks as if you don't know if you did in fact read the jvm spec
this entire conversation is dumb
if you want to argue, argue in the spigot thread
because none of these claims are logical
what the thread is claiming is that both elements inside the list occupy the same memory because "they're both references"
which is what i am saying is silly
literally the truth:
Map<UUID, V> and Map<Player, V> use the same amount of memory because Player AND UUID is already allocated BEFORE the map is created, and the references are equivalent in usage regardless of type.
sure the actual reference is nothing but a pointer so they have the same width but there is more data than just that, the one frostalf rightfully said "needs to exist somewhere, the primary one"
The ONLY reason we alwasy say to use UUID and not Player has nothing to do with Object size, gc or any stated in that thread. It's mainly because Player objects are transient while UUIDs are not.
typical frostalf conversation
This is why I make sure to deep copy my players
That way I can make sure I use more memory
I'm not saying they're right or wrong because I personally use the UUID anyways. The point is, argue that in the spigot thread and not here
too late xx
Unless there is a dev question in here to answer, discussions like these are permitted
its more fun here 🙂
not to mention, transient status literally means nothing unless you're using a serializer that uses it, or for whatever reason using that map in a DTO
so I will actually break my own advice and say that doesn't make sense (not to me, yet)
but I digress
You are talking about Java transient not object transient
"The ONLY reason we alwasy say to use UUID and not Player has nothing to do with Object size, gc or any stated in that thread. It's mainly because Player objects are transient while UUIDs are not."
what are we talking about here
someone explain this logic to me, because I've only ever heard of the 2 claims inside that spigot thread
Transient lasting only for a short time; impermanent.
ah
The Player obejct is not reused when a player relogs. A new object is created
Player objects can disappear from under you
and the reference will then point to nothing
where as the UUID will always be valid
Yes but the only reason people store Map<Player, V> is when they remove it with a PlayerQuitEvent
same with a Map<UUID, V>
That’s not true
I've never seen a map with player keys expected to persist past object deallocation or player logout
they are supposed to but none ever do. Storing UUID is safe (no cleanup) Storing Player is not safe
Remember this is spigot developers we are talking about
We see devs in here storing Players with no cleanup all teh time. Which is why we teach to use UUID
to be fair there, that's a problem on its own
agreed
because those entries won't magically disappear after the player logouts
true, but they won't duplicate either
unless its a weak ref
where as the player object reference will
It’s still a memory leak
But at least it won’t grow due to the player relogging a bunch
Hey, I have a question. Do you know how a Minecraft plugin communicates with a website? If it's a client request, or a server request?
Well it depends on the plugin/site in particular.
umm
A common setup is for the plugin to send requests to an API.
bro i cant get e.getclickedinventory().gettitle
it deoest show me the gettitle option
Since this is server-side, you can also easily protect API access through a token, as the client can't get access to it. Just make sure you use environment variables and don't leak that token.
OH
I'm just assuming you're asking because you want to implement your own system. If so, use cryptographically-signed tokens to prevent forging, i.e. HMAC. A good format for this is JWT.
How can i do that ?
Look into how cryptography works. The main principle behind cryptographic signatures is that you have two keys. The private key is used to sign the token, the public key is used to verify that the token was signed with that specific private key. The private key should remain private (i.e. only your API server should have access to it), the public key can be provided to anything (like your plugin).
If you find that too confusing, don't try and code it yourself, just look online.
If you don't need your API to be protected (i.e. it's meant to be public), no need to prevent people from forging API tokens, so no need for tokens in the first place.
Alright, thanks for the info 🙂
You're welcome.
.getView
got it thx
also btwe there is a problem
when iam coding ofc i need to replace plugins 1m times
but when ever i try to delete it it says running in java IDK
so i have to stop server remove it and restart it :/
well that sucks
it also takes me 20 minutes to test my plugins because my pc is soo bad
it can even barely run google and intellij at the same time
Create a symlink of your plugin in your server plugins dir. That way you don't need to replace the file. You will still need to restart the server every time you make changes though.
Also how do I update my plugins in the spigot forum
hello, let's imagine I want to make a tablist pluign for bungee. I'd have to make a proxy plugin and another spigot plugin that I'd put in the servers and make them communicate with the proxy plugin?
the mc support experience
Hello I had a question, can a Minecraft server send a "POST" request to an HTTP server?
Yes, provided you have an HTTP client.
I would like to query my API to obtain information from an SQL database, I tried with Postman (everything works), except with my Minecraft server which shows me in the debug log "error 404"
I'm not sure why that would be the case.
This is my error message when i try to connect with my Minecraft server : https://pastebin.com/61D3CXzr
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.
so i don't understand ...
?paste your code
that is a stacktrace and not your code
?paste
Here the java code : https://paste.md-5.net/fufuvosoge.java
So ?
- am i need jpa and hibernate for spigot plugins ?
It really depends on you, there is no correct answer
But personally I find myself more confident to write queries then use hibernate for example
Sure if you want
It always gives you more safety
From things like SQL injection
Generally all kinds of human error
Update your java
you have a too new version of hikari cp
well im using tlauncher and i need upload old java version
minecraft servers has a problem for our country
i will delete and try
@remote swallow tlauncher is not just offline launcher
It supports both
it does?
i have 3 account
til
Launchers with offline are really useful for debugging
I'm not paying for more mc accounts
u guys can join minecraft ?
@quaint mantle launchers like polymc let you change java version independently of instance
just use my bot creator @onyx fjord
Bots arent useful
I just need 2 mc instances
For example when I was making a claim plugin
big craft doesnt want u to know this but u can get offline mode with the vanilla minecraft launcher
I save something to the db every time players enter and exit the server
this will do lag ?
we can't login to the launcher in any way
it even makes me launch the game as a demo
microsoft confirmed this they are going to fix it today
oh im talking like custom name offline :P
ah mb
no if you do it correctly
the launcher sucks anyway
instancing is shit
and its slow
and the worst part
its absolutely proprietary
and peterix works on it
can u give me idea for something ?
polymc 😎
ah
for save database
now
im doing friend plugin
and i wanna get friends from player
and i think this how do i save friends to database ?
am i create primary key with player uuid and create colums like
friend1 friend2 friend3
or i do only like this
friend1 and friend2
they will be friends if they are in the same column as each other
I told you a little strange
if u can't understand i will show with pictures
Don't create different column for every friend
You want to learn about database normalisation
And relations
You basically want table called friends or something where columns would be UUID | FRIEND_UUID and make it composite primary key
That way you can have multiple friends for same uuid (I just notices I haven't considered that friendship is mutual, according to that, design may be slightly different to avoid useless memory consummation)
migrating dbs for such a non issue seems inconvenient lol
- Can I see what server you're playing in bungeecord?
- Can I send a message to a player in bungeecord?
with craftbukkit?
i believe so
is this for your own server or a public plugin?
if its for your own network just chuck a plugin on the proxy and make your life easier
and use redis if you can
DELETE FROM blocks WHERE x = ? AND y = ? AND z = ? AND world = ? How do I formulate a command for mySQL??
Well how do you add it
Check return value of execute Update
are you sure the locations are the same
the add might add with a double location
which doesnt match the delete
assuming the query starts with DELETE
I think they want to delete the block not insert it
check which blocks were generated and which were placed by the player.
when a player places a block, his location appears in the database.
but if it is broken, then it does not remove it.
maybe the problem is here
if you get the block position, why use doubles
I would not query db synchronous on every block place/break
I don't know, I just give out double in Location#getX().
Also check return value of executeUpdate, if it's 0, smth is wrong with your query
After that try to select values with same x y z and world
If 0 rows are returned check what value doesn't add up
It's called debugging
How can i create a bukkitrunnable as a class and then create an instance of the bukkitrunnable whenever i need?
yes but getx and getblockx are different
public class MyRunnable extends BukkitRunnable {
@Override
public void run() {
// code
}
}
new MyRunnable().runTaskTimer
Ok
this is a class impl not annon impl
What is the reason of requiring at least one player to send a plugin message?
i found mistake, i wrote in y - getBlockX()
plugin messages hijack the player connection
How can i get a list of all the players?
so you need a player connected in order to send one
What doesn't BungeeCord create a connection by itself?
bukkit.getOnlinePlayers() is a thing right?
Yes?
okay, then thats how @spare hazel should do it
sorry I wasnt answering you, I know nothing about bungee except they have a cool chatcolor class
OK I see, I was just confused.
You don't need getServer
^^
yeah Bukkit is the real static abuser here
Lol yes
Hey ! I'm currently developping a Plugin that involves villager trades (I'm on 1.8.8)
However, I can't shift click my materials into the Villager trade menu, so I tried to make it but artifically
Heres my code so far :
public void onClickEvent(InventoryClickEvent event){
Inventory inventory = event.getInventory();
if (!event.isShiftClick()) return;
if (!inventory.getType().equals(InventoryType.MERCHANT)) return;
ItemStack cursorItem = event.getCurrentItem();
inventory.setItem(0,cursorItem);
}
However, the item isn't moved in the specified location (here, slot 0, the villager trade slot)
Any clue on how to do that ?
Does anyone actually think, java is better than C#?
The problem with your code is that you are trying to set the item in slot 0, but the slot 0 is the hotbar slot, not the villager trade slot. The villager trade slot is actually slot 36.
try 36 instead of 0
Depends of use case. C# is way more flexible when it comes to coding since it has more features
okay it still doesnt work but now it does something new
i have an error
What more features?
[12:47:05 ERROR]: Could not pass event InventoryClickEvent to rushplugin v0.1
org.bukkit.event.EventException: null
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
(i shortened the error to make it fit in a message)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 36
at com.hkrush.rushplugin.listeners.ClickEvent.onClickEvent(ClickEvent.java:44) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_382]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_382]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_382]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_382]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.8.8.jar:git-Spigot-21fe707-741a1bd]
... 15 more
Any idea ? 🤔
It seems like the slot 36 isn't the right slot , idk
hm
I tried logging the slots by using System.out.println(event.getSlot()); on the InventoryClickEvent
However when i click on the villager trade slot i get "0", and when I click on my hotbar first slot I also get "0", so i'm kinda lost 😅
Only I can think of are properties, which I can't really count lol
null safety
pointers
properties
those are just 3 off the top of my head
Extensions methods, null operator, string interpolator, parial class, file scope class, (properties)getters and setters, dynamic objects and more
I agree on extensions, just used so much to kotlin that I doesn't rember it doesn't exist in java lol
c# is objectively a bit better than java
However it's just syntax sugar
objectively 
and my favortie feature that is not possible in java T generaicParameter = new T()
Hi ! how can i shade reflections in my spigot plugin ? i'm using maven btw
If u are using dynamic and pointer in c# you are doing smth wrong, hence I can't really count those as features
what do you find wrong with that?
anyone claiming any programming language is "objectively" better is pretty delusional
you have your usecases
for some usecases your pgoramming language might make more sense
well yeah
for others, not so much
okay then
natively they dont
You just considered usecase
When I said objectively, I meant for the same use case, one is better than the other
C# has more features
So c# is better then java in making mc plugins
and ur likely to use
its not that c# is worse, but there are no apis
for c#
and minecraft itself is made in java
I mean, java ecosystem is a whole different beast to c#
Hi ! how can i shade reflections in my spigot plugin ? i'm using maven btw
given the amount of third party libraries etc
yeah
java is much larger than c# in terms of libraries
but we're talking about features here
well but you aren't
if you call a language objectively better
you talk about the entirety of the language
I mean, haskall can do a lot of cool things java cannot
is it now the objectively better language ?
to be fair you can do almost anything in every language. the difference is how many hoops you need to jump through to archive it
arent useful in most code bases
I also can't find what features are you talking about xd. Only real benefit is no runtime clearing of generics
still the same error, do you think it could have something to do with this ? #help-development message
Yea, so realistically you like some C# syntax and langauge features over java
GG
I like some kotlin features over java
Hi ! how can i shade reflections in my spigot plugin ? i'm using maven btw
when does this event run? I activate the piston and nothing happens
try raw slot
The disadvantage in C# I see is application compilation because it needs 10000000 dlls to run. Simple self executable C# console app has about 90mb
try to check if the inventory
being clicked on
is yours
or the trader
understandable
this whole debate is honestly pointless
yes
each language has its own use case, as u said
Hi ! how can i shade reflections in my spigot plugin ? i'm using maven btw
Google your question before asking it:
https://www.google.com/
Its the trader, i'm checking this with the if (!inventory.getType().equals(InventoryType.MERCHANT)) return; condition
I tried with raw slot as @smoky oak suggested, and I still get 0 for the villager trade menu
However, I get 30 for the hotbar first slot, so it means the slot i'm looking for seems to actually be 0 ?
thats cuz raw slots are counted differently
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
bro if i'm for asking help that's google dont help me !
bro if you are asking for help with something as basic as shading
the only thing anyone here would be doing is just, linking a google result
That's perfect !
But it still doesn't help me, because when I try "Inventory.setItem(0,item)" it does nothing
or rewording it
shading in maven isn#t some terribly complex thing, it is well documented online
piece of shit i just need some help stop trash talking people i'm not a senior java developper
bro
the raw slot applies to the inventory of the trader and the player inventory differently
you might want to post your relevant code
especially as a non senior java developer you should learn that googling things on your own is a major part of development
if the only way you learn things is by relying on other people to spoon feed it to you
you are not going to get better
then i guess use raw slot
I did, but here is the code again
public void onClickEvent(InventoryClickEvent event){
System.out.println("A click event pccured. Here is the raw slot :");
System.out.println(event.getRawSlot());
Inventory inventory = event.getInventory();
System.out.println(inventory);
if (!event.isShiftClick()) return;
if (!inventory.getType().equals(InventoryType.MERCHANT)) return;
ItemStack cursorItem = event.getCurrentItem();
inventory.setItem(0,cursorItem);
}
le baguette my friend
the inventory.setItem(0,curstorItem) does nothing
