#help-development
1 messages · Page 1572 of 1
it just means that everything is hard coded
which is not a good thing if u distribute teh plugin
how to tell if an event happened during an interval of time?
I keep getting this error with HikariCP after the server has been online for like 10 hours:
https://paste.md-5.net/acujemosal.sql
How can I intercept packets to edit them? For example editing ServerPing in PacketStatusOutServerInfo
Can't I do this in the class I want?
your class does not have getConfig obviously
You need to access your plugin instance
Hello? any help?
we can't read your mind unfortunately
is your SQL on the same machine?
Whatsu mean same machine?
you mean localhost?
yes
then you have a networks issue
it is
it give me null expension about this line...
ok, are you obtaining a connection each time you make a query? or are you trying to reuse the same one?
then player is null
Thanks
This is the way I do:
public void createNickTable() {
try (
final Connection connection = getConnection();
final PreparedStatement preparedStatement = connection.prepareStatement("CREATE TABLE IF NOT EXISTS player_info " + "(UUID VARCHAR(36),NAME VARCHAR(100),NICKNAME VARCHAR(100))")
) {
preparedStatement.execute();
} catch (final SQLException e) {
e.printStackTrace();
}
}
an example right here
What is this class for? EnumProtocolDirection (NMS)
whats in your getConnection() method?
How it null?
Player player = (Player) event.getEntity();
Player killer = player.getKiller();
DamageCause deathCause = player.getLastDamageCause().getCause();
public static Connection getConnection() throws SQLException {
return hikari.getConnection();
}
last damage cause nul lthen
Ok
Looks fine
I dont see whats wrong rly
like why does it happen
config.setMinimumIdle(5);
config.setMaximumPoolSize(50);
config.setConnectionTimeout(10000);
config.setIdleTimeout(600000);
config.setMaxLifetime(1800000);
i added these options
hoping they will fix smthing
I've not used Hikari but I believe it has a connection pool. Your issues seems to be that you are being given a stale connection. Or you are trying to retrieve a HUGE amount of data at once.
Na it at first works perfectly
I'd not set a lifetime
50 connections seems like a lot
If you haven't tried it I'd try using everything default.
I have honestly no idea what to do
before without hikari the error happened after like 2 hours
or even less
now it happens in 10 hours
consider setting a keepalive time
You think that will change smthing?>
well by default it is disabled
What should be the keepalive time?
my goal is just that the server runs as long as it wants and my plugin wont crash
This property controls how frequently HikariCP will attempt to keep a connection alive, in order to prevent it from being timed out by the database or network infrastructure. This value must be less than the maxLifetime value. A "keepalive" will only occur on an idle connection. When the time arrives for a "keepalive" against a given connection, that connection will be removed from the pool, "pinged", and then returned to the pool. The 'ping' is one of either: invocation of the JDBC4 isValid() method, or execution of the connectionTestQuery. Typically, the duration out-of-the-pool should be measured in single digit milliseconds or even sub-millisecond, and therefore should have little or no noticible performance impact. The minimum allowed value is 30000ms (30 seconds), but a value in the range of minutes is most desirable. Default: 0 (disabled)
so it like pings the server?
Can I get the inventory of a player pre death in a player respawn event?
No
Ok
any1 know how i make a repeating countdown in a hologram
i mean not how to code one
Heyy i wanna dev who can make me a minecraft server pls dm me
more like a finished one
i.e. you want us to write it for you?
no isnt there a some plugins
hey, I want to know : how to import a plugin (NBTAPI for this time) and load it in the server with maven
So you want to shade it
NBTAPI is quite large you might want to get people to just install it as a plugin
it is for a server so I think this is not a problem
I did player.getInventory() but how I can't find a setInventory() method
I wanna Unbreakable item, I use this code
meta.setUnbreakable(true);
What should I?
stop using 1.7.9
what should i set it_
I try 1.8.8 but not working
What is the unbreakable code for 1.8 or 1.7?
How do I set playerInventory?
did you mean, 1.17?
damn typo's am i right
lol
no, 1.7.10
Oh ok
There is code for 1.17
simple fix: use 1.17 : )
I need 1.8
you don't need it, you want it
then google and 7 year old spigot threads is your friend
planning for the future i see
gotta wait a few more months
ItemStack teleport_bow = new ItemStack(Material.BOW);
ItemStack teleport_arrow = new ItemStack(Material.ARROW);
teleport_bow.addUnsafeEnchantment(Enchantment.ARROW_INFINITE, 1);
I wanna just enchantment bow but both enchanted
wat
Having a weird issue, I'm printing the material of an ArmorStand's helmet to the console, but it keeps giving LEGACY_AIR while I'm pretty sure I'm looking at a helmet that ain't LEGACY_AIR.
I use the following code: https://hastebin.com/abinolivan.kotlin
The specific code for this part is:
ArmorStand target = (ArmorStand) e.getRightClicked();
if(target.getEquipment() == null)
return;
System.out.println("Debug #4 "+target.getHelmet().getType()+" "+target.getEquipment().getHelmet().getType());
I'd say this is quite weird behaviour, I'm using both the deprecated getHelmet() method and it's replacement getEquiment().getHelmet(), but neither gives a valid response. Also tried casting to LivingEntity and then getting the equipment, but that gives the same LEGACY_AIR result
Please ping since chances are high I'll miss it otherwise.
did u specfy api verison
Good one, I might have forgotten to do that😅
Yep forgot, I'mma check if that fixes it
How can I hide enchantments? is there code
Should be an attribute for that
ItemMeta (or ItemStack, idk)#addFlag(ItemFlag.HIDE_ENCHANTMENTS)
This fixed it, thanks for the help. Silly mistake of mine😂
Thanks
someone knows how to check if a player has resource pack ( bungee side )?
Hi, i have a null error:
for (String s : list) { if (s != null) { if (target.getUniqueId().toString().equals(s)) { list.remove(s); p.sendMessage("§a" + target.getName() + " darf nun nicht mehr auf " + args[1] + " joinen!"); } } }
Error:
[12:07:34] [Server thread/ERROR]: null org.bukkit.command.CommandException: Unhandled exception executing command 'serverperms' in plugin Lobby v1.0
in what line?
You can't loop through a list and modify it at the same time
Thanks
You can use iterators for this or add them to a second list then remove that from the list you looped through
Nah resourcepacks are clientside iirc
A packet will be sent if the client accept the server resourcepack
If that's what he's wondering
It fixed it
what is the most reliable way to check if the server is running spigot and not a fork such as paper?
I ran Bukkit.getServer().getVersion() and it showed 3178-Spigot-eac3cd9-a6292cc (MC: 1.17.1), so I could check if -Spigot- is in there, but not sure if all versions used this format
declaration: package: org.bukkit, class: Bukkit
thanks
just note that a few servers do not adhere to this
I recall the maker of bstats complaining about it
Hi, I coded a plugin on intellj idea, how can I upload it to spigotmc?
build tool?
Uh?
from that answer I guess it isn't maven or gradle. In that case I cannot help you
!verify
Usage: !verify <forums username>
???
wait for the message
You first need a plugin
I already coded it on intellj idea...
do u know how to build it
Wait I'm confused..
have you managed to produce a .jar file
ok
:)
is there a way to write to the console as a error or warn stream? I'm aware I can use the bukkit logger but if I do that then I can't use chat colors.
I'm using this method but only shows up as info
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.YELLOW + "this is a test");```
use your plugins logger
Using colours in console is annoying as heck
Plugin Development Request: (PM if you can do this for me)
I need a plugin wich has the following features:
- A "cmd" generator bound to a mc block (i can place any command wich it will execute in time stamps)
- A placeholder with a value (value depends on generator tier) wich adds up to a total and that total i can display as a placeholder
- A config file where i can add generators by my self, choose cmd, choose a delay and the name of the generator
- a gui wich shows up when a player clicks on his generator
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
i need 20 posts 😦
my brain is much right now. It's 12am and i've been working on this for the last 8 hours
Doesn't appear to support colors.
main.getLogger().warning(ChatColor.YELLOW + " this is a 3rd " + ChatColor.GREEN + "test");```
ah. not sure then
timeRemaining = timeRemaining - 1;
tried it before
and it didnt work
1 sec
and then when I make it final
it errors more
move it within the runnable
^^^^
Bukkit.getScheduler {
int timeRemaining =
public void run() {
}
}
lol
yeah ik
just dumb
Do you want to know what it was
oh no
lmfao
I literally made a constructor
lmfao
but didnt change it
Hello, how would I get the PotionEffectType of a potion itemstack, rather than the PotionType? I have been looking at the docs for a while now and it seems that I can only get PotionType, not PotionEffectType. I need to be able to apply an effect to a player based on a potion itemstack.
Soooooo, this is not spigot, but i think there will be some1 around that can help.
I have this class as a demo:
public class HelloWorld {
public HelloWorld() {
System.out.println("Hello world from constructor");
}
}
And i am trying to compile and then run it, even if it is not inside the jar file. so the class above is placed in a random folder and i managed to compile it:
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
// Compiling the code
compiler.run(null, null, null,
"A:\\java\\test\\HelloWorld.java");
``` which does spit out a .class. but how do i then instanciate the class?
URLClassLoader classLoader = URLClassLoader.newInstance(new URL[] { new File("A:\\java\\test").toURI().toURL() });
Class.forName("A:\\java\\test\\HelloWorld.class", true, classLoader).newInstance();
the second line was just an attempt to get it to work - and it doesn't 😄
not having it inside a jar file complicated a few things since I do not think that the URLClassloader can be used

I think you could define your own classloader and just load in the bytes manually. At least that would be my approach
Then just invoke ClassLoader#defineClass(String, byte[], int, int)
ill give it a shot
Hello
dm me if you are looking for plugins to make, I need a dungeons plugin. Will not pay (might pay)
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
can you see anything i am doing blatently wrong?
i get this:
Incompatible magic value 1885430635 in class file com/jeff/java/HelloWorld
(ignore the sysouts)
Are you sure that this is the class file?
I saw, which I why I asked
I'm getting an error when opening my gui which contains all my usertags from mysql database. The error started happening when I implemented row removing method to my plugin. The error:
https://paste.md-5.net/zisiyokiye.md
My removing method:
https://paste.md-5.net/ukuhumevez.java
Also the error points to this line:
final String userTag = rs.getString("USERTAG");
Basically all the plugin works
just the error spits in console
When I remove an usertag
it successfully gets removed from the gui
And then when I reopen the gui, its not there anymore but im getting the error
Another potentially dumb question inbound - suppose the class was an event listener, is it possible to register it? It returns a class so my ide has a hissy fit
If its loaded through your own class loader, then no
I guess reflections would be one way, but I think that is no longer allowed in newer java
Yep, blocked in 1.16

iConomy used to inject teh h2 jar using reflection so spigot could access it but thats not available anymore
What do they use instead, the libraries thing in the plugin.yml?
yeah i mean that is like the usecase for it
Sadly https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java doesn't help us either with loading arbitrary code
I did ask about making the method public in there so we could inject, but it wasn;t needed for my case as we got libraries
But spigot does use ASM, so how does it work here?
Im getting a null when getting a variable from another class however when i get the same variable but use a command class instead it doesn't throw a NPE, is there a thing which events find nulls different?
Anything spigot loads its using its own class loader so has full security access.
No, if it says its null it is
What do you mean
I know its a null, but i grab the variable the same in the command class and the event class so not sure why the event is null when its fired after the command
a Null means something is null, there is no other explanation.
You can;t be accessing it the same way
GUIManager guiManager = new GUIManager();
Both times im making a instance
I'd guess yoru class instance is null and not the field
The class instance isn't null but the variable itself is, when its set. Not sure whats going on ill have a look
Perhaps you are not using J15+ and actually there is something else being null
if you are using new GUIManager() in separate classes you are creating two instances of it
Yes correct
new <clazz>(); is guaranteed to be never null
then you are accessing different fields.
so you are initialising a field in one instance but not the other.
Right i see
I seem to have been buried 😂. Would anyone mind checking out my question?
This little “protected” is gonna cause a lot of issues ….
Making it impossible level of issues
anyone has any idea?
I added this to my code:
while (rs.next()) {
final String userTag = rs.getString("USERTAG");
final String permission = rs.getString("PERMISSION").toLowerCase();
if (p.hasPermission("cubicxpchat." + permission)) {
final ItemStack item = new ItemStack(Config.getTagItem());
final ItemMeta im = item.getItemMeta();
im.setDisplayName(Config.getTagDisplayName(userTag));
item.setItemMeta(im);
allItems.add(item);
}
}
it fixed the error but now my usertags aint showing up at all
get PotionType from PotionMeta, then you can getEffectType
Gotcha, ok 👍
Nope, I also tried that and replacing the default loader
nvm, that class is final
Thank you!
So @eternal oxide I don’t mean to bother you but you are pretty certain there is no way to load the class?
There is one, but you have to enable it with a command line switch when you start spigot. However that option is also going away very soon
what is the rationale behind that?
whats the point on making a variable final if you simply dont assing it to something new?
Quick question, when I register a listener in a new class and that class is no longer used/done with, should I just unregister the class with
HandlerList.unregisterAll(className);
Because I'm afraid it could rack up memory, this is for when a player is opening a gui, it creates a new instance of a class named "MenuView" and that registers listeners inside of it and then it could end up registering thousands of them classes, even when the listeners inside the class aren't used anymore.
did you check the docs, google it, and asked in a proper discord?
i checked everything
i didnt find a right discord for it
final local variables are pretty much useless outside of the compiler stopping you from reassigning it
Yes de-register it when you discard the class
i googled it all night
nothing was helpful
then you suck at googling things
let me see if i can find something
send me the link of your plugin
okay!
ah..
For non-local variables (fields) however the final access modifier does matter as JIT will optimise things
wait wdym de register listeners? dont you just remove the class?
There is a discord
On the bottom
no, there is an unregister method the same as there is to register
I recommend grepping for "discord" or something
Ok thank you @eternal oxide ❤️
bro you fr?
I sent you a link already
So like I said, would it rack up quite a bit of memory quite fast or what would happen if not unregistered? @eternal oxide
it could, and its not safe to do. However what would be better is create a universal listener as you can access the viewers of the inventory
I noticed when a generic command need a playername as argument, it doesn't care about casesensitivity. what is the best way to implement it to my plugin? Bukkit.getServer().getPlayer("string") seems casesensitive...?
You only need one class to handle all the UI and players
Right
Bukkit.getTargets or whatever it is called might do it, idk
never bothered with such details
@quiet ice when I made a new server I added player to whitelist, and didn't need to think about the upper- or lowercase of playernames, even though they never had been online here. it was corrected the case at the server siden upon adding them
like it checked the database to Microsoft/Mojang
Bukkit.getTargets is the only thing that I could think of might do it - but I highly doubt it
Case matters in minecraft, so idk why this happened.
Actually perhaps we two should read the docs more throughout
static Player
getPlayerExact(String name)
Gets the player with the exact given name, case insensitive.
@opal juniper for future references avoid sending links in the discord, dm them instead
Im comparing getInventory to current inventory open, however its not running the code, when i print out the inventories their the same ID, should be noted that 2 different prints are coming to the same result, so why isnt the if statement working?
System.out.println(guiManager.rankInventory);
System.out.println(event.getInventory());
if (guiManager.rankInventory != null) {
if (event.getInventory() == guiManager.rankInventory) {
I wouldn't compare objects using ==, so use .equals
well, it is fairly difficult to actually compare inventories
that is the issue
not that they are using ==
You should be using an inventory holder
or a WeakHashMap<Inventory, YourDataType>
it should work
If the identity hashcode is the same but they fail the identity comparison, there is something wrong
I guess you code afterwards is just wrong
What difference between scheduleSyncRepeatingTask and runTaskTimer?
or Inventory Framework
before suggesting random libraries, I suggest to look at the code
less confusing name
What?
they are the same essentially
just use whatever you like
See not confusing at all...
scheduleSyncRepeatingTask
scheduleAsyncRepeatingTask
Yes but are they the same and just difference func name?
essentially
yes
Ahh
well, not the same same, but for the regular dev yes
The distinction only becomes vital if you want to do more cursed things
One another question, a class(interface) like Server, Player, BukkitScheduler and so many more if they are just interface how can I see its code?
interfaces don't have implementations
that' sthe point of them
you can see the classes which implement them on the spigot stash
I sometimes want to know how do they work, how they are defined, but I can't
If you ran BuildTools you can look in teh sources there
I didn't get what to see this
Ahh I see it!
Thank you!
But why don't they do in purely Player instead of CraftPlayer?
abstraction
Because Bukkit is the API and nothign else
the api is meant to be abstract, such that it is there independent of whatever implements it
CraftBukkit is the implementation
Which is why things such as Glowstone can exist
But then the server run CraftBukkit instead of Bukkit?
Does it exist in spigot.jar?
the output of buildtools is everything
Spigot is a fork of cb
spigot is a series of patches on top of craftbukkit
spigot is both API and implementation
there is spigot-api
Ohh yeah, I see it
But we can get maven repo only spigot-api, can't get its implementation(?)😕
no
I need to use external lib to(use spigot.jar) to get its library
you shouldnt need the nms classes letalone craftbukkit
if you run BuildTools you install spigot into yoru local repository so then you can use spigot over spigot-api, if you need
The issue is that Cb is based on mojang minecraft, which cannot be distributed freely
bukkit had some degree of immunity from this which is why the downloads from the pre-1.8 era were distributed in a raw manner
Btw, is spigot legal or illegal?
Grey area
spigot is in complicated limbo which nobody knows the legality of until some court case happens which will never happen
mojang hasn't said anything
Yeah
Mojang isn't too much of an issue as they tolerate them
And given that they bought bukkit (the project, not the codebase), it is likely that they are supportive of spigot
Yeah, I think so too
At the end of the day spigot brings so many talented minds to minecraft and recently took on a member of the forge community to develop, and they partener with servers who use spigot api..
I wonder if spigot team has extremely knowledge on this, why don't they develop a brand new server software instead of panic using Bukkit? Also can't much modify it.
spigot maintain bukkit
There's other server software being developed. However the Spigot team continues to maintain Spigot/Bukkit as many developers are used to it and there exists such a large amount of plugings and a big community for Spigot.
But I think if they don't have well enough permission to modify Bukkit, they shouldn't stay even it is a large community, but seem the potential of being greater and greater is less, they can't update the old.
they maintain bukkit
idk, if so
Cheers, i changed the holder to the player 🙂
Bukkit is GPL, modifing it is not an issue
Forking now would result in giving paper the upper hand. not a valid move
stupid spigot classloading shenanignans smh day ruined
Spigot classloading is strange if you have no idea what it does, agreed
Silly question, but why do you want to load a separate class in manually?
better skript
If i have a list being created like this
public void loadEvents() {
angryBeeEvent = new AngryBeeEvent();
events.add(angryBeeEvent);
summonCreeperEvent = new SummonCreeperEvent();
events.add(summonCreeperEvent);
loopTntEvent = new LoopTntEvent(this);
events.add(loopTntEvent);
giveDiamondGearEvent = new GiveDiamondItemsEvent();
events.add(giveDiamondGearEvent);
giveDiamondEvent = new GiveDiamondEvent();
events.add(giveDiamondEvent);
loopSheepEvent = new LoopSheepEvent(this);
events.add(loopSheepEvent);
lightningSpawnEvent = new LightningSpawnEvent();
events.add(lightningSpawnEvent);
giveAppleEvent = new GiveAppleEvent();
events.add(giveAppleEvent);
}
I want to do event.getEnabled(); wich just returns true or false, and then if its true put it in the list, if false. dont.
Whats the best way of doing that, would i have to create a new List?
Loop through everything in List1 check if its enabled, if true add it to List2?
How can I add fake ServerPlayers in 1.17?
Guys should i learn java before spigot api ?
Yuhuh
here is some info
i didnt
?learnjava
but YES
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.
so should i just make a second list?
If you don't learn java first you will probably find yourself in a developing/debugging cargo cult
Yeah the idea was that u could have a onefile "addon" that would actually be in java rather than the skriptlang. i was just curious if something like that could work
im learning java now from codeacdemy i completed 20%
nice!
jeff
yeah
Very good start, codecademy is nice
should i make a second list?
lemme read it
Make sure you at least get a solid few lessons in on classes, once you understand those you should mostly be good to go
i dont really know what you are trying to do. once you make all these events you add them to a list which i assume is a Set. what is the purpose of the lists?
so i can randomly choose between them
i just do event.start(Player)
thats all working, i just wan to be able to enable or disable them without manually adding an if statement per event
from thos
Its a interface i made
ok
so what, you are getting a random choice from the list and then call that one on the player?
Yea, and that works fine
But i need to be able to enable or disable certain ones
Should i Loop through everything in List1 check if its enabled, if true add it to List2?
so just remove them from the list to disable, and add then back to enable
no need to have two lists?
to check if its enabled
Is there a method to set a inventory display name as i couldn't see it in the docs
oh
well i guess if u really want u could have a set of enabled and a set of disabled
that would work
idk i feel like there is a better way
I am trying to create a system where I can add prefixes to my players based on permissions they have. Why won't this work???
@EventHandler public static void onPlayerJoin(PlayerJoinEvent e) { Player player = e.getPlayer(); if (player.hasPermission("owener.minecraft")) { player.setDisplayName(ChatColor.RED + "[OWNER] " + player.getName()); player.setPlayerListName(ChatColor.RED + "[OWNER] " + player.getName()); player.setCustomName(ChatColor.RED + "[OWNER] " + player.getName()); } else if (player.hasPermission("admin.minecraft")) { player.setDisplayName(ChatColor.DARK_GREEN + "[ADMIN] " + player.getName()); player.setPlayerListName(ChatColor.DARK_GREEN + "[ADMIN] " + player.getName()); player.setCustomName(ChatColor.DARK_GREEN + "[ADMIN] " + player.getName()); } }
public void refreshEvents(){
List<ChaosEvent> newList = new ArrayList<>();
for(ChaosEvent event : events){
if(getConfig().getBoolean("chaos.events." + event.getName() + ".enabled")){
newList.add(event);
}
}
events = newList;
}
@opal juniper
I am an idiot
Hey! Quick question: I'm trying to work with JDBC in my plugin and am in the process of creating methods for it. I got the recommendation to use datasources. Unfortunately, I don't quite understand how to create and use them. Can anyone help me with this?
?
gith
right
thank you
wait
no because the newList doesnt contain any of the disabled ones
Is there a way to change chat capsule? I.e. reg minecraft: <[username]> [msg] what I want: [username]: [msg]
AsyncPlayerChatEvent#setFormat
ty
sah dude
sorry what
What are you trying to do
ItemSpawnEvent doesn't fire when items are dropped I don't think
when i break a chest
Only when you use something like World#dropItem maybe?
doesn't triggers again
Honestly I'm not really sure what it considers "Spawning an Item"
hey, I have a little question : why my plugin work without importing anything (BossBarStorageData for this time)
actually not
Can you send your project hierarchy?
it does
when you break a chest, drops the items in it
i meant it spawns
I moved him for a little test
exactly
@fleet falcon what are you trying to do?
Yes but why do you want to use it
wait, I have a compile error
Might be another way to do it
that's confusing
restart your ide, maybe your ide bugged out and cant detect
I need someone who has knowledge with modules in maven.
I almost completely refactored my plugin to use modules, on maven install all modules execpt of the last one can be compiled..
But i don't understand why the last module can't find the classes of a other module.
More information here: https://www.spigotmc.org/threads/how-to-compile-for-all-java-versions.515294/#post-4214015
uhh, he inverted an icon, I think it's better for me to re-install eclipse
whats the log?
/home/false/git/Builder-s-Wand/Spigot_Plugin/src/main/java/de/False/BuildersWand/utilities/ParticleUtil.java:[5,37] package de.False.BuildersWand.version does not exist
(just a few times, always package does not exists)
it means the package doesnt exist?
Yea but as i described in the spigot thread, the package is part of the Builders_Wand_abstraction module which is added as dependency
<dependency>
<groupId>de.False</groupId>
<artifactId>Builders_Wand_abstraction</artifactId>
<version>3.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
but why are you doing package ?? why not import it
I need modules, because if i don't use module (which is currently the case) the plugin ALWAYS needs Java 16.
you can import modules?
Hm ?
is there a way to make X and Y just go to the next possible possition when using paginated pages in IF ?
import de.False.BuildersWand.version.*;?
Yea i do that 😄
Interesting, I tried this myself and it seems to be working fine.
it says you did package de.False.BuildersWand.version;?
like normals panes, where you just add the item
what is your spigot version
On 1.16.4 right now.
Could you send your main module's build file?
Try not canceling PlayerDropItemEvent? 🤔 Item isn't gonna spawn if you cancel that
Yugi!
pretty sure it pops back in your inventory
It does
@granite stirrup
Here i added the package as dependency: https://github.com/UtechtDustin/Builder-s-Wand/blob/module-refactor/Spigot_Plugin/pom.xml
Here i use the Class NMS which is in the package de.False.BuildersWand.version: https://github.com/UtechtDustin/Builder-s-Wand/blob/module-refactor/Spigot_Plugin/src/main/java/de/False/BuildersWand/Main.java (Line 26)
There is also the import on Line 13
@north ridge Do you mean the pom.xml ?
https://github.com/UtechtDustin/Builder-s-Wand/blob/module-refactor/Spigot_Plugin/pom.xml
yeah i have no idea whats wrong
Yes
You dont seem to be using the maven shade plugin
This should help: https://maven.apache.org/plugins/maven-shade-plugin/
Let me try that.
do you even need that?
Yes
im pretty sure i did a multi module thing before and im pretty sure i didnt use it
and it worked fine
Afaik you do need the shade plugin to copy the compiled files from the different modules into the same jar
Maybe you didn't notice?
I havent used maven in about an year now so not particularly sure, gradle does require you to use shadow tho, so most likely you do need shade.
The scope itself does nothing. The shade plugin copys the compiled classes of dependencies from that scope.
But if i need the shade plugin, why does maven can compile all modules execpt that one ?
The other modules also have dependencies.. e.g. https://github.com/UtechtDustin/Builder-s-Wand/blob/module-refactor/v_1_15/pom.xml
maybe i did have the shade plugin but idk
let me check
lol i do have it i guess i just didnt notice it
ah
Could you share how you implemented it ?
It don't work for me with the shade plugin 😅
?paste
Within the main pom or in the module pom ?
i think i did it in the module
That would likely be part of your plugin module
This one in your case (https://github.com/UtechtDustin/Builder-s-Wand/blob/module-refactor/Spigot_Plugin/pom.xml)
<groupId>somegroup.id</groupId>
<artifactId>ArtifactID</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>``` i just added my other modules like this xd
Don't work for me in the Spigot_Pluigin module, same errors.
Could you send the error you are getting?
Thats a compilation error
Yea i know.. but he should find the package :/
You have unresolved classes in your dependencies
Go through each of the mentioned classes
No, the ide also can resolve them 😄
Your IDE should let you know what's missing
You need to manually go and install each NMS version
Run mvn install
I did Olivo 😄
No, my IDE can find anything.
The packages exists and the modules are declared as dependency.
Thats the reason why im confused 😄
What ide are you using?
IntelliJ
Ok, open the "maven" tab on the right toolbar and hit the refresh button
I did almost a thousand times 😄
Your issue looks like a missing import
Yea i know how it looks, but i don't understand why 😅
As you can see on Github the import is there.
There are only errors for the Class NMS, the other Classes (for each Version) can be used it seems..
But i imported it on the same way..
Remove the 1.16 nms import in your abstractions module
That will override other version dependencies you specify in modules that depend on that
oh wait nvm
😄
done and now ?
Try building again
Okay, let me refresh maven (will took some minutes :D)
Alright
PDCs is settable for spawners?
i can't or to set, or to get value
or that's so big
idk
You dont get data containers for blocks afaik. Only entities, and items(maybe)
Okay, still the same errors 😅
Spawner is TileEntity
Oh it is? Then you should be able to I assume
i saving items(contents of inventory) in PDC with YamlConfiguration serializer
Do you have any other ideas ?
I almost have the same setup as https://github.com/WesJD/AnvilGUI, but it don't work 😵
Try running clean and then install
I did, but i always run mvn clean install
How do I create particles that are displayed to the player for a certain amount of time? I'm using 1.8.8 so I don't have access to spawnParticle()
Right I probably should've specified
I want it to display for a certain amount of time
Like instead of showing the particles for a second and then disappearing I should be able to make a line of crit particles for example
Im sure it is not possible, so you have to use timers/schedulers and respawn them for the time.
might be worth noting your submodules does not have the compiler plugin
your parent pom should have its plugins defined in <pluginManagement> for submodules to inherit it
Yugi already told it to me, but it still not working.
Let me push the newest version.
Check now, the shade plugin is now on github too..
I almost have the same structure and modules as https://github.com/WesJD/AnvilGUI (execpt of the javadoc stuff, which i don't need).
your project also doesnt have the default location for source files
What do you mean ?
the abstraction module doesn't have its code within src/main/java, and you havnet configured maven to accoutn for this
Im creating a plugin that give the users item a random enchant. However it wont add the Enchant to the users item. Everything else works. https://hastebin.com/lokerazoru.csharp
If someone could help me, i'd appreciate it
ok ill try that
Oh i don't even noticed that, it seems that was the issue..
Sometimes you don't see the small issues...
Now i have to figure out why he cant find the NMS Version Classes: https://paste.md-5.net/wohuzuheke.sql
Does any library included with the spigot jar include something like a Either or Pair implementation?
i suppose the same issue is true for th rest of your modules
i guess, yes
Pair in apache commons?
is that included?
yes
Thank you, in german i would say "Manchmal sieht man den Wald vor lauter Bäumen nicht" -> "Sometimes we cant see the forest because of the trees" 😬
Is there anyway to make PersistentDataContainers on Projectiles persist through Projectile Firing Events such as an Arrow Shooting out of a Bow?
Every time I shoot an arrow, the PersistentData is cleared.
no problem
i'll trust you, cause spigot-api doesnt include any other libs 👍
u will have to transfer it in the event yourself
I figured, but how do I go about getting the "Ammo" used that triggered the event?
declaration: package: org.bukkit.event.entity, class: EntityShootBowEvent
Would it have to be nested events, like set the Data on a Launch event, then read the Data on the Hit Event?
That works! Thanks! 😄
And yes, you would need an event listening to shoot bow -> check for PDC on the consumed item -> apply to arrow entity -> check its PDC on hit
Sounds good
Is it safe to use commons-lang3? In the spigot JAR I could only find org/apache/commons/lang without the 3 at the end.
Oh no sorry, that is actually a paperclip issue it seems
free
Start with youtube videos
?learnjava
recommend youtuber ?
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.
The errors of my modules are gone, but now i get
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project Spigot_Plugin: Fatal error compiling: java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor (in unnamed module @0x5b6b5888) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module @0x5b6b5888 -> [Help 1]
But i don't understand what that means...
I don't use LombokProcessor (what ever that is) and also all my modules are named.
hello, can you help me to cast an real offline player to a player because when I read the javadoc they say : "Represents a player, connected or not" so how can I cast an offline player to a player (I tryed the OfflinePlayer#getPlayer but I only return a player if he is connected)
JavaFX
Though that is provided by the JVM
I'm trying to make a virtual anvil with a item already in it, however the item doesn't seem to spawn, Is there something im missing?
Inventory userNameInventory;
userNameInventory = Bukkit.createInventory(player, InventoryType.ANVIL);
userNameInventory.setItem(0, createItem(Material.PAPER, "#c4c4c4", "Input Username", "uInput"));
player.openInventory(userNameInventory);
How can I move armor stands with passengers on them in 1.17?
Error occurred while enabling DrDukyGud v1.17 (Is it up to date?)
java.lang.IllegalArgumentException: Plugin already initialized!
what does this mean
Meaning your plugin is already enabled and running
you tried to use new Main()
or whatever your main class is
or a plugin with the same package name is already running
perhaps all three of the above 🙂
...
Hey! Does anyone know about JDBC and can help me with it? I would like to use it in my plugin. I had actually already built something like this into my plugin, but then I got the tip to work with datasources and that has now somehow completely confused me. Does anyone know how I can connect MySQL to my plugin for Minecraft version 1.16.5 by using datasources? I would be very grateful
this game is trash
i only have 1 plugin
Well it won't be my reason then
then you are attempting to call new Main()
i did not write new main()
if you do a new Main() use an instance
Show the code 🙂
what class extends JavaPlugin in your pluging?
How can I move armor stands with passengers on them in 1.17? They wont budge with passengers, but they would if they have nothing on them
package drdukygud.me.cringe;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.ScoreboardManager;
public class jxlCringe extends JavaPlugin {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
ScoreboardManager manager = Bukkit.getScoreboardManager();
Scoreboard board = manager.getNewScoreboard();
Objective obj = board.registerNewObjective("test","dummy", "§cEwen_Is_Fat_XD§r");
obj.setDisplaySlot(DisplaySlot.BELOW_NAME);
Player player = (Player) sender;
player.setPlayerListName("§cEwen_Is_Fat_XD§r");
player.setDisplayName("§cEwen_Is_Fat_XD§r");
player.setCustomName("§cEwen_Is_Fat_XD§r");
return true;
}
}
the full error can help also
is that the whole plugin?
package drdukygud.me.cringe;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
@Override
public void onEnable() {
// Plugin startup logic
getLogger().info("wtf");
getLogger().info("wtf hein??");
getCommand("nick").setExecutor(new jxlCringe());
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
}
main class
Looks like it
uhhh wait
Oh wait
?
why do you use a javaPlugin
You can;t have two classes extend JavaPlugin
OnCommand needs to implement CommandExecutor
or TabExecutor if you want to use tabs
for real idk
^ fair
so @quaint mantle was correct. You have two plugins in teh same jar
I already know how to use JDBC but I can't manage the connection. Do you know which classes I need for this?
i hate my life >:(
I only learnt that was the case when a plugin developer stole mcmmos code and used it in theirs and it threw that and the staff told me the problem xD
What do you mean, manage the connection?
i want to use permissions but i dont quite understand how it works, how they work exactly? are they something a minecraft server thing that various plugins handle more easily? are they something from bukkit/spigot? does each permission manager plugin have its own implementation? does each player have an individual permission list, or does each permission group have a list of players? any guide on this?
Player#haspermission, is a check if they have the permission via i permission plugin i believe
But If the user is opped they pass that check
Each Player implements a Permissible and permissions are attached to a player. As a plugin dev you only need to worry about Player#hasPermission(String)
So I have actually already managed to connect the database to my plugin. But then I got the tip to work with DataSources. Now I don't know how to do that so that it works.
(you really not skipped me)
@eternal oxide You ever worked with anvils xD
OfflinePlayer#getPlayer() BUT only if they are online
mmm, but i want to give permissions to individual players, like, sell permissions ie, how do i add the permission to an individual player? where is that stored?
yes but the player is actually offline
That depends on what these people are talking about when they say "datasources", Thats litterally MySQL, SQLite etc
Then there will be no Player object for you to get
a lot of people use hikari (thus HikariDataSource) here, that is an option you may want to consider, but the role of a DataSource is to just offer the connection
an OfflinePlayer only has an OfflinePlayer object
so why the javadoc say : "Represents a player, connected or not"
the player may disconnect, but the object will still exist if there is a reference to it
because an offline player can be connected as well as not connected
Because the javadoc is vague
hey, does <version>1.17-R0.1-SNAPSHOT</version> mean 1.17.1?
The OfflinePlayer object is not dependent on the online state
1.17.1-R0.1-SNAPSHOT is 1.17.1
A DataSource like this is meant: https://github.com/RainbowDashLabs/BasicSQLPlugin#setting-up-a-connection
I think now I will re-dev my entire functions
or I delete this part of my code and I have no problem
thank you, is there a website that shows the versions?
Yes, thats just different database backends
i use MySQL
or is it always just the first bit that needs to change
a datasource could be flat file, MySQL, SQLite, progress etc
i can't seem to get maven seeing 1.17.1
The R0.1 changes sometimes. I think all the versions are on the BuildTools page
thanks
I haven't done that yet
Thank you!
@quaint mantle Furry cringe
If that's what you mean, I use MySQL
atleast i have curves xD and not sharp wooden ends xD

I've no idea what you are askign anymore as a datasource is just where your data is stored
That's odd
me?
ok
That worked, thank you!
abcd
Yes. But I have always worked with databases without using MysqlDataSource dataSource = new MysqlConnectionPoolDataSource (); somehow.
SuperPerms still exists? if so, why doesnt it exist in my intellij? isnt it supposed to be part of bukkit? isnt that the core stuff of all permissions?
How are you able to define a spawners type?
np 🙂
Type can't be used on spawners, can be used on spawn eggs tho.
They have NBT i guess
That is a Hikari datapool. It just maintains x number of active connections (as you configure)
Is there not another way beside NBT?
and how do I have to set it up?
That github page you linked looked to be fairly comprehensive
public class jxlCringe implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
ScoreboardManager manager = Bukkit.getScoreboardManager();
Scoreboard board = manager.getNewScoreboard();
Objective obj = board.registerNewObjective("test","dummy", "§cEwen_Is_Fat_XD§r");
obj.setDisplaySlot(DisplaySlot.BELOW_NAME);
does this thing work cause i can't see by myself
or do i need to add something else
Aslong as you've defined a command yeah thatll work
k
It is. But I just don't understand how to use it.
What part are you having trouble understanding?
So
I have the following classes to connect the plugin to the database:
import com.mysql.cj.jdbc.MysqlConnectionPoolDataSource;
import com.mysql.cj.jdbc.MysqlDataSource;
import org.bukkit.Bukkit;
import java.sql.*;
public class MySQL {
public static String host;
public static String port;
public static String database;
public static String username;
public static String password ;
public static Connection con;
public static void connect() {
if(!isConnected()) {
try {
con = DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/" + database, username, password);
Bukkit.getConsoleSender().sendMessage("§aDatabase connected!");
} catch (SQLException e) {
e.printStackTrace();
}
}
}
public static void disconnect() {
if(isConnected()){
try {
con.close();
Bukkit.getConsoleSender().sendMessage("§cDatabase disconnected!");
} catch (SQLException e) {
e.printStackTrace();
}
}
}
public static boolean isConnected() {
return (con == null ? false : true);
}
public static Connection getConnection() {
return con;
}
public static void update(String qry) {
if(isConnected()) {
try {
con.createStatement().executeUpdate(qry);
} catch (SQLException e) {
e.printStackTrace();
}
}
}
public static ResultSet getResult(String qry) {
if(isConnected()) {
try {
return con.createStatement().executeQuery(qry);
} catch (SQLException e) {
e.printStackTrace();
}
}
return null;
}
}
and
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
import java.io.IOException;
public class MySQLFile {
public void setStandard() {
FileConfiguration cfg = getFileConfiguration();
cfg.options().copyDefaults(true);
cfg.addDefault("host", "localhost");
cfg.addDefault("port", "3306");
cfg.addDefault("database", "straussfalkeplugins");
cfg.addDefault("username", "root");
cfg.addDefault("password", "");
try {
cfg.save(getFile());
} catch (IOException e) {
e.printStackTrace();
}
}
private File getFile() {
return new File("D:/Programmierung/Plugins/SfAdminTools", "mysql.yml");
}
private FileConfiguration getFileConfiguration() {
return YamlConfiguration.loadConfiguration(getFile());
}
public void readData(){
FileConfiguration cfg = getFileConfiguration();
MySQL.host = cfg.getString("host");
MySQL.port = cfg.getString("port");
MySQL.database = cfg.getString("database");
MySQL.username = cfg.getString("username");
MySQL.password = cfg.getString("password");
}
}
and I don't understand how to include MysqlDataSource dataSource = new MysqlConnectionPoolDataSource (); in full correctly
Take a look at example 5 http://www.javased.com/?api=com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
ok
@unreal quartz do you have a idea for that issue ?
Did you correctly add your dependencies for all versions?
Lombok is used in Bungee and I believe spigot
i assume one of your dependencies has lombok
So I just need to add this class to my plugin?
How can i figure out which one ?
pretty much
I guess i added them "correctly"
look before the error, what was maven doign last?
try compiling with a different java version for now
i assume that is brought on because of the changes in java16
Ok. Then thank you for your help
Should i share the whole log ?
Before that issue there was the list of the modules.
?paste
@eternal oxide Sorry, I have another quick question: In the class there are the following imports:
import io.airlift.discovery.client.ServiceSelector;```
Do you know where I can get these classes?
Oh wait I only need the method that is in example 5?
It looks like your issue is with askyblock. Look in its pom and it hard codes server jars.
Oh.. let me try if that is the issue.
Still the same error https://paste.md-5.net/taxihicuti.rb
Yo, quick question about the aids that is BuildTools and the Minecraft eula, do we know how to import the Spigot-Server dependencies with Gradle? As I'm running into this error: https://bpa.st/N6MQ
I now have created the following class
import com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource;
import javax.sql.PooledConnection;
import java.sql.SQLException;
public class MySQLDataSource {
protected PooledConnection createConnectionInternal() throws SQLException {
SQLException lastException=null;
if (dataSource != null) {
try {
return dataSource.getPooledConnection();
}
catch ( SQLException e) {
lastException=e;
}
}
dataSource=null;
for ( ServiceDescriptor serviceDescriptor : serviceSelector.selectAllServices()) {
if (serviceDescriptor.getId().equals(currentServer)) {
continue;
}
String jdbcUrl=serviceDescriptor.getProperties().get("jdbc");
if (jdbcUrl == null) {
continue;
}
try {
MysqlConnectionPoolDataSource dataSource=new MysqlConnectionPoolDataSource();
dataSource.setUrl(jdbcUrl);
dataSource.setConnectTimeout(getMaxConnectionWaitMillis());
dataSource.setInitialTimeout(getMaxConnectionWaitMillis());
dataSource.setDefaultFetchSize(defaultFetchSize);
PooledConnection connection=dataSource.getPooledConnection();
this.dataSource=dataSource;
this.currentServer=serviceDescriptor.getId();
return connection;
}
catch ( SQLException e) {
lastException=e;
}
}
currentServer=null;
if (lastException != null) {
throw lastException;
}
throw new SQLException(String.format("No mysql servers of type '%s' available in pool '%s'",serviceSelector.getType(),serviceSelector.getPool()));
}
}
and some things are marked as errors there.
@burnt current use https://paste.md-5.net/
You need a datasource Field
ok you have two issues I can se now. First is an issue with Residences.
[WARNING] 'dependencies.dependency.systemPath' for com.residence:residence:jar should not point at files within the project directory, ${project.basedir}/external/Residence.jar will be unresolvable by dependent projects @ line 182, column 25```
Yes im already searching if there is an replacement for ${project.basedir} just for the module dir 😄
is there an event for when someone finishes writing a sign? to then perform an action such as creating a store for example
or when someone presses a button, that would be better i think
what about the button
Fixed, still the same error https://paste.md-5.net/uvonugehov.sql
The second error are the warning i guess ?
the last is the long list at the end where it can;t find those dependencies
why does pressing tab in chat while entering a command sometimes gives a player list and sometimes it doesnt?
Also fixed that one, but have still the same error: https://paste.md-5.net/cajikejinu.sql
I dont know if this is meant for this channel but i dont know how to fix my server it keeps on crashing it says 'Exception in server tick loop'
try running the build with a -e switch
I dont know if this is meant for this channel but i dont know how to fix my server it keeps on crashing it says 'Exception in server tick loop'
@dense python stop spamming, thanks.
@eternal oxide like this: https://paste.md-5.net/naposagaka.sql ?
but i dont know how to fix it @regal lake
That is no reason to spam it...
I guess your Server don't have enough ram (i quickly search the error on google)
how would i fix it
Search what RAM means, then increase the RAM 😅
You can't throw questions, without do some research...
ItemStack cost = new ItemStack(Material.AMETHYST_SHARD);
cost.setAmount(1);
Inventory i = player.getInventory();
boolean containing = i.contains(cost);
This returns containing=false if I have not a stack of EXACTLY 1 Amethyst Shard in my inventory.
How can i make it return true even if i have for example 24 shards?
i have
I don't think so...
looks like some plugin is using an out of date lombok
i have researched it i have watched some videos and i try what they say
Okay, then you know what RAM is, right ?
yes
I'll try thanks
Okay, how much RAM your (minecraft) server has and how much does it use ?
lets say, for the sake of simplicity, i have an item which, when the player holds, displays his location (x y and z coords) in his action bar. I obviously have to listen to PlayerItemHeldEvents but what is the best way to implement that?
I am thinking of having a List or Array of Players and loop though it every (let's go with 50) ticks and send action bar updates, but is there a better approach?
i know what ram is i just dont know how to find how much ram it uses and how to change it
i really thought this would help me but obviously not
As i already said then do some research, you can find it within a few minutes or better seconds..
but i dont know where to look in the files of my server
@regal lake what version of maven are you using?
3.8.1
If you would do some research (on e.g. google) you would know which files you have to adjust.
im not the best at coding ok and i want to make a minecraft server for me and my friends
That is don't even coding..
If you don't know how to adjust that simple thing you maybe should buy/rent a minecraft server instead of hosting it yourself.
i want to make the server myself
Then you have to learn the basic stuff yourself..
@eternal oxide seems working, thank you very much 👍 .
Now i can check if the compiled jar is working:-)
and how can I create this correctly?
I setuped up a bungee cord and it tells me
Can't connect to the server
bump
Does Plugin#getResource get the resource from the data folder or the JAR?
jar
So should I do Plugin#saveResource if it is found?
The way you create any field
I am trying to make an item that when it is in the inventory and the player is moving then it will automatically consume food. To start i am just using steak (Cooked_Beef). https://hastebin.com/uvuzawosaw.java
I am trying to loop through the players inventory to see where the food is located but can't seem to get it to work.
Is there a way I can set a block's damage?
oh ok. And where should i create it?
if i modify the public property of an object which is stored inside a map, the object inside the map will also changes without having to put it back, right?
new MyObject() returns a pointer, like in the majority of languages, right? so its a reference
how do i make a plugin so it change to a specific skin
skin: https://minesk.in/afbe3ca14b9f488296fba0defaf265cb
dont judge the skin pls
?
Does anyone use an 'error tracker' or similar in there plugins at all? Something like Sentry.io? I'm wondering how useful/possible it would be
ignored.........
lets say, for the sake of simplicity, i have an item which, when the player holds, displays his location (x y and z coords) in his action bar. I obviously have to listen to PlayerItemHeldEvents but what is the best way to implement that?
I am thinking of having a List or Array of Players and loop though it every (let's go with 50) ticks and send action bar updates, but is there a better approach?
What do you exactly want to achieve? Change the skin of every player? change the skin of the plugin? if you ask properly formulated questions you are more likely to get an answer.
change the skin of A player
It's a reference yes, I wouldn't think of it as a pointer since they work a bit differently, i.e it's a reference to that specific object and re-assigning it just changes the reference to another object. But yes you will be able to modify the public property on an 'Object' and won't have to replace it in the Map
I found this using a top secret tool called google https://www.spigotmc.org/threads/how-to-change-player-skin.358886/ 
how do I set a blocks breaking power
good, thanks
No that is an instance of MyObject
Not a reference
You will get a variable if you store it in one and a field if it happens to be an instance variable
hi guys i need help!
how i add custom item to mincraft but
not overtake micnraft item
exep:
use a resource pack
hide the imperfections
how?
just do not look at it
ok
how can i know the facing of a sign block or a button?
so i check the material of the block, and if its a directional block, i just cast to Directional instead of block, and then getFacing
?
or better cast to Ladder or Button i guess
maybe soem one has some easy idea to check if pumpkin is connected to steam ?
Yep, I forgot about that, sorry. BlockData API is the replacement.
so ((Attachable)block.getBlockData()).isAttached()?
So it would be something like
if (block.getBlockData() instanceof Directional directional) {
directional.setFacing(BlockFacing.SOUTH);
block.setBlockData(directional);
}
I think
and then, if it is, cast to directional?
mm ok thanks
is that instanceof check necessary if im listening to SignChangeEvent?
i guess not
mm, well yea, i forgot about normal signs, but i just want to listen to wallsign
so, i have to check that in the event
mmm why does Location have a getBlock method but no setBlock?
Block#setType
a Block object has a location inside?
i thought it was independent of its position
Well a block is a block in the world so yeah it has a location
makes sense
Olivo hitting the logics
then, if im replacing a sign with a button, maybe i dont even have to know the location and direction?
just check if its a wall sign?
?paste
https://paste.md-5.net/qerohutibu.cs
I keep getting this error even after I called all possible null exceptions
https://paste.md-5.net/vafocuhuse.java here is my code
error happens when i left click or right click the air holding any item/even with no items in hand
SummerCrate.java:30
Your error does not line up with yoru code
I'm so confused. Working with vault, making an economy plugin. The issue is, other plugins will not interact with it. If I take the SAME economy code, and put it into a different project, the other plugins have no issues. But in my main project, they just won't interact. It will interact with its self with economy commands, and is hooking into vault it seems.....
So I'm at a loss. Any thoughts?
You don't need to cast any of those Block, Player, Action nor Location
but you do need to check that crate is not null before you attempt to use it
so basically I need to get rid of the (Location) and also it doesn't allow to do
return;
}```
yes you can return if crate is null
Does anyone know of a way to add bukkit recipes to the vanilla recipe book?
I’ve seen it done before
Strange it says dead code for me
?paste your class
you are not exiting if crate is null
and remove (Block) (Player) and (Action)
You also need to move this test up so it happens before you try to access item if(item == null) return;
this test up?
Not checked it but cleaned it up a bit https://paste.md-5.net/qezonagovi.java
thank you works fine
one sec
yeah?
why in gods name does this change the value of cornerLocation
testLocation.setX((cornerLocation.getX()));
testLocation.setZ((cornerLocation.getZ()));
testLocation.setX(testLocation.getX() - 1);
testLocation.setZ(testLocation.getZ());
logColored("After processing: My location is "+cornerLocation+" and im testing at"+testLocation);```
i CANNOT get cornerLocation to stay the same
[15:24:06 INFO]: [FactionsX] Before proccessing: My location is Location{world=CraftWorld{name=world},x=3584.0,y=0.0,z=128.0,pitch=0.0,yaw=0.0} and im testing atLocation{world=CraftWorld{name=world},x=3584.0,y=0.0,z=128.0,pitch=0.0,yaw=0.0}
[15:24:06 INFO]: [FactionsX] After processing: My location is Location{world=CraftWorld{name=world},x=3583.0,y=0.0,z=128.0,pitch=0.0,yaw=0.0} and im testing atLocation{world=CraftWorld{name=world},x=3583.0,y=0.0,z=128.0,pitch=0.0,yaw=0.0```
Smaller and tidier. It could be better but I did it in notepad. https://paste.md-5.net/mokumolodu.java
woah thank you
Smaller 🙂 https://paste.md-5.net/wixilekuli.java
a game in 18 lines of code ```package me.gstudiosx.game;
import me.gstudiosx.secret.BasicGame;
public class TestGame extends BasicGame
{
public void update() {
}
public void render() {
}
public static void main(String[] args) {
new TestGame().setTitle("Test Game!");
}
}```
it does nothing rn
xd
btw me.gstudiosx.secret.BasicGame is in another module so technically its 1 file 18 lines of code
With ur logic minecraft with one line of code would be possible
lol
im saying it doesnt count as apart of the game until its compiled
anyway i fucked up some how with modules and i cant compile it to a jar rn
so im running it with intellij
xd
it keeps trying to search my module in the fucking repo full of all stuff like lwjgl and more