#help-development
1 messages · Page 2224 of 1
cant you do substring zero six equals story
what are namespaced keys
Basically a key that links to a specific message / resource in the client
minecraft:cow for example
yea sure
sounds like startswith but with extra steps
Ive been smacked around with regex for a while so i adapted to that
i was unaware this method is better
okay so would there be a way to get the advancement title from a key?
or would i have to check for every advancement name
It's all localized
I doubt NMS has that
If you change your game's language
the name changes
mmm
resource pack
so i'll have to manually do it then
and the en-us.config
I've told myself screw it and done everything in en-us since
manual it is then
targeted audience amir
I guess you can convert this to yml or something
😳
to be fair the only other big language is chinese and they have their own minecraft
ty
exactly
eh thats about it
it's extremely useful to extract the default resourcepack
🇪🇸 ?
I have an empty 120gb ssd with minecraft's defaults
thats a politic language not a internet one lol
your final pack should only include what you’ve modified
and not default textures
I only say this because there's a ton of info stored within the packs
I can fetch the language files, check any existing textures
mhm..
parse the blockstate .json files
other files are also stored deep in the client
Like files for what tools can break what
use mods (fabric)
According to this map the biggest languages are: 🇺🇸 /🏴 > 🇩🇪 > 🇫🇷
I fetched this from the client and converted from json
german minecraft community is big
Germany and France have big datacenters
tf are you on about spanish then
Frankfurt 😄
But they're not that big in terms of actual players
nuremberg trials
For big communities, there's brazil
actually germany has a quite high number of research institutes in computer science iirc
Spain sometimes
Although brazilians often play in spanish servers
As the language is pretty similar
Some french, some german but not that many
Arabic people have their own community zone and don't touch on international servers other than hypixel
Did Fortnite become more popular again?
1.8.8 did fall again from 7% to 6.7%. Its now down from 8% in about 2 months.
Guys
If I reached here ( Code academy)
Is it good to Make a Medium Level Minecraft Minigames Server ?
I just wanted to imply that 1.8.8 users are all Fortnite kids.
you're doing java basics, you still have a lot of practice to do before minigames
more like csgo addicts
doesnt hypixel run that
hypixel runs 1.7.10
ah
They dont run spigot
modified to 1.8
heavily forked
No no , Like SkyPvP, PvP , KBFFA , Lobby systems
Yes. You cant really call that spigot anymore
Sure. You can write all of that from zero if you are quite dedicated in about 1 -> 1.5 years
somewhat
cookie clicker 🤣
I might still have one of their interview code test files somewhere
What the
Okay how about the PythonPluginLoader is it Good as I'm a Python Professional Developer
python 🐍
If you are a python professional developer then you can learn the basics of {generic-programming-language} in a few days
objects in python are similar to java
i had a very easy time learning python after java
XD
I really dislike python. The only thing im doing with python is training my reinforcement models.
To me its useless outside of data science.
I have made a social media website with python man
Anyway
Is it good or no
In PythonPluginLoader
That's the only question
i wouldnt bet on it, but i dont know enough to say for sure
Its quite limiting
personally id do java
Okay I will use it until I completely understand java
Isnt this like a decade old?
For anyone interested, and given I didn't sign an NDA, here some hypixel interview code (task was to point out literally everything wrong) https://sourceb.in/BEWsKTGYhP
java is definitively older
they still use a form of spigot
python is from 1991 iirc, java from 1998
I don't have any other solutions
oh didnt meant it like that
Oh god right away: Set<Player>
Jar does not contain a plugin.yml
Apparently not
ayo 7smile7
did you spot the instanceof mistake?
not into your package
line 98
Im still ranting about the whole line 65 method. Everything in there is garbage
lol
I had 5 mins to point out as many things
they were surprised when I spotted a <bukkit entity> instanceof <nms entity>
Hope you didnt point out that the bitwise 'and' was a mistake because you could actually do that
Nah I didn't
I actually failed to get the job due to my lack of minigame development and microservices experience
or maybe due to my time management skills not sure
but def not due to code stuff
hey all, sorry to just pop in like this, what is 'generic movement speed's unit? 0.3 seems to be +- player speed but i want to know exactly what it is
game.getPlayers().stream().forEach(player
Unnecessary overhead. You dont need a stream pipeline for 'foreach'
Here's what I got in like 5 minutes
I mean this is a gold mine for spotting mistakes. But 5 minutes seems a bit tight.
mentioned some other stuff after but I was low on time
Ususually data like this is mentioned in wikis.
thanks, i just got more confused, but thanks
player speed 0.1, zombie 0.23, but players are faster even walking
player speed 0.1 whilst not sprinting i believe
The movement speed attributes are all relative lol
i took a zombie and made him target a villager, i outrun him walking
They really are just arbitrary numbers
awh man...
Does anyone know how to update a spigot server? I am trying to update mine to 1.19
oh
Always backup though in case something goes wrong and your world is corrupted for some reason
Not likely, but it happens
Isn't forceUpgrade also required?
Not required
but you probably won't lag when loading chunks nearly as bad because it does it all at one startup
If you're on a small community server, it's not nearly as big of a deal
I have already created the backup, I know where to get the 1.19 jar but I don't know what is specifically replaces
Whatever you use to run your server. spigot.jar, spigot-1.18.2-R0.1-SNAPSHOT.jar
Something to that degree
I use a run.bat file
Yeah and it runs a .jar file
If you open that up it will look like java -jar something.jar
That something.jar is what you want to replace
so should I just drag and drop the builtools.jar in to the server folder?
what does your run.bat file say
A lot of that wiki really is just a word salad tbh
It all boils down to
- Put BuildTools.jar into a folder
- Run it with
java -jar BuildTools.jar --rev 1.19 - Let it run for like 10 minutes or so, then it'll spit out a server .jar for you in the root directory
replace your old server.jar or whatever name it's under with the new 1.19 server jar
Coughs back
woah 6 feet
spits
I love looking at code
@worldly ingot @quaint mantle much appreciation to helping me! It worked, have a great day
i love looking at better code than mine
and making fun of my friend’s worse code
how do i include jdbc or whatever the sql conector is
does anyone know the maximum speed of a minecart before it derails in corners?
or how I could find out that speed?
you could probably google it
Hello everyone, i'm trying to get the global amounts of a specific item in an inventory. My code is : for (ItemStack is : inv.getContents()) { if (is != null && is.getType().equals(Material.GOLD_NUGGET)) { numberGolden.add(is.getAmount()); } } and i use an arraylist with integer, my problem is that this method store only 1 nugget per slot instead of for example, i have two stack of golden nugget so a total of 128 golden nuggets and this method return me only 2 golden nugget (like 1 per slot), hope you understand
yep
Why the heck do you use an array list to count?
public static int countItems(Material type, Inventory inv) {
int amount = 0;
for(ItemStack item : inv.getContents()) {
if(item == null) continue;
if(item.getType() == type) amount += item.getAmount();
}
return amount;
}
Coffre verrouillé c'est avec un é et pas un er :)
how do i include jdbc or whatever the sql conector is
what?
C'est un detail x) je rush le code
english please, ir use https://translate.google.co.uk
Google's free service instantly translates words, phrases, and web pages between English and over 100 other languages.
I'm just pointing out he made a typo in his code lol (french)
public static int countItems(Material material, Inventory inventory) {
return inventory.all(material).size();
}
that would return 2 if you have 2 slots with 64 items each
how do i include jdbc or whatever the sql conector is
Oh then map the amount
Hey, I wanna work out how to do something with vectors but I'm really lost as this is out of my depth. Anybody able to help?
can you stop asking this every 3 minutes?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Got small problem which I am not sure how to fix
i want a damn answer :)
public static int countItems(Material material, Inventory inventory) {
return inventory.all(material).values().stream().mapToInt(ItemStack::getAmount).sum();
}
maven doesn't replace stuff inside java files, only in resources, unless you enable it, but it's nasty. Just get the version from your PLugiNDescriptionFile
ok
I managed to replace ti but this was result
you don't have to replace it in your .jar file
just do Plugin#getDescriptionFile().getVersion()
I know
So I wanna spawn tbt flying off in different directions in this sort of shape where the holes are, how can I do this? https://i.imgur.com/WTXfnVM.png
Spigot provides the jdbc driver for MySQL already. If you want another DB then you need to shade the driver by using maven/gradle.
but I wanted to be sure user can't change it
they can always change everything inside your .jar
ok so i can just use it out of the box
Take a vector and rotate it around the z axis.
I got 0 clue how to do all this 😅
use this ver
I could easily replace your string directly in the compiled jar file within 2 seconds https://github.com/JEFF-Media-GbR/JarStringReplacer
Bukkit.getServer().getPluginManager().getPlugin("plugin_name").getDescription().getVersion());
no jeff media needed
- you do realize that this is what I suggested?
- What I sent was to prove that just because they hardcode the string, doesn't mean that a user cannot change it
ok
Something like this
public List<Vector> getFullRotation(Vector first, int amount) {
List<Vector> vectors = new ArrayList<>();
Vector current = first;
double delta = 360.0 / amount;
for(int i = 0; i < amount; i++) {
vectors.add(current.clone());
current = current.rotateAroundZ(delta);
}
return vectors;
}
that is a lot of code for what? Replacing LDC constants?
time to hardcode db credentials :)))))
yes
And then 'using' it
our code
Amd the ClassWriter looks a bit inefficent given that it does not pool the read classes
why should it do that?
Reduced IO
I doubt that replacing a few strings in a .jar file will cause any IO problems
How can i remove symbols like that? I synced a Discord Channel with JDA to Minecraft
But writing would
Now it isn't that problematic given that that would never be used as a lib, but eh - still pains me
it takes about a tenth of a second to run this on any of my plugins. I don't consider this to be a problem at all
I already tried to change
String message = event.getMessage().getContentDisplay(); to String message = event.getMessage().getContentRaw(); but nothing changes
I'll see if I can get it faster eh
ok
looks like Main.getPlugin() returns null
yes
obviously it always returns null
you never assigned any object to the "plugin" field
just add this:
{
plugin = this;
}
okay, why does it depends on spigotNMS?
Here is a visual explanation of what the code ive sent does
because otherwise it fails to load certain classes
just try it. set the scope of spigot to provided and try to replace stuff in a spigot plugin
I see
how does one query db outside of main class
the same way as in your main class
so we e reconnect?
I feel so extremely dumb for asking, but I'm using the 1.8.8 spigot API and I can't find dye, I've tried searching but it doesn't appear to exist. Is it under a different name which I am not aware of or am I just being stupid?
I gotta work out how to make it spawn more than just one, it seems to be just spawning one tnt right now
What do you mean you cant find dye? thats a pretty vague question
As in you cant find the Material?
Yes
You use ink sacks and just set the item data
Before you do anything with databases you should 100% learn the basics of java.
There is no reason to begin with a Database. Write your data in Files first.
Thanks, I'm resigning from life now.
Nah don't worry, that shit was mad annoying when i first started
Make use of the https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/material/Dye.html MaterialData if you insist on using 1.8
why would i write data in files? one server issue and adios data
Why do you use 1.8 anyways? Nobody plays this ancient version anymore.
I honestly don't know why it's just spawning 1 tnt now lol
Dye dye = new Dye(DyeColor.GREEN);
dye.toItemStack();```
pvp 💀
1.8 is the last version with a decent pvp version
It's the version I play a lot and am normally on, so it's just easier rather than having to switch versions. I used to use the 1.16.5 api but switched because of this.
1.9+ pvp is so good 🥰
it Actually is
if "spamming left click" means "decent pvp" to you, then yes
This makes no sense. If the server that runs the db has such issues then you have exactly the same problem.
No?
all those people claiming "1.8 pvp was better" are just too stupid to properly time their attacks lmao
the db is on a seperate server to the host
It's also movement+somewhat ping based, really annoying some people don't go outside and then can kill you easily.
I've played both 1.8 & 1.9 pvp, 1.8 is way better
Just so you can Abuse your CPS?
Yes. What do you mean by no? If a server has corrupted hard drives then it doesnt matter if you store files or a database there.
More like abusing your mouse, but yeah.
True
minecrat 1.8 pvp tutorial: donload an autoclicker
I've ran servers for nearly 4 years and never had a corrupt hard-drive, its way more common a plugin issue cause files to get corrupted than a hard drive getting corrupted
1.8 pvpers cant fathom anything more complex than hammering one button really quick.
Not an argument. A plugin can corrupt a database as well. Whats your point?
1.8 and 1.9 both have flaws
1.8 is just who has better ping
1.9 is let me kill you in 2 hits with my stone axe 💀
My point is that it is way more common? I never said that a plugin cant corrupt a database as well so stop arguing with points I never made
What does have to do the Version with the Ping?
time to make 50 million txt files for every player that has played ever
i just want to store the amount of players they have revived
Fear of file corruption is a very bad argument to make against file storage.
when u use sh*tty shared hosts it's a good argument
The Ones with a Literal Decaying Hard Drive
but yeah, ill use file storage
So you're saying that file storage is better than database storing?
despite database storing being faster and better performing?
Nope. Read again.
and essentially (statistically) being better in every single way
Thats a way better reason.
Other one is still valid
If I have a bungeecord plugin which has an API. Would a plugin on a sub server be able to use the dependency?
Its not even close to being valid
eh my plugin doesnt need multi server support
Then store the data in the players PDC
it's a plugin for the hardcore part of the network
"eh, my plugin only Runs on Bukkit But it's Fine"
Depending on whomever is running the plugin, yes it is
Those are completely different applications which only communicate through packets. You could expose the API by
implementing a packet protocol.
Sure. "This dev is bad. Lets give him access to the DB instead of local files because he might corrupt those."
How?
word
do i use
File myObj = new File getPlugin().getDataFolder()"/filename.txt");
```?
Not what I meant, if someone is using shared hosting with a reputation of unreliable hard drives, why would they not use a database?
not the slash
What dependency scope are we talking about? What are you trying to do in the first place.
kty
new File(plugin.getDataFolder(), "something.txt")
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
dependency injection or use a static getter for your main instance
A party plugin in Velocity. Sub servers will use the API for games
Why would they be there in the first place? Losing worlds and playerdata is equally as bad.
Yes but thats not the point is it?
Thats a transitive causation.
that's like "why would I not buckle up when I crash my car three times per day". Instead of trying to lower the impacts of a crash, you should try to not have any crashes in the first place
how does one create data dir
mkdirs()
Would I be able to use the API?
never heard about the sentence construction "how does one" lol
mkdir(plugin.getDataDirectory()) ?
Can someone help me with plugin?
private final ItemStack stack;
public Item(String name, Material material, Rarity rarity, boolean recombobulated, DescriptionManager manager, StatsManager statsManager) {
ItemStack stack = new ItemStack(material);
stack.getItemMeta().setDisplayName(rarity.getColor()+name);
if (recombobulated) manager.add(ChatColor.MAGIC + "" + rarity.getColor() + rarity.getName() + ChatColor.MAGIC);
else manager.add(rarity.getColor() + rarity.getName());
stack.getItemMeta().setLore(manager.getLore());
this.stack = stack;
}
public void giveTo(Player player) {
player.getInventory().addItem(stack);
}``` ^^ Thats the class, but when i try to use it
```java
new Item("a", Material.IRON_AXE, Rarity.EPIC, true, new DescriptionManager(), new StatsManager()).giveTo(event.getPlayer());
``` it gives me plain iron axe without anything changed, why?
or whatever the data method is
Btw you dont need to tinker with files if you just store a number in the players data.
you have to set back the itemmeta after changing
PDC
should file.createNewFile create the folder automatically?
idk
ItemMeta meta = myItem.getItemMeta();
// do something with meta
myItem.setItemMeta(meta);
@distant wave
And you need to get the ItemMeta only once.
Every time you call getItemMeta(), spigot constructs a new copy.
how does one
?pdc
ohh
cool
ah then do plugin.getDataFolder().mkdirs()
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Thats what i meant by: "You need to learn the basics of java first"
its the main class
Then use this
then dont use plugin but use 'this' or just nothing
ok
this.getDataFolder()
ew no this 💀
so how do you expect java to know what "plugin" is supposed to be?
javascript flashbacks. Everything could be anything. this is never what you expect it to be.
if(!this.getDataFolder().exists()) {
this.getDataFolder().mkdirs();
getLogger().info("CREATED PLUGIN DATA DIRECTORY");
}``` ?
Looks reasonable
now we make the third event
except for the screaming log message lmao
idrc
also why ChatColor.MAGIC doesnt work?
it will only show once or twice: main and test
?paste
ChatColor.MAGIC does work
so i used it wrong?
what is ChatColor.MAGIC
throw new ImprotantMessageException(">>> CREATED PLUGIN DATA DIRECTORY!!! <<<");
no
there should also be a message informing the admin that the directory will now be created. And after that a message about how many millisecodns it took to create the folder lol
hang on a sec, i dont need to specify the data directory as a method, i can use a file path :)
The config file has to contain a valid email address. And you get notified every time the exception is thrown.
oh yeah that sounds reasonable
that's not valid java
config.yml
paypal-name-for-post-stamps: ""
didnt ask
idrc
It is. letter could be an inner class of RoyalMail
well then it's a fucked up naming scheme
credit-card-info-to-buy-stamps:
number: 123456789
expiryDate: 06/09
cvv: 123
shipping-info:
address: 123 your mom lane
city: london
postcode: xd69 6xd
other-info:
name: your mom
You have too much time. Hush you. Go write code.
lmao
theoreticly i could speciy the dir as
/plugins/PLUGINDATADIRNAME/FILENAME.XYZ instead of using the data dir method
i have another 3 hours:)
why when i load yml files, the ' ' are gone from strings?
i thought they were supposed to be there
because yaml is being rude
They are only added when needed
so when i would write the file manually without ' ' it would still work
would this work
Sure. Java is turing complete. You can do everything you want with it.
use the File constructor that takes two parameters: the parent file (the plugin datafolder) and the name of the file
yeah
ChatColor.BOLD + "" + ChatColor.MAGIC + "a " + rarity.getColor() + rarity.getName() + " " + ChatColor.MAGIC + "a"
is this right? the entire lore should be bold and first and last character obfuscated
Man, this is so confusing lol. I've been trying to work out how to do this Circle thing for a while and it just won't work perfectly.
bold isnt workin
why
I'm pretty sure there is a certain order you have to put those in.
idk
I think bold comes last
yeah
No, definitely last.
ok lemme try
Didnt my code work?
I don't think it was working exactly how I was trying to do it unless I was doing stuff wrong
its not working + why the first obfuscated letter seem to be italic
Probably due to the default formatting Minecraft puts on items.
You probably don't have a color code on it.
lore is italic by default isn't it?
Yes
how to remove
just use chatcolor strip
It seems to be spawning them in a random location
Y=sint
X=cost
I'm at -122 161 -173 and it's spawning at like -310 91 -336, so ye the locations are slightly out.
can someone help me figure out what this error means? trying to make a simple config file for my plugin
Can we see code?
I've been given
public static List<Vector> getFullRotation(Vector first, int amount) {
List<Vector> vectors = new ArrayList<>();
Vector current = first;
double delta = 360.0 / amount;
for(int i = 0; i < amount; i++) {
vectors.add(current.clone());
current = current.rotateAroundZ(delta);
}
return vectors;
}
It seems like your config isn't being recognized. That could be due to it not being generated when the plugin loads, or you didn't give it a proper instance.
What kinda circle are u making?
A horizontal one?
Or vertical
Also can ibsee where you call getFullRotation and use tue vectorlist?
indexing is annoying
File myObj = new File("/home/container/plugins/datadir"); will this work
https://i.imgur.com/lNUUPis.png I wanna spawn the blocks in this sort of pattern at where the red wool is, so a circle like that but at the red blocks location
Only if you are on a UNIX based system.
i am
I need to see your code
ptero only runs under binux
yeah it's not generating when i run the server, any idea why?
this is my code
FileConfiguration config = getConfig();
@Override
public void onEnable() {
// Plugin startup logic
config.options().copyDefaults(true);
saveConfig();
Bukkit.getLogger().info(config.getString("name") + " is my name and my age is " + config.getInt("age"));
new PlayerHeldItemHandler(this);
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
@Override
public FileConfiguration getConfig() {
return config;
}
}```
config.yml is located under src -> main -> resources
I'm aware. However, it's better if you use File.separator.
Wasnt this what you wanted?
tf is that
Block block = ...;
Vector vector = new Vector(0.5, 0.5, 0);
Location base = block.getLocation().add(0.5, 1.25, 0.5);
for (int i = 0; i < 8; i++) {
Vector finalVector = vector;
block.getWorld().spawn(base, TNTPrimed.class, tnt -> tnt.setVelocity(finalVector));
vector = vector.rotateAroundY(360.0 / 8);
}
Resulted in:
Ur using location.toVector
you are using a relative path, not absolute, so it will work on any OS, but it is going to be relative to where spigot is.
bloody indexing
A utility built into java that gets the proper file separator based on what OS you are using.
UNIX = /
WIndows =
Anything else = Whatever it uses.
ok
but yeah, it will be used on one server only
U need to do new Vector(0, radius, 0)
and that's a unix based server
If you use the location as a vector, that's gonna be the radius
Try removing the config.options().copyDefaults(true) and instead call #saveDefaultConfig().
this fixed it thank you so much guys
indexing is AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Also, #saveConfig() only saves the cached version of the config to disk. It doesn't write your existing config to disk.
ah, i see. i got it working, thank you so much!
aaaaaAaAaAaAaAaAAaAaAaaaAaAaAAAaAAAaAAAaaAAAAaAaAAAAaaaaaaaAAaAaAaAaAAA
...
but you've hidden them
so show them
what
use #setInvisible
i think thats the method
?
did it get removed
so why cant u use it
I don't know how else to put this.
The solution you are looking for is not something built into a single method in the API.
#hidePlayer will remove the player from view and on the tablist.
#showPlayer will restore the player to view and add them back to the tablist.
You will have to use a different approach.
hiwo do i make intellij index
???
if u dont use CWM u can just completely ignore it and it'll likely be fixed in a future update.
whats cwm
CodeWithMe, the plugin that got disabled
eh im relaunching the ide
Not all of them, but if that won't work for you. Make the player invisible then.
Be nice
I mean, you are the one asking for help. HIs answer is valid. Player#setInvisible() is part of the API. I'm pretty sure it goes back to 1.18 or 1.17.
Also, there is another way to make players invisible. It's one of the core mechanics of the game.... Ya know. Potion effects.
LivingEntity#setInvisible was introduced in 1.16
The other thing we suggested was to use Scoreboard teams to add the player back to the tablist.
However, at this point, I'd just recommend updating to a new version of the API.
what the fuck
?
There are two API methods for handling Invisible. Entity invisible and Teams invisible
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/LivingEntity.html#setInvisible(boolean)
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/scoreboard/Team.html#canSeeFriendlyInvisibles()
also potions but thats lazy.
"indexing" tf u indexing
Itd be helpful if we actually knew what version zak was using
I'm betting 1.8
Oh? That's a surprise. A welcome one to be sure.
so update to a newer version of the api that has the methhods u need
Scoreboard teams are probably your best bet then.
you could probably do it via packets, but honestly would probably suck
basic question, which even would trigger when a player equips something on their armor slot? (or well any equipment slot I guess)
how does i make indexing faster intellij idea
?jd-s
download more ram
A few probably
There are libraries to simplify that however
buy more ram/ memory
i already downloaded 4tb today, i am getting rate limited
no way other than just better components, faster drive, etc...
or just don't need to re-index
what? that late? I thought it was around since 1.13 lol
lap/ top
There is unfortunately no single event that fires for Armor Equip.
However, I'd recommend using the ArmorEquipEvent class from github.
https://github.com/JEFF-Media-GbR/ArmorEquipEvent
buy a new laptop
I wasnt able to find it in any earlier vers looking at Paper javadocs
imagine buying more ram but not installing it :kekw:
any pointers? I'm sifting through org.bukkit.event.inventory and can't find something like it lol
i will soom when i get mony
pausing your AV will speed up your compile time substantially, duno about indexing
download money
As I said, I expect there would be more than one event you need to listen for
im being rate limited
InventoryClickEvent being one of those I assume
buy anti rate limit
i cant download anymore money today ive alr downloaded £50
i cant it's £56 and i have £5 + £50 downloaded
I don't even know what he's talking about.
This is so random
sometimes i dont either
how does one kill someone
in the api
oh
damage
sethealth(0)?
I believe that's one way to do it.
setmaxhealth(0)?
No
damage(10000.0)
No
remove()
Don't ever change the max health unless you are changing health scales.
im making a hardcore plugin where to revive someone u lose 5 herts forever and if u are at 0 u die
so do i use maxhealth when i change it from 10 hearts to 5
Maybe, but I'm pretty sure it'd be better if you use the generic attributes instead.
It's been a minute since I've messed with player hearts.
make that player a variable pls
Problem with plugin logic, can't figure it out
player#setmaxhealth is deprecated, you should probably use attributes instead
how does i use attributes
Player#setAttribute()
do attributes reset on relog btw?
how does i set the max health in attribute
Attribute.GENERIC_MAX_HEALTH
player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(double value);
I'll make a note to reset all attributes on relog then
so double value is 10
its in half hearts
value is a double indicating whatever the health is. 1 = 1/2 hearts
cast sender to player.
?
Cast a sender type to a player type to use its corresponding methods.
Player p = (Player) sender;
Use Player player = (Player) sender
This is basic java, if you don't know how to cast I'd strongly recommend learning it before, I made that mistake when first programming plugins
Do a check before the switch statement if the clicked item is null, or air
so ``` p.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(((Player) sender).getMaxHealth() - 10);
I think the error is in the 29th line of TeleportHome.java, as indicated by the error, not onClick ( I suppose both have inventory click listeners)
Yes, though I would cast it to player and use player from now on to manipulate data about it, it's less cumbersome.
could you highlight the 29th line please
Then config.getString("Home.World) is null. Have you checked that path is in the config?
do the early return first lol
Have you also checked if your x, y and z values are retrieved correctly? If they aren't retrieved correctly that might lead you to the issue.
void onClick(InvClickEvent event) {
if (event.getClickedInv() == null)return;
// rest of your code
}```
@tender shard Did the PR - Getting rid of a custom classwriter entirely works too I guess. I would test it on your stuff however - while I hadn't had any issues with my stuff I am not entirely sure how well it fares against your jars.
there was a reason why I needed the custom classwriter, but I don't remember it. I'll test it
Because you expanded the frames, but that is pointless
Plus since we inherit the old symbol table I do not think that even if frames were expanded that anything would happen there
?pdc
gsruhuhdughuehguheugywrgsyuysrgyfgyegy why are the broadcst methods depricated
Paper?
bukkit
screw it im using the depricated method
And because we got rid of the custom classloader I was also able to get rid of the spigot dependency since we would not need to load it
FileConfiguration#get, look at the methods to get specific stuff too
What method exactly are you using though?
thanks, seems to be working fine!
You are using paper then
Because that method is not deprecated under spigot
in paper, every second method that usually takes a string is deprecated lol
y e a h
I haven't seen to many issues with that personally
i decided to use paper because uh my servers run paper
deprecated != broken
Only the bungee-chat stuff got deprecated from what I see but I couldn't care less about it
Just there is better alternatives
ik
Yeah, in that case it's adventure
how would i remove stuff from the max health and then check what it is
wdym by that, remove some health and check how much you removed?
Be more precise when asking programming related questions. What is "stuff" and "it"
i want to remove some health from the maxhealth and then see what the maxhealth is after
?xy sounds more of an xy rather than anything
Asking about your attempted solution rather than your actual problem
Use attributes to remove it and try player#getmaxhealth maybe?
max health is an attribute. You need to get the attributes of a player, fetch "GENERIC_MAX_HEALTH"
and reduce it by a certain amount. Afterwards you can either get the new base value or the new effective value.
Effective because attributes can have modifiers.
does player#getMaxHealth work
public double reduceMaxHealth(Player player, double amount) {
AttributeInstance attribute = player.getAttribute(Attribute.GENERIC_MAX_HEALTH);
attribute.setBaseValue(attribute.getBaseValue() - amount);
return attribute.getBaseValue();
}
Something like this. It reduces the players max health and returns the amount he has afterwards.
I know that this question can be stupid but
Which better in playing and Coding
Multiworld
Or
BungeeCord
bungee but really depends on what you are actually doing
Multiworld is way easier when it comes to coding and playing.
And its not even close.
inter-server communication on bungee is a paiiiin
just use redis pff
Redis does a very good job for that
So better to make MultiWorld PvP Minigames server until I get More Experience in Programming then make a Bungeecord Server. ?
Like SkyPvP , SkyMines, PvP , RedstonePvP, Etc
You can make your minigame network docker based. Just start a new docker with only
the plugins your gamemode needs whenever a new round starts.
Ideally both to maximize performance
if (reduceMaxHealth((Player) sender, 5) == 0) {
Bukkit.broadcastMessage("send some stuff");
getServer().dispatchCommand(getServer().getConsoleSender(), "kill " + sender.getName());
}```
will this work
I'm sorry, but I didn't understand I word man
Didnt you say you where a professional python developer?
Docker Based
In My Hosting
Dont compare doubles with ==. Define an epsilon and check if the value derives at most by your epsilon from your target value.
It's the Container that contains the Starting file
As
java bla bla bla nogui server.jar bla bla bla
w h a t ? ?
epsilon is maximum difference
ok
doubles rarely are integers
so i use =?
thats assigning
ok
7smile7 is Typing
Wouldn't Double.compare work?
i always forget what > and < are
• • • Several people are typing
what they mean*
It contains a spigot server with all plugins installed.
For example you have one docker image for "SkyWars" and every time someone starts a SkyWars
lobby, you prepare the container.
Honestly. If you are just starting out then you should just create one world per minigame.
Performance wise this is garbage because all games will have to listen to events from other games
but if you dont expect a big playerbase then it does not matter at all.
private static final double EPSILON = 0.0000001D;
public static boolean isEqual(double d1, double d2) {
return Math.abs(d1-d2) < EPSILON;
}
sth like this
Man
I have
8 GB of Ram
And
32 GB Disk
500 CPU
So I will create a world of each minigame
500 CPU, ok
500 CPU?
.getClass() == Boolean.class and instanceof Boolean is the same?
5 cores
well yes, why not?
So it better to make a world pre minigame for my start as my experience is new
Or no ?
What would you advise to use for checking if an object is a boolean?
In this specific case yes because Boolean is final. But generally speaking: No
instanceof Boolean
I mean, it's not the same, but it will always result in the same thing
if (reduceMaxHealth((Player) sender, 10) < 0) {
target.setGameMode(GameMode.SURVIVAL);
Bukkit.broadcastMessage("send some stuff");
getServer().dispatchCommand(getServer().getConsoleSender(), "kill " + sender.getName());
}```?
To make Programming easier
what are you actually trying to Deveroonie
Sure that will work. Make it <= 0.0001D and you get a pass
7smile7 please answer this message and the message before it
make it so when u do /revive player it will set them to survival and take 5 hearts from u
amd if ur health is 0 u die
ah
for my hard core server
Yes. Just create multiple worlds on one server. One world per minigame instance.
👏
Okay Thx for helping
More context. This sounds like a weird issue you would only have while doing some reflections or other fkery.
should i ?paste the full code
don't call reflection fkery :<
Format it and then past it. What IDE are you using?
intellij idea fre
is there something like a GoatHornMeta to get/set the sound of a goat horn item?
iirc open PR for it ?
then press ctrl + alt + L while in your class
oh ok
whoa
how could md5 forget about goat horn meta
it's the most important item of all items
Hello? Telescope?
still need to do some files stuff, but https://paste.md-5.net/ojocijigib.java
have you ever heard the "Seek" goathorn? nothing can top that!
not even "stal"'s flute solo
will it work
try it
why are you still checking for "< 0" instead of "< 0.00001" ?
and i cant launch mc cos lag
because zero
zero is fi ne
it's not
if you hear alex using that horn every time ingame you really want to die trust me
it's fine for integers and longs and shorts and bytes and chars
it's not "fine" for doubles or floats
that's too many decimals
no need for an else if youre doing an early return
0.01
looks ugly af too
5 or 6 decimals should be fine as epsilon
black magic
¯_(ツ)_/¯
What do you mean by that? This can be quite complicated and especially quite useless.
can someone is are help test
see if it has an ==: entry
pls
how do I run it async
im not that experienced with java im more of a python guy sry
also do you think its fine if i implement all this pathfinding through the bukkit API like you have? Would it be slower compared to if I did it with the NMS API?
new Pathing(plugin, source, player).runTaskAsynchronously(this)
that will show you how it works
it will attempt to find a path from a source block to the player
thanks
aint there different kinds of pathing
yeah im not experienced in this pathing stuff
Yes, this is just an algorithm I was playign with
ah k
do you think i should re-implement this in NMS or nah
I'd try it out first and see if its useable
you'll have to modify it to search from your Entity to yoru source block
but thats not difficult
The two constants at teh top control how long it will attempt to find a path and how efficient it is
its default is to look for 10 seconds
hm alright
but as you already know your start and end you can trim that down drastically
I need it to target specifically air blocks that are directly above a water block, which has a solid block next to it
I can do that though
@lost matrix was also playing with a A* pathing algoritm to navigate a maze.
Ui. Hast du something visually? 
nope. @ornate patio is trying to find a path from a horse to water. for a PathfinderGoal
I remember you were playing around with that
@eternal oxide the path it finds goes over any kind of wall
but if I stand behind the wall and not the fence it can't find any path, expectedly
situations like this also don't work unfortunately
(diamond block is the target)
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
ninjad me 🥺
Sorry 😂
now i am vewwy sad
your too fast 😭
Like lightning
your pfp looks like someone i would give candy on halloween
It should be painfully obvious you cant get a number from a list of player objects
thanks would you give me lots of candy or very little candy
new to the spigot API?
that has nothing to do with your issue
you've clearly never touched java
depends on the amount of money you give me
😏
I'll pat you like kafkaz
myesssir
ahhh I remember when I made my first plugin I thought'd it be fun and easy going in with 0 java experience I was very wrong
it was the most painful experience of my life
don't ask how I got to where I am with no pure java projects I couldn't answer that
i believe i still have my first plugin
I deleted my first plugin lol
tf
I could probably recover it since its burned into my hard drive
hehe
bleugh light mode ide
One thing I will say that I'm proud of is right off the bat I used dependency injection
I've never used static access
im not using eclipse anymore lol
eclipse lol
Sometimes you need some VS yk
glad i stopped using that
I actually never though to test it against fences
for what?
vscode 😍
vscode ❤️ its my baby
if you increase the time to search it will find a path from that corner
ughhh that beautiful task bar
mmmmmm
tmux
The thing is I'm going to have to run this for every water block that the horse finds in its proximity... for each horse in the server
that shit isnt accepting anything of what i put in the config
doesnt make sense at all
Compiling the bedrock client
oh.... well I stay 10,000 miles away from bedrock so I can't relate
Lol
is it possible to steal the villager's AI, because they can make their way around obstacles to get to their workstation
You write plugins in php not c++
we are not stealing anything here
what 🤔 what the
the only thing worse than c++ is c#
If it was C++ i would give it a shot
C# is just basically java but microsoft
Precisely why it sucks
visual c# good lol
i also like the linq and the $"{var}" thing
the only thing good that microsoft made is vscode
so true
C# has some good concepts like delegates and no runtime type erasure
Visual studio isn't bad either imo
I love vscode
bump
(WEll no actually it is last time I had to wait 15 minutes for a function I made to be cached)
ye only its naming conventions that scare me
Why would you write plugins in php
with some NMS access I wouldn't think its impossible you'd just have to dig around a bit
vim > atom > notepad++ > vscode
WORDPRESS LESSGOO
The naming convention is the only thing that is objectively inferior
SpigotPress when
idk if you can search in your decompiler but look for Villager and dig around how the AI is implemented
should be under like world/entity
Trying to write minecraft plugins in php is wack
No idea. But some people are masochists.
seriously whos idea was it to make functions in c# uppercase
when people start using wordpress
private readonly String _string hehehe
yeah im in the villager class
I have a problem with anyone who uses WordPress
GetFourteenBrush() 🤢
The plugin system is one of the most annoying ones I've workee with
i thought that my teacher was talking shit when he said that fields where prefixed with an underscore
think they just did it to be quirky
thing is villagers dont have normal goalSelectors and targetSelectors
What do you use?Jimdo?
?jd
they have their own memory crap
i made a website for school with jimdo 😢
Nothing 💪 if you like blogging ghost
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
frick jimdo
oof you could try searching it up online to see if there is any remotely relevant info, but I don't think many people have done something like that
we learned html and css and then for another subject they told us to make a website
nobody usin the shit we learnt
I'm actually a php enjoyer so I have fun making stuff from scratch most of the time
I mean php8 isnt apparently that bad
in cs last year they just taught us how to use some random js library instead of how to actually use js
But like are there any alternatives
I mean wordpress most of the time just works
Its like eating dirty, wet socks - its quick, its easy and its free
no runtime type erasure? Man this is game changing in a way
Yes but like its so dirty it doesn't deserve to be used
write one with php5 and watch the teacher suffer
Its like when u have no food and no time so instead of cooking food you go to the greasiest fast food there is in town
yea
lmao i aint using php
not in my entire life
or write your own single-use-os, http protocol and a webbrowser in x86 assembly💀 💀 💀 💀 💀
yea same I'd rather use brainfuck
i'd rather write a website in binary
brainfuck is an impressive engineering feat. I personally use it for all my low level programs
x86 assembly is worse than binary
good
if brain is present
you mean you spend 10 hours writing a program to write a low-level-program in brainfuck?
I mean. Every browser supports web assembly now.
can't wait to start writing wasm in rust 
I only used wasm when I wanted to particularly annoy people trying to reverse engineer
I hate JavaScript with a burning passion so anything I can use to not use java script makes me happy
Damn
there is a reason I'm not a web developer
It's my favourite language😩
you're a monster an absolute monster
Here I am enjoying js and php lol
atleast use TypeScript
javascript is so good
i love javascript roo
javascript is an actual pile of garbage
+1
yes it is. i'll fight back dont try me
js is .. ok
but typescript is the best
good...
this is too
lomobkk aaaa
For me Typescript is just js but with another layer of being annoying
but there is lamp too 🎂
Wait. Those abstract methods make no sense. Why would you mix your concerns like that?
there is also redcommands
there is also acf
VSCode uuugh
vscode good
either you use one pretty decent "ide" for 10 programming languages filled with telemetry and sell your soul to microsoft, use 10 shitty ides by 10 different developers with 10 different ui layouts for 10 different programming languages or 10 great ides by the same devs with the same ui perfectly optimized for their single language