#help-development
1 messages · Page 1691 of 1
Spigot breaks a vanilla mechanic where explosions push invulnerable mobs. Any idea how to fix?
How could I make this lighter than what it's already ababab hex color
How light?
Did you try a color picker?
what
What is the error?
are you saving it as a .bat file?
yeah
save it as a .bat file
Save as
All files
start.bat
ug
save
and run the file
all files
same thing
you didn't use the all types option
yea
uh
rename your spigot.jar to just spigot
as you have it as spigot.jar.jar atm
means you got no ram
how much ram do you have installed?
What was world.setGameRuleValue replaced with?
on your system
Just setGameRule(), Doc
world.setGameRule(GameRule.DO_PATROL_SPAWNING, false);
as is noted in the deprecation notice ;p
Sweet thx
Would be cool if when they are deprecated they tell you why and what to use. I guess I am asking for to much.
They do, you just can't read
😮
i mean in code not on the online javadocs
ye u lazy
I can assume you are using Eclipse if you don;t see teh javadocs in your IDE
Can you import them?
Eclipse shows docs just fine Elgar 
click button
Only if you add them.
if you use intellij you get nice formatting
This is what i see
I dont use maven
Need to how i can do this i did not know i could import them
it is automatic for gradle
well i guess not cause what i posted it what i see for that method
google is your friend
Yup doing that now
might be bc u are using the spigot artifact
What should i use the spigotapi?
this is from spigot-api (see bottom line)
yea that looks way better
nope still the same
implementation "org.spigotmc:spigot-api:$MINECRAFT_VERSION-$SPIGOT_API_VERSION-SNAPSHOT"
is there a sources jar in ur dependencies
yes
just add the documentation manually
how? is the question
That i found, but the issue is that file path i have nothing in.
you change 6 to 4 and save the file
yes
You can’t see your file extensions
So it’s technically named start.bat.txt
Iirc it’s an option in the view tab
Google can probably help
why you askin me
you're in notepad
its just text
if you open a .java file its just text
code is just txt until its turned into machine code
how do i modify the text of an existing hologram
do you have any info about the hologram?
like entity uuid?
ArmorStand hologram3 = (ArmorStand)
i think i could edit it inside the if statement but i want hologram3 to be public to all if statements
Do you have any control over the namespace when you register a command with brigadier, or will it always be minecraft:command
store the hologram outside the if statement then
or like define the variable at least
if that makes sense
yeah i was thinking of doing that
asign p.getLocation to a variable and reasign it?
wait...can you have custom sounds without replacing any?
I've been under the impression that you can't
You can
ok it worked :DDD
so i guess im confused
how exactly do i use AttributeModifier to increase health
i know the URLs, i know the GENERIC_MAX_HEALTH
im just wondering like... how?
ykw nvm
I'm trying to create a multi-module project with Maven, can someone guide me with it? Right now I have a project but I want to implement a feature with NMS.
I could if it was gradle
Ah, is it complicated to switch from Maven to Gradle?
I can try maybe
Let me open up a thread real quick
Converting Maven project to Gradle in IntelliJ
Alright download https://gradle.org/releases
Then put it into the directory
C:\Gradle
Then add an environment variable under Path called, C:\Gradle\gradle-7.2\bin
Assuming u use Windows
Anyways here’s the thread
https://docs.gradle.org/current/userguide/installation.html#installation
Or doc
Once you’ve done that, you can basically open up the IntelliJ terminal and run gradle init
Let's move to the thread. #887580251432030228
I mean there aren’t really anything else going on rn
For the multi module too
But sure Ig
how to make a livingentity not drop items
cancel the drops in ondeath ? (if it is possible)
ok thanks
and anyway to spawn a livingentity naturaly ?
like how zombies spawn
give the entity spawn chance
that could not help cause im not using nms for the mob
?
and the thread did not explained
packets?
it kinda is
Cant teleport a player on first join
Anyone knows how to repeat a message every minute?
?scheduling
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Hey! short question:
I try to connect my Spigot plugin with a MySQL Database. For this purpose I have created the following class:
https://hastebin.com/qinejabexa.java
My config for this looks like this:
https://hastebin.com/juxirokuni.yaml
This is what my Main Class looks like:
https://hastebin.com/nulupijaha.java
Then when i start the plugin i get the following error:
https://hastebin.com/zowajuwipu.sql
where the most important places would be the following:
at de.straussfalke.straussfalkeserverplugin.MySQL.DataSourceProvider.testDataSource(DataSourceProvider.java:32) ~[?:?]
at de.straussfalke.straussfalkeserverplugin.MySQL.DataSourceProvider.initMySQLDataSource(DataSourceProvider.java:27) ~[?:?]
at de.straussfalke.straussfalkeserverplugin.Main.onEnable(Main.java:41) ~[?:?]```
These all lead to the line `try (Connection conn = dataSource.getConnection()) {`
Which can be found in the first link / class I sent in the `testDataSource` method.
Unfortunately, I don't know what I could have done wrong and therefore wanted to ask for help here.
You use static everywhere so you never initialize your Main instance in yoru DataSource
English
yes, call them via your dataSource instance not static
so wait...
I just need to make this unstatic?:
public static DataSource initMySQLDataSource() throws SQLException {
MysqlDataSource dataSource = new MysqlConnectionPoolDataSource();
dataSource.setServerName(Main.instance.getConfig().getString("host"));
dataSource.setPortNumber(Main.instance.getConfig().getInt("port"));
dataSource.setDatabaseName(Main.instance.getConfig().getString("database"));
dataSource.setUser(Main.instance.getConfig().getString("user"));
dataSource.setPassword(Main.instance.getConfig().getString("password"));
testDataSource(dataSource);
return dataSource;
}
private static void testDataSource(DataSource dataSource) throws SQLException {
try (Connection conn = dataSource.getConnection()) {
if(!conn.isValid(1000)) {
throw new SQLException("Database not connected");
}
}
}```
so I should remove private DataSource dataSource;.
and replace dataSource = DataSourceProvider.initMySQLDataSource(); from my try cathc block in the main method with your example?
I do that in my try catch block in my on enable method.
try{
dataSource = DataSourceProvider.initMySQLDataSource();
if(dataSource.getConnection() != null)
Bukkit.getLogger().info("MySQL Database connected!");
else {
getLogger().log(Level.SEVERE, "MySQL database connection is null");
return;
}
} catch(SQLException e) {
getLogger().log(Level.SEVERE, "Could not establish MySQL Database Connection ", e );
return;
}```
No you don't you never pass an instance of main to the constructor. You static access
Sorry, I don't quite understand what you mean.
You only ever access your DataSource via static methods. The class requires a reference to Main, which you never pass it as you never instance call the class.
You never call its constructor
ok and where and how can i do this right?
I told you. Remove all your static methods and instance your class in your main with dataSource = new DataSource(this);
ok so i made public static DataSource initMySQLDataSource() to public DataSource initMySQLDataSource()
and private static void testDataSource(DataSource dataSource) to private void testDataSource(DataSource dataSource)
and i edited my onEnable method so it looks like this:
@Override
public void onEnable() {
String s;
instance = this;
this.saveDefaultConfig();
dataSource = new DataSource(this);
try{
dataSource = DataSourceProvider.initMySQLDataSource();
if(dataSource.getConnection() != null)
Bukkit.getLogger().info("MySQL Database connected!");
else {
getLogger().log(Level.SEVERE, "MySQL database connection is null");
return;
}
} catch(SQLException e) {
getLogger().log(Level.SEVERE, "Could not establish MySQL Database Connection ", e );
return;
}
}```
DataSourceProvider?
if thats teh name you need to instance that. dataSource = new DataSourceProvider(this);
your init method doesn;t need to return anything
dataSource = new DataSourceProvider(this);
try {
dataSource.initMySQLDataSource();```
ok i have done that. but new DataSourceProvider(this) gives me an error in my IDE: expexted 0 arguments but found 1. then when I remove this it tells me that it needs a DataSource type and I have provided it with a DataSoruceProvider. I guess because I created the variable before with private DataSource dataSource;.
so should I then also change private DataSource dataSource; to private DataSourceProvider dataSource;?
in your main yes
okay
now the line if(dataSource.getConnection() != null) gives an error: cannot resolve 'getConnection' in 'DataSourceProvider'
Your DataSourceProvider is a wrapper, so you need to expose methods in that to access your database
you should not expose the database connection directly
also MysqlDataSource dataSource needs to be a field in the class as you are accessing it from other methods.
hey guys does anyone know what is this error ? Invalid entity rotation: NaN, discarding
i do not rotate any entity except a guardian laser from this resource: https://www.spigotmc.org/threads/laser-guardian-and-crystal-beams-1-9-1-17.348901/
it just means you cannot pass a NaN to the method
NaN = Not a Number
idk where you are getting it tho
I'm not sure but I think I get it when I disconnect my account during this code which is executed in a repeating task
for(Player p : WORLD.getPlayers()){
if(!lasers.containsKey(p.getUniqueId()) /*&& p.getGameMode() == GameMode.SURVIVAL*/){
createBeam(p, WORLD, lasers);
}
try {
if(p.isOnline())
lasers.get(p.getUniqueId()).moveEnd(p.getLocation());
else
lasers.get(p.getUniqueId()).stop();
} catch (ReflectiveOperationException e) {
e.printStackTrace();
}
}```
what is the whole error- is there a stack trace?
well I get nothing else that a huge spam of Invalid entity rotation: NaN, discarding even when I have no more laser beam
I thought it was because I was disconnected so I added the isOnline check
hmm doubt
but it didn't fix it
That online check is pointless
yup I sure about that now
the world.getPlayers already does it
you also know that when no one is online the for loop will never enter so you can;t stop any lasers
ok I'm gonna edit this to loop through the hashmap keys
You'd probably be better looping your lasers rather than players
ok so now i created a MySQLDataSource Variable in my main. but what should my getConnection method look like?
Not in main, in your DataSourceProvider
there i already have this Variable
You need it as a Field not a variable
how should that looks like?
a variable is inside a method. A Field is a class level variable.
you have it as a variable in a method at the moment. It needs to be a Field
does i understand that right that i just should put the Variable outside of the Method?
ok
so
here is my new code: https://hastebin.com/pezoyirune.kotlin
it works
but
the the problem was not what I expected
the error occurs when I have a laser beam running and I call this code
Random r = new Random();
int max = r.nextInt(10 - 5) + 5;
count = 0;
fireballTask = new BukkitRunnable(){
@Override
public void run(){
if(count >= max)
cancel();
for(int i = 0; i < GameSettings.FIREBALLS_COUNT; i++){
int x = r.nextInt(50 + 50) + -50;
int z = r.nextInt(50 + 50) + -50;
Location loc = new Location(WORLD, x, 90, z);
Fireball ball = loc.getWorld().spawn(loc, Fireball.class);
ball.setIsIncendiary(false);
ball.setDirection(WORLD.getHighestBlockAt(x, z).getLocation().toVector().subtract(loc.toVector()).normalize().multiply(2f));
}
++count;
}
}.runTaskTimer(RushToTheBeacon.getInstance(), 0, 15);```
ok and then i have created a getConnection method which looks like this:
public DataSource getConnection() {
try {
dataSource.getConnection();
} catch (SQLException throwables) {
throwables.printStackTrace();
}
}```
so there is missing a return statement and im not sure what i should return there
Hello , does i can check if "beacon" word is exist in config file?
i have tried to use getStringList().contains
but not works for me
example
you return dataSource.getConnection(); or null
Location:
spawn: x, y, z
pvp: x,y,z```
so i want to check if pvp is exist
okay @eternal oxide
that is not a list its a map
file.getString("Location.pvp") != null?
@tardy delta not works
bcz
Location.pvp is not exist
i just want to check
if it's exist or not
doesnt it return null when not exist?
oh :/
u can prob add a !
Hi I want write a double xp plugin
But my plugin doesn't trigger PlayerExpChangeEvent(Console don't have "test: (Amout)" Who can teach or help me answer the question
@EventHandler
public void expchange(PlayerExpChangeEvent event) {
Player player = event.getPlayer();
int getexp = event.getAmount();
int int_val = Integer.parseInt(getConfig().getString("default.expdouble"));
int TotalAmout = (getexp * int_val);
player.setExp(TotalAmout);
Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + "test: " + int_val);
}
me?
yes
public class Main extends JavaPlugin implements Listener {
no in ur onEnable
try {
if (LocationManager.Config.getString("Spawns.pvp") != null) {
// code
}
} catch (NullPointerException nullPointerException) {
nullPointerException.printStackTrace();
}```
like this ? @quasi flint @tardy delta
FileConfiguration#contains(String)?
public void onEnable() {
Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=");
Bukkit.getConsoleSender().sendMessage(ChatColor.GREEN + "DoubleExpPlugin" + ChatColor.BLUE + "Enabled");
Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "Author: Dainner#2085" + ChatColor.WHITE + " | "
+ ChatColor.RED + "Version." + getDescription().getVersion());
Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=");
this.saveDefaultConfig();
this.getServer().getPluginManager().registerEvents(this, this);
}
this?
dont catch npr
i tried that , not works
heh
do smth when it hullpoints
interresting. should work
u @override the method
remove this.
only getServer.blablabla
work with \n
getServer.getPluginManager().registerEvents(this, this);
this?
no it just look error
getServer cannot be resolved
getServer()
Oh
oh i did not notice that
why this method is deprecated
why things like potioneffettype or entitytype getbyname method is not
whats jt saying?
But same no't trigger
@quaint mantle Its an old method
is there any other way for it ?
new one is getByKey
and how to get it with a namespacedkey ?
Enchantment.getByKey(NamespacedKey key);
1. public void expchange(PlayerExpChangeEvent event) {
2. Player player = event.getPlayer();
3. int getexp = event.getAmount();
4. int int_val = Integer.parseInt(getConfig().getString("default.expdouble"));
5. int TotalAmout = (getexp * int_val);
6. player.setExp(TotalAmout);
7. Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + "test: " + int_val);
8. }
line 7 edit to line 2
line 2 edit to line 7
Console have send( "test: " + int_val) But now no't send ("test: " + int_val)
Is there a way to load dependency in-runtime with 'libraries' section, while dependency isn't in maven central? Specifing repository or something.
Enchantment.getByKey(NamespacedKey.minecraft(name));
}
dont think so
not sure tho
new NamespacedKey(instance, "enchant") ?
like this ?
oh
wait
Emm...
multi taskin as hell rn
all code?
command not registered
and maybe first register everything
then send messages
i dont see nothing erong
name: DoubleExpPlugin
main: co2.rto.DoubleExpPlugin.Main
version: 1.0
author: COVID19
commands:
dexp:
usage: /dexp [reload]
i have register command
no u did not
!?
look at my link
what could be null here should i ignore it ?
there it explains now
his hand could be null
prob ignore it
or maybe try catch
i dunno
ok thx
i would ignore it
Emm i just write all in Main
You didn't register a command in onEnable()
But it can use
this project is All code in one file
You still need to register the command
Error。
iirc you have to to use this
just saying, you should really at least learn basics like importing
no..
this is already referring to the plugin
you cant set the command executor to the same plugin
you have to define a new instance of the command executing class
he just isnt importing it
or the class name is wrong
Mhh idk, i never put all code in one file. :^)
I never put the code in more than two files :^)
because my plugin all just have reload command
no't other command
classes begin with Capital letter
@EventHandler
public void expchange(PlayerExpChangeEvent event) {
Player player = event.getPlayer();
int getexp = event.getAmount();
int int_val = Integer.parseInt(getConfig().getString("default.expdouble"));
int TotalAmout = (getexp * int_val);
player.setExp(TotalAmout);
}
this ( player.setExp(TotalAmout); ) no't trigger but... why?
german geo io hitting different
learning german verbs rn 😢
Hallo Freund
well morning is the first step
but german is hard af
how long u learned it for now?
uhh 2 years in school
i see
https://paste.md-5.net/uwesapuduv.cs
test over。
still dont get the A2 on my level test 😳
it worked so whats wrong?
ouch
just no't trigger "f" ( no trigger player.setExp )
or maybe just
but i dont know for certain
doesnt matter calling an int where it expects a double
rounding be gone tho
is float
then di what u have to do
but same no't trigger xD
no't
🍞
@EventHandler
public void ExpChange(PlayerExpChangeEvent event) {
Player player = event.getPlayer();
int getexp = event.getAmount();
int int_val = Integer.parseInt(getConfig().getString("default.expdouble"));
int TotalAmout = (getexp * int_val);
float d=(float) TotalAmout;
player.setExp(d); <<this no't trigger
}
making three ints and a float inside a method 🤔
@EventHandler
public void onExpChange(PlayerExpChangeEvent event) {
Player player = event.getPlayer();
player.setExp(event.getAmount() * Double.parseDouble(getConfig().getString("default.expdouble")))
}
?
player.setExp(event.getAmount() * Integer.parseInt(getConfig().getString("default.expdouble"))); <<< this doesn't trigger
😦
doesn't
set the amount to a very high and check if it works
default:
expdouble: "10.0"
Emmm my check is
@EventHandler
public void onExpChange(PlayerExpChangeEvent event) {
Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + "a");
Player player = event.getPlayer();
Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + "b");
player.setExp(event.getAmount() * Integer.parseInt(getConfig().getString("default.expdouble")));
Bukkit.getConsoleSender().sendMessage(ChatColor.DARK_GRAY + "c");
}
www (Console doesn't send "c")
There is a getInt for config you know
you can't getInt on a double
and I'm pretty sure you're coming into floor(num) issues when casting to int
i very sure is
player.setExp(event.getAmount() * Integer.parseInt(getConfig().getString("default.expdouble")));
dosen't trigger
that line is probably throwing an exception so C never prints
But i don't know what's is the problem
show your config that has the default.expdouble
default:
expdouble: "10.0"
why are you using a string/double?
The method setExp(float) in the type Player is not applicable for the arguments (double)
then do Float.parseFloat
that says what u have to do
i dont see a point of actually using float
maybe you should use double if you wanted to lol
for precision
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Emm what is getAmout() 's return? int? double? float?
?_?
if u hover over it in your IDE, it will tell u what it returns if you read
if you can't read, rip
learn to read
Anyone managed to have different textures to same armor in 1.12.2 or lower?
I tried durablity but minecraft forces the normal texture when equipping so im really curious if there is a solution for this in version under 1.14
weewoo
a server I used to dev for made use of NBT tags and optifine, idk any other solution
you can set nbt tags with a name, and optifine / mods can read the nbt tags on an item and apply different textures to them
Hello so i'm asking for does i can make a cooldown
but when the server restarts it's saving the cooldown with out reset it
hmm is it just me or does it seem in 1.17(+) the world chunk(s) don't seem to want to unload at all.
the timestamps part gives you a base
https://www.spigotmc.org/wiki/feature-command-cooldowns/
but it needs some changes
@ancient plank doesnt everyone need to have optifine then?
Yeee thanks, you cant force palyers to auto download optifine like you can force them to download a texture pack if they allow it?
na you can't force them
its one of those things where you have to coerce them like "If you download optifine with our resource pack you can see these awesome textures"
ye true i guess
What would be the best way to register multiple listener classes?
Normally I would do:
Bukkit.getPluginManager().registerEvents(new Class_Name(), this);
But is there a better method to do that for bigger core plugins? For example if I have 30 classes that implements listener can I somehow loop trough all of them and register them? The code looks pretty bad with one big chunky method that has 30 rows of the example code.
sad only that there is no real solution. but ye that sounds good cuz ill just have decent textures for those who dont use optifine
PluginManager pm = Bukkit.getPluginManager();
pm.registerEvents(new Listener, this);
...
or put them into an array and loop over them idk
Yeah but I dont want to have 30 rows of
pm.registerEvents(new Listener, this);
you could use reflection
^^
Any example?
that is some advance stuff man, might want to learn refection before you start playing with it, you can do so bad damage with it
Thanks
that works lol
Hey anyone know why when I save my bungee config it completely removes comments and reformats it ?
with spigot it keeps it the same when you save it
Anyone know what is up with chunks and not wanting to unload in 1.17(+)
any way a custom entity can drop an item while its still alive
ok. i have done that... but the same error still comes
Just spawn an item at it's location
may i ask whats the method
World#dropItem or World#dropItemNaturally, depending on if you want the item to have a velocity or not.
how could i detect when a method is being called? using reflection
thanks <3
what same error?
Am I reading that right? Are you trying to connect to the address "connect"...?
MySQL:
host: localhost
port: 3306
database: straussfalkeplugins
user: Server
password: <password>```
you are setting all your dataSource values to null
getString("host") will return null as its "MySQL.host"
oh yeah sure. i will fix that
okay the error is gone but now comes [StraussfalkeServerPlugin] MySQL database connection is null What was created by the user and should come exactly when the database connection corresponds to zero.
Hey, is there something like Location.distance() but it ignores Y coordinate?
Just manipulate y?
try{
dataSource.initMySQLDataSource();
if(dataSource.getConnection() != null)
Bukkit.getLogger().info("MySQL Database connected!");
else {
getLogger().log(Level.SEVERE, "MySQL database connection is null");
return;
}
} catch(SQLException e) {
getLogger().log(Level.SEVERE, "Could not establish MySQL Database Connection ", e );
return;
}
is the corresponding code
You can set one’s y to the other’s y value
You can always calculate the distance yourself or set the location y so they match
Why did that take 20 seconds to send
Discord u good
are you returning the correct type from getConnection() ?
it should be returning a Connection, not a DataSource
I had now specified null as the return type, since you said earlier that I can return either dataSource.getConnection or null.
public DataSource getConnection() {
try {
dataSource.getConnection();
} catch (SQLException throwables) {
throwables.printStackTrace();
}
return null;
}
thats the Method
no you return the result of getConnection, or null
return dataSource.getConnection();
ok
saddest moments in Java
now it looks like that:
public DataSource getConnection() throws SQLException {
try {
dataSource.getConnection();
} catch (SQLException throwables) {
throwables.printStackTrace();
}
return (DataSource) dataSource.getConnection();
}
}```
remove the cast and make the method return a Connection
It was a suggestion from the IDE so I thought it would be useful.
weird
you are returning a Connection not a DataSource
yes i changed it
your IDE is too dumb to tell whats wrong
yeah the Database now has connected
Hello. I want to store an area of blocks so I made a wrapper class to serialize BlockState Objects. The problem is that it obviously doesn't save the content of a chest or of a sign. How can I store those values as well?
Thank you so much for your help and sorry for the trouble I have caused
Your code but cleaned up a little https://paste.md-5.net/usudobasup.java
Is there a general type storing such values or do I need to check for those specific Blocks and then get the data manually?
BlockState I think is what you want.
Okay but how can I serialize that and how would I set any Block into that specific BlockState?
https://github.com/ElgarL/Regen one I wrote a while ago to regen explosions
How can I add the arrayList where I wanna put players in later in the Elements in line 3,4,5 and 6?
https://gist.github.com/ItzJustNico/8fe9d06a3548f58fd7d2aeaa68f0e176
ok so i tried this but i get this error
https://hastebin.com/hobuzayoye.apache
?paste
i'm looking for a way to write this shorter but i dont get it
https://paste.md-5.net/datobofahu.cs
Cool thanks, looks pretty complicated
?paste your main class
There are a few blocks that misbehave but generally its fairly simple
Yea, I was hoping I could just save some other values and it would work but thats obv not the case
You can save the nbt of the tile data
dataSource = new DataSourceProvider();
needs to be dataSource = new DataSourceProvider(this);
How does that work?
would be really nice if anyone could help me pls
i tried that. But then the IDE says Expected 0 arguments but found 1
then your DataSourceProvider is wrong. Its constructor shoudl be public DataSourceProvider(JavaPlugin plugin) {
At the end
after .build()
yeah I know but how exactly I dont get it to work somehow pls give me an Example
You could do it with Arrays.asList(...)
I also just noticed that this line also doesn't throw an error when I remove the method from my DataSourceProvider class
public static String f(String s) {
return ChatColor.translateAlternateColorCodes('&', "{prefix}" + s);
}
yo fellas so basically i have this util to format my messages but want it to add with prefix, i've tried replacing the prefix using ``plugin.getConfig().toString("Prefix")` but returns null in console afterwards. any suggestions? 🤔
sorry if this seems obvious
ayo can someone tell me on how to declare a world. im asking cause im tired asf and not functioning
and what do I put in the brackets?
all the Elements you want in the list
why is this redundant? i just check if the player already executed that command and increase the teller if thats true
if (uses.get(uuid) < 2) uses.put(uuid, uses.get(uuid) + 1);
You're not doing anything in it
well i check if its smaller than 2 and then teleport them
Oh wait nvm
But I want arrayLists for each element so I can put players in each of them, not putting elements in Lists
I read it wrong
oh
Then do new ArrayList<UUID>();
or <Player> depending on what you want to store
oh yes thank you alot
np
and what does inlining mean?
For all those people who find it more convenient to bother you with their question rather than to Google it for themselves.
You don't need to assign getLocation(p, name) to a variable since you only use it once.
Just put getLocation(p, name) where you use loc.
Dont you also just serialize the BlockData?
but if its null i want to return
remove the void from your public void? is that what you want?
?
is there a class you want to return?
just return in a void smh
what do need help with? 🤔
I got a packet listener and stuff and got this
PacketPlayInPosition posPacket = (PacketPlayInPosition) packet;
Bukkit.broadcastMessage("x: " + posPacket.a);
Bukkit.broadcastMessage("y: " + posPacket.b);
Bukkit.broadcastMessage("z: " + posPacket.c);
Bukkit.broadcastMessage("possible ground boolean: " + posPacket.g);
Bukkit.broadcastMessage("possible ground boolean2: " + posPacket.h);
x y and z are correct and stuff but there are 2 booleans which are g and h. I was expecting one of them to be the onGround boolean and yet 1 is a constant true and the second is a constant false. Any way I can get the onGround value from the packet?
(seconds / 60) + ":" + (seconds % 60)
if its just a standard block, yes
But I think there is actually a better way, not sure atm
quite possibly
@tardy delta https://paste.md-5.net/nukofufode.cs that's how I would do it. I didn't really check your time messages. I don't really know why you're converting it to days, but I assume you have your reasons? 
Yes and where do you store the other stuff?
other stuff?
Like the text of a sign, content of a commandblock or chest, etc...
These are extensions for special blocks. Look at teh serialize method https://github.com/ElgarL/Regen/tree/master/src/com/palmergames/spigot/regen/serialize/extensions
Ah okay, thanks.
Hi!
How can i define a world?
https://paste.md-5.net/oboxiloliq.cs
ow thanks you it looks much better than the if elses
@eternal oxide I have another question regarding MySQL. How should I create my methods to insert something into my table?
How to place a player in a worldguard group? I need this for a different number of private players. I'm sorry for the question.
Just one last question: do I need to register the arrayList somehow?
okay thank you
create a utility class with prepared statement constructors or Builders.
do you have an example?
no
But these are not all?
Because command block for example isnt there
I never tested on a command block
that is a pity
mainly because a command block should not be anywhere near TNT
Yea
I didn;t think about it honestly
Can't I just get all the NBT data or something and store that?
No clue, I only use the API
I had already found an example:
public boolean someMethod(Object obj1, Object obj2) {
try (Connection conn = conn(); PreparedStatement stmt = conn.prepareStatement(
"INSERT INTO player_coins(uuid, coins) VALUES(?, ?);"
)) {
stmt.setSomething(1, obj1);
stmt.setSomething(2, obj2);
stmt.execute();
return true;
} catch (SQLException e) {
logSQLError("Something went wrong.", e);
}
return false;
}```
but I don't know what the conn() method should look like in that case
thats a connection you get from your provider
like this?:
public Connection getConnection() {
try {
return dataSource.getConnection();
} catch (SQLException throwables) {
throwables.printStackTrace();
}
return null;
}```
Couldn't you technically use reflection to get all the values and serialize those?
Not sure how it would know what to save and what not to save, but it would atleast be able to be generalized over all the special block cases
True. I assume most the stuff you'd want excluded is in the main BlockState class anyways. All the stuff within the subclasses are probably pretty important 

worldguard hates me, i've set some neccesary flags up and when i leave a horse worldguard says that i may not leave because i cant re enter, i overrid that event so you can leave them but now i cant enter horser :/
and worlguard thinks i'm still on that horse while i'm not
is there a way to keep a creeper from despawning when it explodes?
I'd just spawn an explosion
totally related question: can I spawn an entity into the world which I made before? aka spawn the creeper into the world after it disappears
event priority highest is executed the last right?
^
It is
but monitor cant cancel the event?
that
Don't cancel in Monitor
Altho plugins like LuckPerms do it
smh
i want to decide as last whether or not to cancel the event
to override worldguard smh
like this?:
public Connection getConnection() {
try {
return dataSource.getConnection();
} catch (SQLException throwables) {
throwables.printStackTrace();
}
return null;
}```
Or well, they disallow login at monitor state so idk it’s exactly the same thing but yeah
I'm sure they have somewhat good reasoning behind doing it that way.
Idk
Some of the design in luckperms is questionable, not because I write the most godly code myself

But they pass the plugin instance in so many classes
Ah, instead of doing Singleton?
but which priority is executed last now?
No dessie

if I do this, will the UUID of creeper be the same as the UUID of creeperNew?
Thing is,they should pass their higher level components like their data managers and such instead of passing the plugin instance and then invoking blah.getDataManager()
imo
Ahhh okay I'm with you now
If you do this, then creeperNew will be the same object as creeper
perfect
Which is useless
because if you change something in "creeperNew" it will also be changed in "creeper" and visa versa because they are the same objects
Bump
Anyone knows how to get and set the NBT (?) data of a block?
every time when a command is called, does that makes a new command instance?
No, it just exectues "onCommand" of the registered "CommandExecutor" instance
why cant i combine Item item = item blah blah blah with Bukkit.getScheduler
? pls provide some code
Because it had to be final or non edited
Bukkit.getScheduler().runTaskLater(SMPCore.getInstance(), () -> Item dropped1 = e.getDamager().getWorld().dropItem(e.getDamager().getLocation(), new ItemStack(Material.BOOK, 1)), 255);
oops
```language
code
```
Lambdas don't return variables
Because you define "Item" inside of the Runnable which is a void method so you lose access to that variable after that
L
Thats like if you would try to do that:
void hi() {
Item a = ...;
}
void anotherHi() {
System.out.println(a); // <- doesnt work because its not visible here
}
ahhh
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
🤨
thats what i meant
Bruh
ItemStack item;
Bukkit.getScheduler().runTaskLater(Plugin, () -> {item = <your item>}, 0, 20);
You need to declare the variable before your Runnable
wait
yea like that, except that you need to set "ItemStack" final
ofc
how tho?
item.dropItem(new ItemStack(Material.MATERIAL)) ?
and also location and shiz ofc
but in general like that right?
Just like that in your case: e.getDamager().getWorld().dropItem(e.getDamager().getLocation(), new ItemStack(Material.BOOK, 1))
yeah but what if i want to set the velocity
just do
() -> {
}
```and you have infinite lines
Why do custom fonts look stupid when your screen is full screened in minecraft
Thats the general usage of a lambda expressions. Its just a short variant of creating a new instance of an interface with 1 method.
interface MyInterface {
T method(A a, B b, C c, ...);
}
// First (standard) variant:
MyInterface k = new MyInterface() {
@Override
T method(A a, B b, C c, ...) {
// do your stuff here
}
};
// Second (lambda) variant:
MyInterface l = (a, b, c, ...) -> {
// do your stuff here
};
And since Runnable's method "run" doesnt have any arguments, you leave it empty like that () -> {
It actually does, you just don't use it often
No?
Bukkit.getScheduler().runTaskTimerAsynchronously(this, (task) -> {
task.cancel();
}, 10, 10);
Then that is not a java.lang.Runnable
short question: I have connected my plugin to a MySQL database and have the following class for it: https://paste.md-5.net/novulovevu.java
now I would also like to insert data into my tables and ask how exactly I can do that? (I have already dealt with MySQL - I am only interested in the JDBC part). can anyone help me with this?
Ah, though we were talking about the bukkit runnables
Hey, there seems to be a problem with creating stonecutter GUIs. Adding items to them via spigot seems to have no effect whatsoever. I've found this two-year-old issue on the forums which still seems relevant https://www.spigotmc.org/threads/unable-to-set-itemstack-in-stonecutter-inventory.389400/.
The code I'm using:
Inventory inventory = Bukkit.createInventory(player, InventoryType.STONECUTTER);
inventory.setItem(0, new ItemStack(Material.STONE));
player.openInventory(inventory);
The result
Switching out the inventorytype to chest, shulker et al. works fine, but the stonecutter is problematic
Calling Player::updateInventory after a tick or so does not work either
- Try first opening then setting the ItemStack
- Try updating the players view
Adding the itemstack afterwards gives the same result. Inventory::getContents shows the itemstack regardless if I add it before or after showing it
Also:
StonecutterInventory cutterInv = (StonecutterInventory) inventory;
cutterInv.setInputItem(item);
I'll try that
setInputItem does not seem to be a method of the StonecutterInventory class. Running ```java
StonecutterInventory inventory = (StonecutterInventory) Bukkit.createInventory(player, InventoryType.STONECUTTER);
inventory.setItem(0, new ItemStack(Material.COAL));
player.openInventory(inventory);
gives `java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventoryCustom cannot be cast to class org.bukkit.inventory.StonecutterInventory (org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventoryCustom and org.bukkit.inventory.StonecutterInventory are in unnamed module of loader 'app')`
Thats weird...
can I cancel the EntityTargetEvent without it costing too many resources?
CraftInventoryStonecutter inventory = (CraftInventoryStonecutter) Bukkit.createInventory(player, InventoryType.STONECUTTER);
inventory.setItem(0, new ItemStack(Material.COAL));
player.openInventory(inventory);
Gives java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventoryCustom cannot be cast to class org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventoryStonecutter (org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventoryCustom and org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventoryStonecutter are in unnamed module of loader 'app'), which to me is even stranger
Try this workaround.
private final Map<HumanEntity, Consumer<StonecutterInventory>> cutterPrepMap = new HashMap<>();
public void openStoneCutterFor(final Player player, final Consumer<StonecutterInventory> prepConsumer) {
final Inventory inventory = Bukkit.createInventory(null, InventoryType.STONECUTTER);
this.cutterPrepMap.put(player, prepConsumer);
player.openInventory(inventory);
}
@EventHandler
public void onOpen(final InventoryOpenEvent event) {
final Consumer<StonecutterInventory> consumer = this.cutterPrepMap.remove(event.getPlayer());
if (consumer != null) {
consumer.accept((StonecutterInventory) event.getInventory());
}
}
...
openStoneCutterFor(player, cutterInv -> cutterInv.setInputItem(item));
It all depends on how you implement it.
I want the enderman not to target the mite and the other way around
getTarget().getType() vs getEntityType() ;p
Sadly, this doesn't do the trick either
Still getting an empty stonecutter
Do you get the same cast exception?
Show your code pls
that is the type of the entity that is targetting...
No I know I was clarifying to smile's question there
I specifically want the targetted type tho
Add a sysout to the consumer and check if it actually ran
You can have a little performance enhancement by returning after the first event.setCancelled()
cats can have a little salami.
programmers can have a little performance enhancement
😄 good tip. will do
Aha! The event handler fires, but the consumer does not
who is best to use, reflection or interface ?
For what?
for nms classes
I go with both
:
I use some sort of abstraction, but if I have no concrete implementation for the interface I fallback to some good old nms
Interfaces perform better.
If you know how to properly cache your reflections then they get also really performant with enough time on the JIT
I am worried about not finding the setInputItem method
Yeah well sadly Java 8 doesn’t have all those reflection optimizations I believe newer versions have in case you’re a legacy fan
sure
What version are you on?
Ah sry its not a spigot method
Is it setItem(int, ItemStack)?
That's what I see
setInputItem seems stonecutter-specific
Which in turn may run some stonecutter-specific update logic
Hm, I don't know why they would've removed that method... I assume setItem(0, ItemStack) would effectively just be the same thing.
I would as well. I'm going to try capturing some packets to see if a specific slot is being used
I mean I know Input is 0 and Result is 1 if that's what you're wondering.
There's static variables for them if you prefer to use those instead of 0 and 1
ah StonecutterMenu.INPUT_SLOT
Yes
I'll use that, a nice alias :)
So SmithingRecipes doesn't preserve the meta of the output, and if I use PrepareSmithingEvent#setResult I can't take the item out...
I solved it using NMS
StonecutterMenu stonecutterMenu = new StonecutterMenu(1, ((CraftPlayer) player).getHandle().getInventory());
stonecutterMenu.setTitle(new TextComponent("something"));
stonecutterMenu.setItem(StonecutterMenu.INPUT_SLOT, 0,CraftItemStack.asNMSCopy(new ItemStack(Material.COAL)));
player.openInventory(stonecutterMenu.getBukkitView());
For anyone interested
I don't understand why I can't remove this item
Try setting it in the InventoryClickEvent
i have a question
if i changed integer value every 1 seconds using runnables
that will give low tps and high cpu usage or will it not affect?
every one second is not that much
it would have a negligible effect on the server
And if the task is as easy as you said it is, just simply setting an int var it would be such a fast operation
i wanna try to make cooldown using runnables and config that why i asked
so the integer will change for so many players
i wan't to make a cooldown using config because if i want to save secondsleft
if there another way to save integer value when server restart can someone tell me about it?
You could attach it to the players pdc I guess
what is that xd
?pdc
You should not actively count down cooldowns.
Use a timestamp instead and calculate the time delta when the action is called again.
good idea. so i just need to save the timestamp in config file and then check if the cooldown has expired right?
yes
The problem with that is time continues when the server is offline
You could save the time left, and then recalculate the timestamp when it starts again
You mean the benefit
😄
Depends if you want that I guess
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");
Main.getInstance().getConfig().set("Player.time", format.format(date));
if (date > Main.getInstance().getConfig().get("Player.time")) {
//code
}```
it's should be like this?
but how to check if the new date bigger than old date with 1hours?
and i have a error here xD if (date > Main.getInstance().getConfig().get("Player.time")) {
@lost matrix if you are not busy, can you help please?
dates are not compared using the > operator
the > is for numeric primitive types
e.g. int,double
mm so how to check if new date bigger than old date with 1hour ? @eternal night
there is Date#before and Date#after
final Date dateOneHourInTheFuture = new Date(System.currentTimeMillis() + TimeUnit.HOURS.toMillis(1));
this will be saved if server has been restarted ? @eternal night
what ?
no
pretty much on you how you are saving things
this just creates a date object that points to a time on hour in the future from when your code executed that created it
anyone familiar with how entities work on chunk load? I'm trying to prevent the pickup of certain items. when a player logs in, they have items in their inventory from the ground, but the code prevents pickup on items that weren't close enough to get picked up initially.
More info: https://www.spigotmc.org/threads/deleting-entities-before-a-player-can-pick-it-up.525979/
So i'm used protocollib, I got this up and running and returning the correct value
player.sendMessage(PlaceholderAPI.setPlaceholders(player, "%PvpToggle_status%"));
What do I need to do for other plugins to be able to use this?
https://www.spigotmc.org/threads/how-to-make-a-placeholder-with-placeholderapi.91004/ this might help
ty
Why not set the pickup delay on the items
Let the game handle it
I tried using the delay, but then it never runs the pickup event to delete the entities
Delete them on shutdown?
the issue comes from items being dropped for an effect, and then the server closing before the timer from that effect deletes them
wouldn't help with crashes tho no?
atm I'm using item lore, which also helps me keep them from stacking with eachother, but it's not loading that before the pickup happens
I might do the pickup delay and delete on close. if they aren't deleted on server stop, they'll never be able to get picked up and someone will just need to burn them
Like I said, pdc
would that work when the lore doesnt?
I figure all the data would get loaded at once
oh hmm, I'll try that out then. thanks! 😄
Hey Quick question: I would like to be able to insert values into the database via my database connection and have already created the following:
private DataSourceProvider dataSource;
public Connection conn() {
dataSource = new DataSourceProvider(Main.getPlugin());
return dataSource;
}
public boolean addPlayer(UUID uuid, String playername, int coins) {
try (Connection conn = conn(); PreparedStatement stmt = conn.prepareStatement("INSERT INTO playerdata (UUID, playername, coins) VALUES (?,?),")) {
} catch (SQLException throwables) {
throwables.printStackTrace();
}
}
However, return dataSource; returns an error because a connection is expected there.
I don't know what I have to change. Can anyone help me to correct this?
btw I have a related class that might be important: https://paste.md-5.net/novulovevu.java
[NMS] How to register a custom entity 1.17.1 ?
OK i have done that
now I have the problem that I cannot call the method where I need it (in which case it is in a different class) even though the method is public
Do you have an instance of the class
No
got qustion is it possible to prevent specific method to run two times
new BukkitRunnable() {
@Override
public void run() {
try {
if (!getMysql().isConnected()) {
getMysql().connect();
}
PreparedStatement statement = getMysql().prepareStatement("SELECT time FROM Vyplata WHERE uuid=?");
statement.setString(1, uuid.toString());
ResultSet result = getMysql().query(statement);
if (!result.next()) {
statement = getMysql().prepareStatement("INSERT INTO Vyplata (UUID,time) VALUES(?,?) ON DUPLICATE KEY UPDATE UUID=?");
statement.setString(1, uuid.toString());
statement.setDouble(2, 0);
statement.setString(3, uuid.toString());
getMysql().update(statement);
setData(uuid,0);
statement.close();
result.close();
return;
}
setData(uuid,result.getInt("time"));
} catch (SQLException e) {
e.printStackTrace();
}
}
}.runTaskLaterAsynchronously(this,20);
}```
my load data method for player
but it could be runned again for example from place holder
asking for player data and running method again to load data but there could be one instance already in action
could I use here some how sync
or maybe I could made hashset like loading list
and put player uuid on start
in
and when finished remove it out
or on exception
is there a reason why the PlayerCommandPreprocessEvent aint functioning ? its still doing the normal help
also check event sout isnt called
First use the plugins logger
as system out doens't really work (Idk why I Just know not to use it)
System out works fine?
weird since the sout on join works ( testing if events where working)
Are you sure that your JAR is being updated @quaint mantle? That's really the only reason I can think that wouldn't be called at all.
I have a Set of what are essentially chunks in a square and I want to get them into a WorldEdit region and copied with a ForwardExtentCopy
ForwardExtentCopy forwardExtentCopy = new ForwardExtentCopy(
editSession, region, clipboard, region.getMinimumPoint()
);```
My thought process is to get the corner chunks of the Set. But I need to get the min/max coords of a chunk. Anyone know of a way to do that?
Please don't spoonfeed me, but a nudge in the right direction would be appreciated.
find smallest chunk coordinates & biggest chunk coords
since its a square to get the min pos its just smallest chunk XYZ coordX * 16, 0, coordZ * 16
and for the max XYZ u do it with the max chunk but add 15 to the X and Z
smallest needed (-287,0,64)
{
"w": "world",
"cx": -18,
"cz": 4
}
X (-18 * 16) + 1 = -287
Z (4 * 16) = 64
largest needed (-240,4,255)
{
"w": "world",
"cx": -16,
"cz": 6
}
X (-16 * 16) - 16 = 240
Z 6 * 16 + 15 = 111
These are my calculations, this isn't completely adding up
https://i.imgur.com/QQh0rJr.png where smallest is blue and largest is red
umm why would you think largest needed is (-240,4,255) ?
that coordinate lies in chunk -15,15 @dense shoal
I forgot how coordinates worked. Lemme work this out and try again.
I think the X,Z you showed are correct
but im not sure why you are adding 1 to the X
and subtracting 16 for the X with largest chunk coord
OK, so math aside, I'm doing this
16 * CHUNK + 15 for the larger number chunk
16 * CHUNK for the smaller chunk
Where chunk is the chunk coords
I'm creating a custom crafting plugin with a custom inventory, but I need to check when an item is added to the crafting menu. What Inventory event triggers when an item is moved into an inventory, not clicked?
InventoryDragEvent
or something like thattt
declaration: package: org.bukkit.event.inventory, class: InventoryDragEvent
I already tried that
appearently not correctly
that calls when the item is clicked not when it is placed
what does that even mean
just scan for this https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/inventory/InventoryEvent.html
declaration: package: org.bukkit.event.inventory, class: InventoryEvent
and run whatever check ur looking for
and broadcast what event it was
It calls when you pick the item out of your inventory, but not when you place it in the crafting inventory
its just 4 lines of code
@EventHandler
public void inventoryEvent(InventoryEvent e){
Bukkit.getServer().broadcastMessage(e.getEventName());
}
then the event isnt handled by Spigot
because thats literally an InventoryEvent
so if it was, it'd had done something
Deos your class implement Listener and is your event registered onEnable
ya, every thing works, except it doesnt update the recipe output when an item is taken out of the inventory or moved into it
What are you trying to do
i think i got it.
nevermind don't got it
I want to run the function checkRecipeCompleted() when an item is moved into the inventory or out
Got it, i just had to schdule it a tick later, so i could get where it moved to
explain to me how this is a development issue @sweet cradle
How can I make a config.yml file for my plugin?
by learning how to make spigot plugins
Or learn to google
For all those people who find it more convenient to bother you with their question rather than to Google it for themselves.
public void onEnable() {
if(getConfig().getKeys(false).isEmpty())
saveDefaultConfig();
reloadConfig();
getLogger().info(getConfig.getString("Path"));
}
No just
public void onEnable() {
saveDefaultConfig();
reloadConfig();
getLogger().info(getConfig.getString("Path"));
}
Does saveDefaultConfig() check the data now?
Does org.bukkit.conversations.Conversation#begin() block until the conversation is over?
inventory events can be tricky
as far as i know yeah you can do custom crafting and recipes
maybe its worthwhile on crafting events to listen to the itemstacks in the craft inventory
im fairly certain thats how it works (if thats what your goal is)
better than doing a scheduler imo ^
is there a way to get players to see skins without an issue on first join?
if you open minecraft, join the server all skins are default steve, but when moving away and back again sending the packets again when in range the skins show. Then if i disconnect again and connect (without closing mc) the skins load to the player perfectly using the same packets? i've tried with a delay on login, i've tried showing and hiding then showing again after 60 ticks nothing seems to work.
Hey how can i make the customly dropped item unpickable up
cancel the pickup event
Doesnt it cancel all books?
Make the item a meta?
You don't need to cancel pickup events
That's a waste of processor time
20 times per second per player nearby
Just set the pickup delay to int max
Its ror a friend showcase anyways
Ah ok
Ok thanks!
👍
hmm i didn’t think of that
what’s a chonk lol
You know when you drop multiple of the same items
oh
It looks like 1 item
the stacking?
uh i mean idrk on this one
there is probably an event but there may also be another way
It's not super simple to do
If players drop a stack of an item you will have to manually sort them out into individual items
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(new Random().nextInt(Integer.MAX_VALUE) + "");
meta.setLore(Arrays.asList("COIN_ITEM", new Random().nextInt(Integer.MAX_VALUE) + ""));
item.setItemMeta(meta);
return item;
}```
having a different display name or lore for the item will make it not go into one item
To prevent them from merging you give them each a random UUID in their lore or PDC
I mean, a random number also works but is more likely to collide
You have to do this after the items are dropped
and on entityitempickup you could see if it has a display name and change it so when it's picked up it doesn't show the random number
Yep, remove it on pickup
using pdc