#help-development
1 messages · Page 102 of 1
The same applies not to just loops
testA: {
System.out.println("Alive code");
if (Boolean.valueOf("true")) {
break testA;
}
System.out.println("Dead code");
}
this is a thing?
Yes, pretty useful from time to time
31 1F 00011111  US Unit Separator
Uh, no. No idea why a plugin would use the Unit seperator char
bump
#1014501962907140167 bump
upload again
delete the prev
or in your case upload both again
and delete the previous
why "<string>" it's red?
How can i fix?
String not string
java.util.ArrayList; is already imported wtf
I wasn't talking about array list
The List interface is wrong
Which, you have a wild card java.awt import there
Generally you don't want to have a java.awt import
if i require a instance of my main class in a file handler (to call getResource) should i grab that instance over the Bukkit.getPlugin method, or should i create an object of the file handler class, pass it the main instance, handle the file, then discard the handler class, or should i make the file handler class an object in the main class and pass it around from there?
apparently minecraft:brand sends it as first byte
no idea why
looks bloat lol
trying to get rid of as many fields as possible
anyways how do i do like syntax highlighting for true and false in javadocs? tried {@link true} but doesnt seem to work?
try <code>true</code>
i guess that works
all LivingEntities have attributes
unless you are doing it all fake entity with packets, you have attributes
myMob.getBukkitEntity()
then its entity.getAttribute(GENERIC_MOVEMENT_SPEED).addModifier(...
yes
you are not using packets for everything which means they exist in the world
if they exist in the world they have a Bukkit entity
the better question is how to get the bukkit entity
I already said above
Unless they use CB entites that is, at which point it is trivial
Isn't there literally Bukkit.getEntity(UUID)
I mean yes
he already has the NMS entity and it exists in teh world so it nmsEntity.getBukkitEntity()
Oh lol
I knew that there was a better way
Is this where the .jar generates
bump
is there some alternative for Validate.notNull(Object, String) in the java.lang package?
try Player#setPlayerListName
bump
you mean passing the instance from elsewhere?
i mean just do FileHandler f = new FileHandler(plugin); h.doStuff()
I tried, it's hard
reflections time?
can someone help me about yml configuration
for example if i have key called Items and inside of that key i have 3 other keys called KitPvP HCF and Practice how would i get list of them
for example if someone adds even more key to Items key
i would like to grab all key inside Items key and have it as list so i can grab size of list
The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...
yeah i know for this but im not able to find what im looking for
anyone know how to create an npc and check if it was right clicked?
getConfig().getConfigurationSection("items").getKeys() probably
that really could work
i will try and let you know
there should be boolean in getKeys()
what should that boolean represent
if you know maybe
What is the "Native Minecraft Version" of a plugin?
i would guess it is the version that is provided in pom.xml
.getKeys(false)
i wrote it for every version
like i started in 1.7.10 and ported it to every version
well i dont really know put something hahaha
XD
@eternal oxide umm yeah hi that didnt really work for me Items key is not empty it has 3 keys in it but it displays 0
hmm would it matter where i put my benchmark class for jmh?
probably create a benchmarks package or smth
it is default config.yml and there is key Items and in that key there is 3 others but with your method it does not work properly it displays 0 instead of 3
show some code
show some code
change to true and see what that gives
still 0
I'm going to guess the config you think is in your jar isn't
but it shoudl be null on the getsection if that was the case
bruv
what do you mean ahhaha
sounds like a @e
what is their normal generic speed?
oh its flying
set their fly speed
sysout its base value so you know what you are changing
few minutes now, what have i done
@eternal oxide did you found answer to my problem myb
These benchmarks take half an hour easily
No
the longer they run the more accurate they are
?jd-s
how do you guys have permission to send pics here ?
mye makes sense
i should find a good tutorial about how to use them
No, Vexes don't have a FLYING_SPEED attribute
no, basically this attribute does not exist
Flying Speed is for Parrots and Bees
And players I guess
Surely they use movement speed
What did you set it to
Default for Vexes is 0.7
Change it to like 0.2 or 0.1 and see what they do
...
Well you're constantly telling them to move there lol
Can someone help me with this so this is my config.yml that is default config in resources folder and all i want to do i just get number of these keys in key called "Items" there is now 3 but idk someone might put 20 i really dont know so basically i just need help how to get that number and here is another picture of my java code that prints to cmd number of keys but at the moment number is 0 even though there is 3 key inside "Items" key
Change it to getKeys(false) and see if that makes a difference
tried that it is still 0 false or true doesnt matter in my case
Oh, wait no. It's probably because the values are null
nope
Well that's not going to work either, set an actual value to them.
okay sure
:/
still 0 even though i set string value to each
Are you saving and reloading the config?
realoading in which way ?
Restarting the server, /reload, or calling reloadConfig()
i fully stop server and then run it again
And the config is changed?
yup
If you reopen it in Notepad or something
Wdym activate the goal? Once you add it to their goalSelector it's added
Yeah
well now i removed folder from my plugins folder totaly i restarted server and i get a error
Oh that works too all good
okayy
Whats GermitHC line 200
uh oh
I mean, where do you define myMob ??
@hasty prawn i fixed that error and i restarted server and still 0 even though i added strings on each key
inside the player events
what
wtf is going on
your listener is also a mob goal ?
?paste the new yaml and the code again
this is not how object orientation works
you are creating a new player events
and then expect your own instance's value of myMob to magically not be null
Change getKeys(true) to false, and set your YAML to this:
Item: "NETHER_STAR"
Size: 27
Items:
KitPvP: "yes"
HCF: "maybe"
Practice: "no
still 0
That... doesn't make sense.
well i really dont know
i added to player interact event so when i click on selector
it grabs those key and print in cmd
and 0
or just []
depends if i put .size
Print getConfig().getKeys(false); and see what it says
public boolean isLunar() {
return lunarManager.getLunar().isRunningLunarClient(entity);
}
private LunarClientAPI clientAPI;
public boolean isLunarInstalled() {
return Bukkit.getPluginManager().isPluginEnabled("LunarClient-API");
}
public void setupLunar() {
if (!isLunarInstalled()) return;
clientAPI = LunarClientAPI.getInstance();
}
public LunarClientAPI getLunar() {
return clientAPI;
}
any ideas why getLunar() returns null on isLunar?
setup lunar runs on startup btw
Is your plugin loading before that Lunar one?
.setupLunar could be bork if it is run in onLoad or onEnable
wdym
Okay and print getConfig().getConfigurationSection("Items").getKeys(false); now
isPluginEnabled returns only true once the plugin finished executing .onEnable()
NOOOOOW IT WORKS
how so ?
na na i logged getLunar() after setupLunar() on startup and it logged the correct thing
So it isn't going to the return; thing
Make two separate classes, not a nested one
I mean, wat ? How do you have an issue here ?
you can still grab the NMS instance through the getHandle() call
just, like, store the getHandle() result in a variable ?
The handle IS your mob
can anyone tell me the basics of packets and how theyre useful
Already done by default by bukkit
maybe i should schedule it, because scheduler runs after startup is completed
Server talk to client, client talk to server
((CraftVex) newVex).getHandle().goalSelector.addGoal(0, new MyGoal(((Mob) ((CraftVex) newVex).getHandle())));
to
final var vexHandle = ((CraftVex) newVex).getHandle();
vexHandle.goalSelector.addGoal(0, new MyGoal(vexHandle));
vexHandle.otherStuffHere()
like there
as in using packets to do soemthing, not literally themselves
Basically packets are a bunch of bytes prefixed by length and most often an ID to identify the packet
idk what your issue is here
i just feel like it looks like a hacky workaround
They are, usually.
https://paste.md-5.net/hotetuhohu.bash error btw
Yea maybe try to learn some java first 😅
Spigot has most the stuff you would ever need so we don't have to use packets.
especially the deep dive into NMS will need some strong fundamentals
alright
True, reading and understanding Mojang's code sometimes requires a massive brain
the only packet i've ever sent was a demo mode screen popup that was released in some beta version or soemthing
Again are you sure that setupLunar does not run return;
it apparently still exists today
It does
If you are, you are never calling setupLunar
(or running it too late)
it does not for sure, because i have
System.out.println(isLunarInstalled());
after the if statement and it returns true
i'm past the pit of despair in java i think, i'm actually starting to get a grip on more things instead of jamming stackoverflow code into my plugins
public void setupLunar() {
if (!isLunarInstalled()) return;
clientAPI = LunarClientAPI.getInstance();
System.out.println(isLunarInstalled());
}
And LunarClientAPI.getInstance does not return null?
but i still sout everything if i encounter a npe
i can add a check, where should i do that?
Within your setupLunar block
That's called debugging and that means you're doing right!
public void setupLunar() {
if (!isLunarInstalled()) return;
clientAPI = LunarClientAPI.getInstance();
System.out.println(isLunarInstalled());
System.out.println(LunarClientAPI.getInstance());
}
like this?
Yeah
isnt getLunar() is nulL ? try print that out
Also if LunarClientAPI extends JavaPlugin you are better off doing clientAPI = JavaPlugin.getPlugin(LunarClientAPI.class);
Btw, I think this sends the Demo screen..
((CraftPlayer) player.getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.DEMO_EVENT, 0));
Though that only works with Mojang maps, you'd have to find the obfuscated names if you're not using them.
17:47:19 INFO: LunarClient-API v${git.commit.id.abbrev}
okay
That only leaves out the possiblity that you have multiple instances of LunarManager
yeah that is true
I provide custom item to player and each item will have its own distance and I will use them for event. What should I do if I want to access the distance of the item the player holds?.
I guess that should conclude the search
one is in PacketPlayer and one is onEnable
Unless that is fully intended and you are running .setupLunar on both instances and both run as you like
Are you sure that it does not teleport them?
It is probably the move method used by endermen
u mean a moving counter ?
if u need help pm(VN)
moveTo is just a teleport yes, if you wanna have a mob navigate, you'll need to grab a mobs navigation
1.18.2 has a method for this
Player#showDemoScreen()
Demo screen? did I miss smth
why would one want this
I actually use it at work. It shows basic controls like WASD and whatnot
You can also change the text on it using a resource pack
ooo
just a method.((CraftVex) vex).getHandle().getNavigation().moveTo(x,y,z, speed); or if you already have the handle, handleVariableName.getNavigation().moveTo(x,y,z, speed);
this is the error also
i think the problem is that i converted set to list but im not sure how to use sets
pwease use ?paste
sure sure
i really dont see where is invite ?
OPH
OH
yeah sry
it is lore that is normally on item in gui
it must have embeded it HAHAHA
sry i really didnt see it but ill paste it rn
?paste
all
no no this is like lore for gui so when someone hovers over item it will show lore and in lore is that invite
so discord probably embeded it
Hi, I was on the doc and saw that getItemInHand() was deprecated and I now can use getItemInMainHand() but it doesn't work for me, like it doesn't exist
what is this line ? GermitHC.java:210
ItemStack stack = new ItemStack(Material.valueOf(getConfig().getString("Items."+modes.get(i)+"DisplayItem")), getConfig().getInt("Items." + modes.get(i) + ".Amount"));
your name is null
do you have the correct path?
Items.KitPvP.DisplayItem
getItemInHand is a method of the player inventory, not the player
modes.get(i) should get KitPvP
You are missing a . before the word DisplayItem
Oooh right, thank you
yea ur missing a dot indeed
correct ill try if works now
well
now it is working
but now im not sure what to do
it only did like 1 item
one sec
let me do reaload
and ill send you ss
im not sure if i picked the right loop to do this thing
@mellow pebble
List<String> modes = new ArrayList<>(getConfig().getConfigurationSection("Items").getKeys(false));
int numberOfModes = getConfig().getConfigurationSection("Items").getKeys(false).size();
right here why don't you get the amount using modes.size();?
good question
should i change it ?
i mean it does the same while being more performant
your choice but i would
also. you ever heard of ItemBuilders?
they could rlly help u here neaten up your codee
no
bassically a class that helps you easily create itemstacks
i know i mean im not sure if this loop is even good for the thing that i want to do
i just want to in each loop
use another part of config.yml
to set 3 items
in gui
with lore
and on right slot that is set in config
im pretty sure u dont even need the amount then
just loop over the string list
and use the string as key in the path
String mode:modes
yh
yeh intellij do be like that
well i came to part where it works but not fully
How can I set the damage of an attacker to 0.7 ? I tried using setLastDamage but didn't worked
it only shows only practice item
@EventHandler
public void onPlayerInteract(PlayerInteractEvent e){
if(e.getPlayer().getInventory().getItemInHand().getType().equals(Material.valueOf(getConfig().getString("Item")))){
Inventory gui = getServer().createInventory(e.getPlayer(), getConfig().getInt("Size"), getConfig().getString("MainColor") + "§lSelect a Server");
List<String> modes = new ArrayList<>(getConfig().getConfigurationSection("Items").getKeys(false));
for (String mode : modes) {
ItemStack stack = new ItemStack(Material.valueOf(getConfig().getString("Items." + mode + ".DisplayItem")), getConfig().getInt("Items." + mode + ".Amount"));
ItemMeta meta = stack.getItemMeta();
meta.setDisplayName(getConfig().getString("MainColor") + getConfig().getString("Items." + mode + ".Name"));
ArrayList<String> lore = new ArrayList<>();
lore.add("§7Gamemode for 24/7 PvP");
lore.add(" ");
lore.add("§6 * §fSafezone Teleporters");
lore.add("§6 * §fNew Points System");
lore.add("§6 * §fCustom Enchants");
lore.add("§6 * §fDropdown Spawn");
lore.add("§6 * §fAction House");
lore.add(" ");
lore.add("§7More info on §6§ndiscord.gg/asgard");
lore.add(" ");
lore.add("§7Status: §cOffline");
lore.add("§7Players: §f0");
meta.setLore(lore);
stack.setItemMeta(meta);
gui.setItem(getConfig().getInt("Items." + mode + "Slot"), stack);
}
e.getPlayer().openInventory(gui);
}
again
omg
wait
?paste 😄
but u do understand for all items the lore will be the same right now right
You're also missing another . before your Slot word.
yeah yeah i know lore will be changed
CORRECT
ah yea that will result in all 3 items being placed in the same slot
now it works
i just need to make lores
but do you guys know how should i make "connect" part
like how should i connect player to other server when they click on item
yes thats quite easy
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
you may wanna read this
mb
not that one
thats for the proxy
this one https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/ @mellow pebble
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
i will ty
How can I set the damage of an attacker to 0.7 ? I tried using setLastDamage but didn't worked
Does Crucible have different nms mappings than Spigot?
Yup, I mean that when I hit a player with a sword, the player get the sword's damage, not the damage I set
I can't figure out what mappings they use. They're on 1.7 though so...
oh really?
They're probably using Forge mappings as those were one of few mappings around at the time, and among the most popular for modding
i see
you might need to use this https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDamageEvent.html#setDamage(double)
declaration: package: org.bukkit.event.entity, class: EntityDamageEvent
Because i can't figure out how from the docs. How in the world do i make it rain in 1.12.2?
Should be setWeather() iirc
World#setWeatherDuration()
Tried that and it didn't do anything
World#setStorm() as well
Thanks but how can I get the attacker now ?
Tried that as well
declaration: package: org.bukkit.event.entity, class: EntityDamageByEntityEvent
by using this one instead
Weather is weird in Minecraft. You would have to call storm first
world.setStorm(true);
world.setWeatherDuration(300);```
but .setDamage() doesn't work with
plugin.getServer().getWorld("world").setStorm(true);
plugin.getServer().getWorld("world").setWeatherDuration(6000);
plugin.getServer().broadcastMessage("Rain!");```
That's my code
Inside a runnable
it extends the other one
so it has to
Want the entire class file?
Ok probably IntelliJ who was doing shxt, I replaced EntityDamageByEntityEvent to EntityDamageEvent and then re replaced it by EntityDamageByEntityEvent and now it's telling me that is exist thanks x)
Just gonna see if this works on its own
because I'm fairly certain it should. Though I've known weather to be very finnicky in the past
cheers
just do tha rain dancee
🌧️

yess thats it!
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player player)) {
return true;
}
player.getWorld().setStorm(true);
player.getWorld().setWeatherDuration(300);
// ...
}```
I have this and it seems to rain fine. So there's likely something else preventing yours from raining
public class WeatherRunnable {
private final Plugin plugin;
public WeatherRunnable(Testplugin plugin) {
this.plugin = plugin;
}
private final BukkitRunnable weatherRunnable = new BukkitRunnable() {
int cooldown = 0;
@Override
public void run() {
if (cooldown == 0) {
cooldown = 10;
int randomNum = ThreadLocalRandom.current().nextInt(1, 10 + 1);
if (randomNum == 1) {
plugin.getServer().getWorld("world").setStorm(false);
//plugin.getServer().getWorld("world").setWeatherDuration(6000);
plugin.getServer().broadcastMessage("Clear!");
} else if (randomNum == 2) {
plugin.getServer().getWorld("world").setStorm(true);
//plugin.getServer().getWorld("world").setThundering(true);
//plugin.getServer().getWorld("world").setThunderDuration(6000);
plugin.getServer().broadcastMessage("Thunder!");
} else {
plugin.getServer().getWorld("world").setStorm(true);
plugin.getServer().getWorld("world").setWeatherDuration(6000);
plugin.getServer().broadcastMessage("Rain!");
}
} else {
cooldown--;
}
}
};
public void setWeatherRunnable() {
weatherRunnable.runTaskTimer(plugin, 0, 20);
}``` This is my entire code
Old commented code from testing
But it never rains
i want to go whereever you live :/
First and foremost I'd make a variable for World. I can't possibly imagine it's causing your issue, but it will at least help with readability
alright
do you have weather on in ur client settings ? 😄
lol true actually
Though there's nothing here (aside from the commented out code that needs to be uncommented) that makes me think this wouldn't work
hm
You can turn weather off on the client?
optifine thing probs
I'm not using optifine
ah nvm then
With OptiFine and some Fabric mods, yeah, though if you turn off particles you can disable it as well I believe
in case of sodium, it's here
Oh that just disables the splashing particles
Rain still shows with particles decreased
ah
under details -> Weather there's also an option
for processing of weather effects
It is broadcasting to the world
waiting on my client to load
sodium isn't 1.12.2
do you use optifine?
^
or some optimization mod?
BetterFPS
i don't think you should ever run mc without any optimization mods lol
isn't betterfps like
giving you +5 fps? lol idk
betterfps might be disabling rain then
It isn't cause rain works just fine in singleplayer
aight
so thats not the issue
what's when you just disable the plugin, and do /weather rain
does it rain then?
yes
i saw this and my brain went pokemon
wdym
if (cooldown-- > 0) {
return;
}
cooldown = 10;
World world = Bukkit.getWorld("world");
int value = ThreadLocalRandom.current().nextInt(1, 11);
if (value == 1) {
// Clear
world.setThundering(false);
world.setStorm(false);
}
else if (value == 2) {
// Thunder
world.setThundering(true);
world.setWeatherDuration(6000);
}
else {
// Rain
world.setThundering(false);
world.setStorm(true);
world.setWeatherDuration(6000);
}```
If I were to give it a small rewrite, this should work
So that should work?
omfg i finally made my http-redirection work, gosh

Changed World world = Bukkit.getWorld("world"); to World world = plugin.getServer().getWorld("world");
https://internal.chloecdn.de/
now finally works
(totally not modified hastebin ._.)
Both are equivalent
Bukkit#getWorld() and plugin.getServer().getWorld() (Server#getWorld()) refer to the same method
Bukkit's class just calls the getServer().* anyways
yep
still no idea why it exists then, feels like double-use for no reason
choco, enlighten me
Weather still appears to not be doing anything
answer is probably backward compatibility 😄
like most weird things in the api
Why Bukkit exists?
not really
*the class
more like
why the methods exist, tho they just run another accessable method
so we can do /bukkit:<command> on servers where we cant do /<command>
The Bukkit class is the bridge between API and implementation. Everything works the way that it works because it exists. It mirrors all methods in Server for the sake of convenience
aight ig
And to test i am using a 100% vanilla client now
So if your weather isn't changing by this point, I have a feeling your runnable isn't even being called. Unless you're actually seeing the debug messages that you had
But still... no rain
funny thing, i never actually tested my pasting lol
does this actually work?
https://internal.chloecdn.de/ijukedogat.kotlin
In which case I'm entirely lost
should
inside my main class
private final WeatherRunnable weatherRunnable = new WeatherRunnable(this);
@Override
public void onEnable() {
weatherRunnable.setWeatherRunnable();
}
@Override
public void onDisable() {
// Plugin shutdown logic
}```
oh literally just on startup lol
yeah
And no errors on startup, nothing?
nope

development be like
weather runnable
private final Plugin plugin;
public WeatherRunnable(Testplugin plugin) {
this.plugin = plugin;
}
private final BukkitRunnable weatherRunnable = new BukkitRunnable() {
int cooldown = 0;
@Override
public void run() {
if (cooldown-- > 0) {
return;
}
cooldown = 10;
World world = plugin.getServer().getWorld("world");
int value = ThreadLocalRandom.current().nextInt(1, 11);
if (value == 1) {
// Clear
world.setThundering(false);
world.setStorm(false);
}
else if (value == 2) {
// Thunder
world.setThundering(true);
world.setWeatherDuration(6000);
}
else {
// Rain
world.setThundering(false);
world.setStorm(true);
world.setWeatherDuration(6000);
}
}
};
public void setWeatherRunnable() {
weatherRunnable.runTaskTimer(plugin, 0, 20);
}```
still. Nothing
is this the only plugin on the test server?
Yup
hmmmmmmmm
maybe dumb question, but is your world actually called "world"? most likely
Yup
Do yall know a fix for this? https://paste.hypera.dev/ecawinuzesuzotagowakocaduvicozez.vbnet
Hypera Development's official paste site
most likely corrupted playerdata file
I'm just confused cause the weather should be working
did u try setting storm to true first
where do i find them?
anyone how to create minecraft plugin using vscode?
Read my code
ur setting thunder to true first
deleting it deletes all your items and stuff, so be aware
// Rain
world.setThundering(false);
world.setStorm(true);
world.setWeatherDuration(6000);```
try dis ```java
p.getWorld().setStorm( true );
p.getWorld().setWeatherDuration( 100000 );
the uid.dat could cause it?
That does the exact same thing my code does
uh where is it
just try it
shouldnt
I tried that days ago and it does nothing
uid.dat afaik stores only world-settings itself
ok well idk, if u can help please dm me so i can show u my file stuff and u can help in a vc or smthin
i can't help more than by saying delete/validate your playerdata-file
the reason it kickes me:
of the player who has these issues
because youre sitting?
ah nvbm
didnt see the arrow
i stood up before i tped
like i said, something in the playerdata-file is likely corrupt
either you find out what exactly it is, or you delete the whole file, if you don't care about your inventory and locations etc
?paste
ill delete it so it regerates
best method ig
I've sat trying this insanity for so long that my minecraft world has decided to rain naturally twice
lol
switch (e.getCurrentItem().getType()){
is line 188
Like come on, it shouldn't be this hard to make it rain
well i dont know what that should mean
i dont have anything in gui
i have neather star in hand
i dont click on anything in gui
i tried to repeat that and not showing up again ?
when does that error appear?
not sure
really
just saw it happends
i mean i have some issue with my gui
because it doesnt set items in it as it did like few mins before
usually that happens when you click on empty slots (aka null-items)
i tried clicking on those and nothing happend
no error in cmd
public void onInventoryClick(InventoryClickEvent e){
switch (e.getCurrentItem().getType()){
there's so much wrong with this anyway
sec
so... I'm just gonna assume spigot doesn't work for weather control
It does
try to search on spigot forum maybe someone had problems like you
Tried already
Couldn't find anything helpful
https://internal.chloecdn.de/ilefekukir.java
Just as a start, this should make the error disappear
still no idea why these urls don't show anything lol
urls ?
idk how theyre called
embeds i think
for example
this
dunno how i can make this for my url, but idc to be honest
owner of which website ?
google it
i see
you can make it easily
plenty of tuts on internet
would be something with meta tags
im bored
yes
pog
whats the use case for lazy metadata
well to be honest people from india are really good in java
there was this guy on yt, i suppose from india
who literally teached me completely how to code
loved himn
but most people i feel, just have bad mic's and sound awful cuz of that
lol
no one really knows how to code in the internet, if they do then they use discord
That hasn't really been my experience
almost every indian i see, doesnt know what are naming conventions
funfact: game doesn't even have raytracing that works 
my experience is that indians are good at setting up bad tech support scams
i love youtube
or what is di
honestly, theyre not even bad
i feel like indians make the best tech scam callcenters i've ever seen
yea thats pretty easy when ur pretty much the only ones doing it
oh boy
maybe you don't get scammed by them, but you're far away from their "audience"
70 y/o granny doesn't know what you know
they're the most vocal type of scammers i feel like
there's some scams that are the scariest shit
i had 1 call in my entire life
going along with em making em frustrated
wanted to sell me a fridge 
i was like "uhh, i don't need a new fridge, mine works fine"
and i got 200 answers on why their fridge is the best
for like 2k euros 
only 2k? 😮
mine was like 200€ or smt
I never pick up my phone, so I naturally don't get such calls
still no idea on this:
private final BukkitRunnable weatherRunnable = new BukkitRunnable() {
int cooldown = 0;
@Override
public void run() {
if (cooldown-- > 0) {
return;
}
cooldown = 10;
World world = plugin.getServer().getWorld("world");
int value = ThreadLocalRandom.current().nextInt(1, 11);
if (value == 1) {
// Clear
world.setThundering(false);
world.setStorm(false);
plugin.getServer().broadcastMessage("clear!");
}
else if (value == 2) {
// Thunder
world.setThundering(true);
world.setWeatherDuration(6000);
plugin.getServer().broadcastMessage("thunder!");
}
else {
// Rain
world.setThundering(false);
world.setStorm(true);
world.setWeatherDuration(6000);
plugin.getServer().broadcastMessage("rain!");
}
}
};```
The broadcasts work but it just doesn't rain
i pickup my phone only nowadays when i know the number, or it says my mom or smt
else i don't pick up anyway
for me its rlly easy tho. as soon as they speak english i know its a scam
especially if it's from outside of germany
i have never gotten a call in english that was not a scam
same actually.. either some scam, or some weird spigot person who found out my phone nr
What
mfnalex
Oh that guy?
lmfao
Anyone?
Or you guys gonna keep talking about phones in a help channel
He is german you know
got it. this server is as useless as i remember
uhuh okay buddy
?jd-s fine
Tried already. Using the same methods on there and they just do nothing
i'm very aware
Does anyone know what's wrong with this?
what happens if you call https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#setClearWeatherDuration(int) on the next tick?
With what duration
Well you basically move your setClearWeatherDuration call into the next tick
And on next tick do you mean make a runnable and delay it? or just put it after my code?
Also, are you perhaps in a biome where it does not rain?
Yeah, just a 1-tick delay runnable
huh odd
What would set clear weather even do
Cause from my understanding it clears the weather
when i need it to rain
oh right
🤦
??
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/CraftWorld.java#1035-1037 yeah no clue. Would need to do my own testing there. Just a sec
I'm also in 1.12.2 if that helps
if (value == 1) {
// Clear
world.setThundering(false);
world.setStorm(false);
plugin.getServer().broadcastMessage("clear!");
}```
This works and clears the weather at least
else if (value == 2) {
// Thunder
world.setThundering(true);
world.setWeatherDuration(6000);
plugin.getServer().broadcastMessage("thunder!");
}
else {
// Rain
world.setThundering(false);
world.setStorm(true);
world.setWeatherDuration(6000);
plugin.getServer().broadcastMessage("rain!");
}```
But these do not make it rain or thunder
well the thunder one defo wont work
according to md_5 it has to be storming before it can thunder
alright easy fix
Try swapping the thundering and the rain. also ^^
?
Try the setStorm before the setThunder(false)
Didn't fix anything
did u also try calling setWeatherDuration a tick later?
okay so for
entity.setMetadata(name, new FixedMetadataValue(plugin, "")
do you have to put the plugin in or what is that needed for (could i just put null
since for example setStorm also calls setClearWeatherDuration(0) to reset the world's weather
I advice passing ur plugin
Altho I wouldnt advice using metadata at all
PDC is much more robust
So by that logic shouldn't it just work if i don't call setWeatherDuration then?
Which it doesn't i've already tested that
pdc?
PersistentDataContainer
?pdc
An api to interact with different minecraft objects’ data
Well your own data most likely
Best way to make it rain i have found is to just make the plugin run the weather command. But then admins end up seeing the plugin running the command and we don't want log admin commands turned off
package de.geolykt.test;
import java.util.concurrent.ThreadLocalRandom;
import org.bukkit.World;
import org.bukkit.plugin.java.JavaPlugin;
public class TestPlugin extends JavaPlugin {
@Override
public void onEnable() {
getServer().getScheduler().scheduleSyncRepeatingTask(this, () -> {
World w = getServer().getWorld("world");
if (w == null) {
throw new AssertionError();
}
ThreadLocalRandom tlr = ThreadLocalRandom.current();
if (tlr.nextBoolean()) {
w.setThundering(true);
w.setStorm(true);
} else if (tlr.nextBoolean()) {
w.setThundering(false);
w.setStorm(false);
} else {
w.setThundering(false);
w.setStorm(true);
}
}, 100L, 100L);
// TODO Auto-generated method stub
super.onEnable();
}
}
Works great on Paper version git-Paper-135 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT) (Git: eff22eb)
(outside of the thundering bit, but that was to be expected)
I am on 1.12.2
It's very, very possible that 1.12 had broken weather. Again, I know it was horrible back in the day, and I recall a few commits that were meant to fix a few aspects of weather
I've actually specifically committed some code for weather in the past
Yes, which would mean that it has to be a server issue
Any fix or work around would be great
AsyncPlayerChatEvent
does anybody know good github repo that can be used for core tablist
like this one
how I start plugin writing??
Do you know java ?
yes I know I think I start from java
You'll find everything here https://www.spigotmc.org/wiki/spigot-plugin-development/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
It's quite well written
That's old school 😮 In the good old time it used to be TabAPI the newbie API
yeah packets are used
but i know there are like apis or something like that on github
why does this happen?
@Override
public void populate(WorldInfo worldInfo, Random random, int chunkX, int chunkZ, LimitedRegion limitedRegion) {
for (int iteration = 0; iteration < 50; iteration++) {
int x = random.nextInt(16) + chunkX * 16;
int z = random.nextInt(16) + chunkZ * 16;
int y = 319;
while(limitedRegion.getType(x, y, z).isAir() && y > -64) y--;
if(!limitedRegion.getType(x, y, z).isAir()
&&limitedRegion.getType(x,y,z)!=Material.WATER
&&limitedRegion.getType(x,y-1,z)!=Material.OAK_LEAVES
&&limitedRegion.getType(x,y-1,z)!=Material.OAK_LOG) {
limitedRegion.generateTree(new Location(Bukkit.getWorld(worldInfo.getUID()),x,y,z),random,tree);
}
}
}
but it is outdated
or i dont really know what to say
it just doesnt work good
or it is not working
use a packet wrapper ig
there is ziggurat
i guess that is an api
i have it compiled and source code
All versions under 1.19.2 are outdated
and i dont really know like how to use it
if theres no specific api for it you need to do packets yourself
well some people have it up to date but yeah
or using packet wrapper
well i can add it as dependency
and external library
but im not sure how is it used
TabAPI or packet wrapper ?
well i never used packet wrapper
Well you don't even need a packet wrapper, just use NMS to send fake players with empty names
never did that too hahaha
well everything is painful if it is first time
then how does it use its code
I like pain, that's why I hardcode all NMS version with reflection 🌚
Don't import spigot-api but spigot
You clearly dont know what im talking about
declaration: package: org.bukkit.entity, interface: Player
Yeah I was too lazy to scroll up actually. But who never try never win
if you depend on spigot, you can use gson
it does not
but if you depend on spigot, you cant use nms
bump
wha?
Spigot uses Spigot-API and NMS
The API doesn't use NMS code
AHHHH
The API is just a bunch of interfaces
Spigot-API is just a bunch of interfaces, Spigot implements these interfaces on minecraft classes
More or less that is
u cant mix them, no
its possible with a lot of trickery
You can, but why would you
why would you ever need that
but it isnt worth it
stopid dependency ;/
Meh, it isn't that much trickery, but you need to have a bootstrap plugin
#plugman
In fact it is quite supported
Although you are likely to find a few bugs along the way because usually you wont do that
So I'm trying to run a command when a player right clicks a specific book. However it's not executing the command.
Here is the code:
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
if (event.getItem().getItemMeta().getPersistentDataContainer().has(new NamespacedKey(plugin, "revive"), PersistentDataType.STRING)) {
event.getPlayer().performCommand("revive");
}
}
}```
Any ideas why it's not working?
u sure the item has the pdc key?
also nullable item meta
Oh sorry, wrong reply.
Hover your errors, the IDE is made to help you
data.set(new NamespacedKey(plugin, "revive"), PersistentDataType.STRING, "revive");
tome.setItemMeta(tomeMeta);```
Third times the charm lol
I mean, insepct the item ?
TIPS: try to import the good scoreboard
in game
How do I inspect in game?
TIPS 2: try to name your class and constructor the same
Commands be wack
and then hold the item in your hand
ohh that one is hard man
yep its there alright
Wait, you can find the data?
ye right int he middle
did u register ur listener? 😮
Nope
😄
The amount of times I've forgotten that step is surprisingly high.
Probably just assumed I already knew lol.
@viral hazel are you alive?
What's even funnier is I had registered the events earlier, but deleted it when I deleted the original event.
Wait, it's still not working.
and you're 100% its registered now? 😄
Nevermind, I registered the wrong class. My brain is fried today lol.

But hey. That part of the plugin is now done so I no longer have to worry about it lol.
Is there a way to get the location of each entity in an 8 blocks radius around the player?
untill it breaks for no reason 😄
yes
Wait, do persistent data containers stay after restart?
well its kind of in the name isnt it
And what is it?
Persistent data container
Grab player location and check nearby entities
I've had them glitch sometimes on me.
But here's to hoping they don't!
No but I need the location of each entity in there
declaration: package: org.bukkit.entity, interface: Entity
then just get their location after you checked for them around the player location
use this and get their location
I'm kinda new to plugin development so sorry, but you can't the location of nearby entities , how can I separate them so I have the location of each entity separated from the others
learn java moment
uhh i dont quite understand ur question
getNearbyEntities returns a list
Uhhh, yes you can. Entity#getNearbyEntities()
What's your goal?
how would you name a class that adds/removes managers and some other functions that does multiple of those?
ManagerManagerHandler
it requires 2 strings
a header and a footer
as seen here on the javadocs which you should reaaally use https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Player.html#setPlayerListHeaderFooter(java.lang.String,java.lang.String)
declaration: package: org.bukkit.entity, interface: Player
mate the method still takes two paramters
uhhh?
even if you call another one after that
2 strings in the one method
setPlayerListHeader is what you are looking for
or that ☝️
can someone link me mnfalex blog for static methods?
player.setPlayerListHeaderFooter("header", "footer");
or
player.setPlayerListHeader("header");
player.setPlayerListFooter("footer");
🥄
?event
which, maybe start with some tutorials on spigot and its event handling ?
isnt there an event wiki command? f
?events
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
?help
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
?cleanup
Syntax: ?cleanup
welp that didnt go as planned
Wen slash commands
i thought it prompts the bot to remove its own messages -.-
yea there was a list made on the wiki
wat
Slash commands > ?
with slash commands you would not be failing to find the events command
Slash commands are amazing
😛
then that's the bot's fault. if the bot can't provide you with the command-info
The only people who dont like Slash commands are the people who dont know how to use them
Well the bot would not have to do that if it were using slash commands which are nicely integrated into the client
and offer an inbuilt search function
or people who just don't like that fact that you cannot use space for arguments
it's preference ig
wat ?
huh
you use tab to go to the next arg
Can I manually set the latest version for a plugin of mine?
ahh
gonna need more context than that
I mean I guess, but it makes commands less fucky to work with
Right so I have made versions for all mc versions for my plugin
Because you can put spaces in your actual argument
i'm used to have space go to the next arg... obviously
They're divided this way
so i'll probably never go switch my bots over to slash commands
However since the last one I uploaded was Crucible 1.7.10
it thinks it's the latest version
But I want the latest version to be Minecraft 1.19
Spigot is backward compatible since you don't use new features
I thought they were forcing it in the coming months
anyone got experience with custom models with model engine who could teach/guide me
maybe a tutorial
i think you gotta ask someone who knows what youre doing with that website ur using tbh
how should they
Spigot's lol.
not NMS
?-commands just listen to the Message send event
i never had that issue
it's just checking for if a message starts with a specific char
"September 1, 2022 is the final switchover date. This means that, if the developer of one of the apps you’re using has not made the switch yet, parts of the app might not work after that time"
I guess it depends on what they mean by switchover
Use reflection
That's tomorrow 
so if they want to force that, they'd need to remove the ability to listen for messages
Discord is removing message send event perms for big bots unless you apply
I think it might just be for verified apps it's forced
