#help-development
1 messages · Page 2168 of 1
who
still wish you could make it 3-digit
that could be a good tag on me
since my birthday is on 6.9
in 2022
woah
my bd is on 13.12
is it random? nobody knows
oh no like my ex's
honestly, thats so rigged
=ß?
hahahaha
fuck my life
2001 I guess?
you just did
you will never forget your age
IKR
you searched so long for that?
I will turn 69 on 6.9.2069
yes, i was just dumb
it was meant like "i don't know who that was"
mmh
?
candice d fit in jo mouth
^
good one
got me so bad
: P
omg im so dumb
agree
you are dumb
yes
fuck
still smarter than you tho
negative
you 2 seem like you know each other
no
luckily not
xd
lol
you are rude
poor help-development channel has to take our bs xd
yes 👿
it has always been like that
^
funny that the desc says "serious"
its general chat here
this is really serious, yes
:c
hmm
100 for start?
what's @fallow violet saying?
or more?
sounds good
alright
I think she's tricking us
hell no
yes
i'm serious
you don't even wanna spend 5 bucks on nitro
this sounds like a good opportunity for me
how do i close an open inventory
why would i not accept that offer
fuck me
.close()
player#closeInventory();
xd
Should i use BiMap<Integer, Inventory> or List<Inventory>
list?
can you show more context?
U can also do inventory.getViewers.closeinventory for each
yes
-_-
haha nice
It's for storage inventories
What use case?
what did i expect anyway
But they also have a gui
sry was just a joke
So i wanna be able to lookup which page was clicked
For what reason?
i mean, list's are sorted ig
Yeah but they have O(n) lookuos
can you store inventory as a variable. Let a player open them and check the inventory in the click event?
Lookups*
It's used for storage
Don't ArrayList have O(1)? Or are you using a LinkedList?
its not in your case
i think he has multiple inventories as pages
Not sure why you need to know an arbitrary index of an inventory
Not to get the index of the element
To get the page
I see no reason to know the "page"
Next and previous???
You have the inventory, which is the only thing you shoudl need
the inventory is basically the page lol
still no need, you have the stored so goign forwards/back is simple
Ok if a player opens page 23
How do i know its page 23?
?paste
A simple paginated inventory where you can click to get teh next page https://paste.md-5.net/inaconacay.java
no index needed
Yes but I'm using the inventories for storage as well
So there are storage slot and gui slots
- saving it to steal your code because im too lazy to make it by myself *
i may yoink this in the future
You can use List<Inventory> then find where each is using List#indexof
int index = pages.indexOf(inven);
I just created a new project and none of my maven dependencies will work. I went to past projects and even there it won't work... Not even just the spigot jar
Lol u use indexof
My question was whether i should use a bimap or list
Bimap would mean faster lookups
you don;t need fast lookups
Since i have to lookup on each click
I do
Lots of pages and possibly lots of clicks
You will never need a faster lookup when using a GUI than indexof
could it be that spigot or mc servers are down or have some problems today?
so many people having problems with retrieving dependencies
I'm probably trying to prematurely optimize so I'm not sure if indexof is sufficient
guys
Should i go to sleep or not?
alright captain
🏴☠️
Anyone?
thats why => buy nitro
🦆 this is now the only duck i can use
lmao
idk
i feel like some servers are down or smt
knuff
you have bt installed right?
ja
Not BT
can you try deleting the cached stuff from it, and try to run 1.18.2?
i feel like it's broken
on my way
smart as i always said
youre the captain of the ship
yessir
only the .jar and the .cmd left
youre the one
many people today had problems with retrieving repository artifacts
i feel like that's not normal
lmao i deleted git
-_-
Thats weird
bt will install it afaik
what celina says
even my buildtools isnt working
^
?bt
what would I want to decompile?
it's what paper does automatically when starting
So far the bt run is still going
thats why many people never head of it
in 2 seconds
i got no idea how
first warnings so far
i straight up get this:
[ERROR] Failed to execute goal net.md-5:specialsource-maven-plugin:1.2.3:remap (remap-members) on project spigot: Error creating remapped jar: Failure to find org.spigotmc:minecraft-server:csrg:maps-spigot-members:1.18.2-R0.1-SNAPSHOT in https://libraries.minecraft.net/ was cached in the local repository, resolution will not be reattempted until the update interval of minecraft-libraries has elapsed or updates are forced
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.spigotmc -DartifactId=minecraft-server -Dversion=1.18.2-R0.1-SNAPSHOT -Dclassifier=maps-spigot-members -Dpackaging=csrg -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.spigotmc -DartifactId=minecraft-server -Dversion=1.18.2-R0.1-SNAPSHOT -Dclassifier=maps-spigot-members -Dpackaging=csrg -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
etc etc
cant send ss because yea....
what is your start.cmd?
i dont have one
you did run buildtools with the --remapped ?
17
same
are you SURE you used --remapped?
same command
^
Mine for example is "C:\Program Files\Java\jdk-17\bin\java.exe" -jar BuildTools.jar --rev 1.18.2 --remapped (DONT SAY ANYTHING ABOUT THE JAVA THING)
java -jar BuildTools.jar --rev 1.18.2 --remapped few hours ago
to test it out
same error
still running ._.
i see
I am having Hardtime using NMS packages so is there any well defined documentation of it like spigot-api has?
my oπnion: Celina broke her pc
also why all the functions are of one or 2 letters its really annoying in nms
NMS is not spigot so there will not be any good documentation due to it belonging to Mojang
seconds warn block but still working @slate mortar
ok but somehow my all functions are made of 1 or 2letters
because of that i am unable to understande anything
from @slate mortar
my man
tf
Correct. you need to use Mojang mappings to use translated names (and compile using specialsource)
that one is btw ran with --remapped
special source?
BT ran fine here with --remapped
is it even complete tho?
?bootstrap read the 1.17 post this wiki links to
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
so elgar... do you have any idea about this error
hmm
lol
i never had this
double lol
the old acc isnt even on this server anymore tho
xd
maybe because the dm?
xd
i'm confused
spigot-1.18.2-R0.1-SNAPSHOT-remapped.jar was built in my Spigot/Spigot-Server/target folder
?paste your buildtools log
@eternal oxide
^
use the paste site I linked
smart
I want to see YOUR log
paste 5GB log
ok
you cannot update the log btw
hopefully
it works?
imagine not removing the cached data first
i'm just confused
why would i delete all files everytime
when i never had to
in years
if i would have an error i would remove them
What would be the death cause when I do
target.setHealth(target.getHealth() - 1);```
until the target dies?
CUSTOM
fr?
+1 on void
aight will try
ty
Base Health of a player is 20?
If I remove 1 it removes half a heart?
oki ty
Your log says it was unable to find teh minecraft-server.jar from minecraft.net
i have no idea why
bro
works now after deleting everything from the bt folder
ok
How would I go on teleporting everyone to a single player, but like not INTO him but, let's say, in a small radius of 5 blocks around him randomly?
for (Player player : Bukkit.getOnlinePlayers()) {
if (player.getUniqueId() != targetPlayer.getUniqueId()) {
int i = ThreadLocalRandom.current().nextInt(-5, 5);
int x = targetPlayer.getLocation().getBlockX() + i;
int z = targetPlayer.getLocation().getBlockZ() + i;
int y = targetPlayer.getWorld().getHighestBlockYAt(x, z) + 1;
player.teleport(new Location(targetPlayer.getWorld(), x, y, z));
}
}
out of my head, might work, might not work, idk
calculating the y in caves and with blocks above the location will need more calculations
this looks very promising ^.^
keep this in mind tho
in caves and with blocks above, it'll teleport them to the highest block
also out of my head, might work, might not
private int getNextAirBlockYAbove(World world, int x, int y, int z) {
Block b = world.getBlockAt(x, y, z);
for (int i = 0; i < world.getMaxHeight(); i++) {
if (b.getRelative(BlockFace.UP, i).getType() == Material.AIR)
return y + i;
}
}```
you can set your server into offline mode for testing, and use MultiMC to launch into an offline account
if you dont own multiple accounts
I wish there was like a tool that spawns like 10 dummies so that developers can test stuff
i mean
for fabric servers, there's Carpet
dunno if there exists similar stuff for spigot
haven't seen anything yet
idk if those npc plugins would work for this
Guess I'll use the offline thingy
that's the most efficient thing yea
i used that myself before i got myself a 2nd account for development tests
I'm gonna try it out and report to you soon
this does include single-layer blocks tho, but i dont think this is a HUGE problem
but would be fixable with java private int getNextAirBlockYAbove(World world, int x, int y, int z) { Block b = world.getBlockAt(x, y, z); for (int i = 0; i < world.getMaxHeight(); i++) { if (b.getRelative(BlockFace.UP, i).getType() == Material.AIR && b.getRelative(BlockFace.UP, i + 1).getType() == Material.AIR){ return y + i; } } }
use brackets my boi
why
google code style requirements
Yay!
won't the compiler add those brackets automatically anyway?
I need at least 3
why
I excluded the one executing the command
and the victim
doesn't make much sense teleporting him to himself xd
._.
you execute the command with player1, and teleport player2 to player1
whats wrong with this for testing
people without friends be like
okay it seems to work
but haven't implemented the cave fix so far
is it possible to make a command which turns of and on the plugin
no
you can't turn on a plugin from itself while it's disabled obviously
the command can't turn it back on as the plugin containing the command is off
you'd need something external I guess
you can technically just run the reload command, alltho that'd be kinda hacky
it does not disables it but it makes the plugin useless
you can just have a boolean somewhere
set it to false to disable the plugin, true to enable it
and make features depend on it
@slate mortar Next thing for the teleport thing would be that there can't be 2 player's on the same "random location" in the radius to the target
if you have that math "knowledge", good luck
i don't
also i'm tired
ok thanks
you can make it calculate a double instead for x and y, which would include decimals
that's probably the easiest
so just double d = ThreadLocalRandom.current().nextDouble(-5.0D, 5.0D);
I think that has to do it
Would be a bit more work to really get them an individual random spot I guess
depending on the player count, that'll make it less likely
well yea
my code was just a quick easy way
if you really want to make it efficient and ignore walls, ceilings etc, you'd need some math calculations that i can't provide myself
my math brain goes as far as this
drawTexture(matrices, this.x + this.width - (10 * scale), this.y - this.height, 0, flag ? 128 : 0, 8 * scale, 8 * scale, 256, 128);```
there's another problem I found
let's say the radius is 5
and there are like 80 players
that wouldn't even be close to enough blocks for an individual block spot for everyone
increase the radius -_-
eyo eminem pfp
you cannot really prevent that in a 100% rate
there is always the possibility of people clashing inside
ye
that's how random factors work lol
else i'd gamble the shit out of the world
it's tbh not even that important that they don't clash
I think I'll leave it as it is
I'll make sure to credit you and everyone else who's gonna help me in the process of finishing it ^.^
may i ask in which context it'll be used? the teleport
not needed
I'm making like a premium version of my old plugin https://dev.bukkit.org/projects/troll-extreme
It's code is so trashy cause I just kept adding stuff since 2014
lol
And I'm currently redoing the popular command where every player is teleported to a target
and I didn't want to have like 20 people standing inside each other
would be easier tho
it'll, until youre in a cave, and the random pos is inside a wall
which will make them teleport way higher up
Hm
There's gotta be a way to implement like a failsafe
that in that case those people just get tp'd to the target
can't i just check
if their y value is bigger than y of target + radius
or smth like that
then they got tp'd to some nasty high position cause of walls or stuff
i'll send you an image in dm
how can i change world loot and world generation using plugin?(is it even possible? is yes then how?)
oki
any way to make health appear like this?
1.5M and not like 1,60,000
if i get it right
double d = 15.123456789; // hp example
String formatted = String.format("%.1f", d);
System.out.println(formatted); // formatted to 15.1```
I did something like this
if (tag.containsKey(boss)) {
if (!(boss.isDead())) {
Location l = boss.getLocation().add(0, 0.3, 0);
if (Math.round(boss.getHealth()) > 800000) {
name.setCustomName("§c☠ §bRevenant Horror §a" + Math.round(boss.getHealth() / 2) + "§c ❤");
} else if (boss.getHealth() >= 800000) {
name.setCustomName("§c☠ §bRevenant Horror §a" + Utilities.formatValue(Math.round(boss.getHealth()) / 2) + "§c ❤");
}```
will it work?
invalidate caches
intellij moment
it reindexed and it still persists
hm
its not spigot's problem for sure
i use paperweight-userdev, so its not really an issue from spigot
i dont use the paper-api, so no idea
even less idea
welcome to development
i guess paper's repo fucked up smth
ok that's even more interesting
Intellij somehow ejected the gradle project from itself
and that's why import issues are happening
fixed.
bro
how do I add something like that?
the Slayer Quest
Sven Packmaster IV
Number of kills/ xp required to spawn da boss
if i'm using the h2 database dependency, do users have to download this themselves or should i shade it in the jar?
use the libraries entry in the plugin.yml
if you're using modern versions of spigot api
iirc this is 1.16 api feature
so these will be loaded from maven when enabling the plugin?
yes
yes
libraries:
- com.h2database:h2:1.3.159```
or whatever version you want to use
Thats just what iConomy5 uses. Its older
and simpler to use
Hello, i'm trying to load a world here is the code:
String[] worldNames = { "", "_end", "nether"};
World.Environment[] worldType = {World.Environment.NORMAL, World.Environment.THE_END, World.Environment.NETHER};
for (int i = 0; i < worldNames.length; i ++) {
int finalI = i;
new Thread(() -> {
World world = new WorldCreator(game.getId()+worldNames[finalI])
.environment(worldType[finalI]).createWorld();
Bukkit.getServer().getWorlds().add(world);
}).start();
System.out.println(game.getId()+worldNames[i]);
}
The proble is that when i load the world it take a lot of time and lags the whole lobby
I do not believe you can load Worlds in a seperate Thread
but you will lag
and this line Bukkit.getServer().getWorlds().add(world); does nothing
um, are you trying to load vanilla worlds?
Are comments with # still removed if added to config?
bro is it me
if you call save yes, unless you use config.options().copyDefaults().save
would the later option allow to still edit values and stuff in the config but keep the comments?
yes
its a recent addition though
not back ported
its available in 1.17, not sure if 1.16
so basically everytime I edit someting in the config I have to safe it via config.options().copyDefaults().save ?
hm I'll try it out and let you know
If it works as I expect
I'm quite unfamiliar with config stuff
iirc for older versions of spigot api they are being removed, but starting from 1.17 or 1.16, comments since became one of the main components of the bukkit's configuration api
Good that they added it, was quite unhandy back in the day to keep those comments alive after changing stuff in the config
actually if i only wanted to load them when some value in the config is set, could i still use that entry?
Man I'm often in existential crisis like Hamlet Shakespeare's — "To throw exception or not to, that's a question?"
all libraries are downloaded at startup
hmm thats not what i want then
if you shade it its going to be there anyway
ill probably go with that
shading seems pointless for a library
it is downloaded once. The first time the plugin loads
dunno if i'm actually shading it in my pom, i just added a dependency
or are dependencies without scope shaded automatically?
if that depend is not "provided" then you are shading
The biggest reason to use libraries is to keep your jar size small
should #getExp() return 9.753487E-8 seams little broken to me.
i mean it should be from 1.0 and down
lets shade it i guess lol
add 11 MB lib to your 100 kb plugin XD
its only 3 MB with the shaded stuff included
was only a joke. Some libs are really big (interesting to see how much spigot take if you include that (I mean that are waste, but for fun)).
ye
i needed a simple npc code
citizens is simple to implement
Bukkit.getScheduler().runTaskLater(this, () -> {
Bukkit.createBossBar("Second", BarColor.RED, BarStyle.SOLID);
event.getPlayer().setHealth(20);
Location location = event.getBlock().getLocation();
EntityType entityType = EntityType.values()[new Random().nextInt(EntityType.values().length)];
event.getPlayer().getLocation().getWorld().spawnEntity(location, entityType);
}, 100L);
why bossbar isnt working?
you didn;t add any players to the bossbar
you actually did nothing with the boss bar after creating it
ummm
i want something like this :- when ever player break any block bossbar should be visible and show a countdown of 5 second and then random mob will spawn
so any tips?
how can i make this?
how to add players?
I'd not use a bossbar
using flag?
I'd just count down in a title
yea
but with boss bar https://hub.spigotmc.org/javadocs/spigot/org/bukkit/boss/BossBar.html
i want countdown using title
each player would need their own bossbar
bossbar is for design only xD
countdown should display on bossbar title
um, title and bossbar are separate things
okay lemme see this
use one or the other
:/
if BossBar you use a repeating timer with a counter. Update teh bossbar progress each time it fires
when it reaches zero you spawn the mob and cancel the task
Depending if you shade your libs or not
you can also end up with that amount if you left shade empty and it also break the plugin (maven is pretty weird and is not documented behaviour ether).
it will compile everything in hide path. I think every dependency you added.
I only have getConfig().options().copyDefaults(true); , this .save() doesn't pop up
How do I get the JavaPlugin class of another plugin?
okay
getPluginManagager() I think
ye and then .getPlugin()
look it up 😉
That returns the Plugin class though?
is there a master list of class name differences between the spigot mappings and mojang mappings?
It actually returns teh JavaPlugin. Plugin is simply the parent class
Well actually it returns the Plugins class which implements JavaPlugin
GroupManager gm = (GroupManager) Bukkit.getPluginManager().getPlugin("GroupManager");
JavaPlugin jp = Bukkit.getPluginManager().getPlugin("GroupManager");```are both valid
yes
vanilla worlds are loaded by default
i mean it is a vanilla world but is not the default one
ah ok
well, I'm 99% certain you can;t do it in a Thread
its unsafe
and you will not do it without lag
tps goes down to 15
Its mostly down to the power and performance of teh PC its running on
saveConfig() actually removes the comments, I had to use saveDefaultConfig()
new WorldCreator(game.getId() + worldNames[i])
.environment(worldType[i]).createWorld();
``` is this way correct then?
yes
cuz i got:
Can;t help you on Paper. This is Spigot and paper does all kinds of Async funky stuff with worlds
mm ok thanks
how to get location of block where player was standing while breaking another block
Player.getLocation()
Location location = event.getPlayer().getLocation();?
like this?
right?
yes
but its getting not getting that location
its getting location of new block(where player is standing right now)
it will get teh Location the player is at when the Block was broken
but then why mobs are spawning on players head?
Do yoiu want teh block they were stood on?
Location location = event.getPlayer().getLocation();
EntityType entityType = EntityType.values()[new Random().nextInt(EntityType.values().length)];
event.getPlayer().getLocation().getWorld().spawnEntity(location, entityType);
yea
nope, your code is correct
but its spawning mobs on player head
like ender dragon ;-;
how can we survive that xD
it will, because mobs collide
ah...
i havent tried this in survival but i have tried this in creative
and yea
fadeIn - time in ticks for titles to fade in. Defaults to 10. stay - time in ticks for titles to stay. Defaults to 70. fadeOut - time in ticks for titles to fade out. Defaults to 20.
defaults to 10 is what?
10 second or what?
i didnt get it
10 ticks, It says ticks
Ticks?
20 ticks to a second
ticks means?
ah..
ok...
thanks
and what about 100L?
Bukkit.getScheduler().runTaskLater(this, () -> {
event.getPlayer().sendTitle("5 Seconds",null,);
}, 100L);
like here
what are you trying to achieve
100L delay
100L is the delay in ticks
20L ≈ 1s
when player break a block then random mob should spawn
and you want the mob tos pawn in the block?
no
on the block
nvm i am very bad at explaining
thanks btw
i will try this by my own
:)
see
i want to spawn mob on block where player was standing before while breaking a block
spawn it at the block's locstion then, maybe add 1 so the mob doesnt suffocste
oh well then your code is right
as long as you have the blockbreakevent listener registered it will work
yea thats happening
but where to add 1?
Y level right?
LOL
I'm editing the config of the plugin with
plugin.getConfig().options().setHeader(Arrays.asList("Header.."));
plugin.getConfig().addDefault("Path", "String");
plugin.getConfig().setComments("Path", Arrays.asList("Comments", "etc."));
plugin.getConfig().options().copyDefaults();
plugin.saveDefaultConfig();
But when I change one of the values it changes it in the file but doesn't update it ingame, even after reloading?
yeah that should work, nice drawing btw
lol
i come into this channel and all i see is a paint drawing of a dude on a block mining a block 😆
thanks
just spawn the mob at the player.
location.add(0, 1, 0);
0 will affect coords?
0 adds nothing to x and z coordinates
ok.. lemme try
btw
public void onBlockBreak(BlockBreakEvent event){
event.getPlayer().setHealth(20);
Bukkit.getScheduler().runTaskLater(this, () -> {
event.getPlayer().sendTitle("2 Seconds",null,0,20,0);
}, 20L);
Bukkit.getScheduler().runTaskLater(this, () -> {
event.getPlayer().sendTitle("1 Seconds",null,0,20,0);
}, 20L);
Bukkit.getScheduler().runTaskLater(this, () -> {
event.getPlayer().sendTitle("0 Seconds",null,0,20,0);
}, 20L);
Location location = event.getBlock().getLocation();
location = location.add(0,1,0);
EntityType entityType = EntityType.values()[new Random().nextInt(EntityType.values().length)];
event.getPlayer().getLocation().getWorld().spawnEntity(location, entityType);
}
is this good?
Bear in mind all those tasks are going to run after 20 ticks, not 20 then 40 then 60.
Scheduling a task will not lock the current thread so they will all schedule immediately, not once the previous is finished.
You can just do java Location location = event.getBlock().getLocation().add(0, 1, 0);
okay..
;-; then i have to change ticks right?
yh
The code to spawn the mobs is outside of the scheduler
but it should run scheduler first then spawn mob code
right?
Yh so only the runnable of the task is what's run later as Minesuchti said.
You need to put the rest of your code inside of the runnable, otherwise it'll just run when the event happens.
You have to put the spawn mob code inside of the last scheduler
ah....
ig i got it
and what about setTitle color?
can i use ChatColor?
or minecraft color codes
why its not counting from 3?
Bukkit.getScheduler().runTaskLater(this, () -> {
event.getPlayer().sendTitle("\u00A703 Seconds",null,0,20,0);
}, 20L);
Bukkit.getScheduler().runTaskLater(this, () -> {
event.getPlayer().sendTitle("2 Seconds",null,0,20,0);
}, 20L);
Bukkit.getScheduler().runTaskLater(this, () -> {
event.getPlayer().sendTitle("1 Seconds",null,0,20,0);
}, 40L);
Bukkit.getScheduler().runTaskLater(this, () -> {
event.getPlayer().sendTitle("Spawn!!!",null,0,20,0);
Location location = event.getBlock().getLocation();
location = location.add(0,1,0);
EntityType entityType = EntityType.values()[new Random().nextInt(EntityType.values().length)];
event.getPlayer().getLocation().getWorld().spawnEntity(location, entityType);
}, 60L);
yh if you've got this many u should just repeat.
?scheduling
is it bad?
hello I have a question since last night we are on it how to put the faction name that we left with the animated name plugin thank you for your answer
you can quite easily end up polluting the scheduler with too many tasks if you get used to doing it.
Animating names in chat is a bad idea
Why ?
what do you advise me?
You will have to resend the entire chat to the player every time a color changes. This isn't good for performance
Not animating things in chat
okay....
i have to practice this
so basically instead of having 4 tasks (1 for every 20 tick increment), have 1 repeating task that happens every 20 ticks and then cancel that task after 4 executions.
do you have a better plugin or not
animated names
wondering whats wrong with the syntax
could be that stuff is a keyword
Also holup you don't close the SQL statement
You're missing a ) at the end.
ur not the only one
I wonder did someone make an object oriented sql wrapper?
yes
there are some libraries ye
ORMs exist
Oh didn't knew that
when I searched for it nothing really came up
If you work with SQL in a framework like Spring ur gonna be working 100% through an orm and likely not writing most of your queries in SQL (unless you use something like flyway for db versioning + updates).
aha
Okay....
I got it
Thanks all of you for helping :)
np gl :)
Hey the plugin I made was in 1.18.2
So if I tried to run that in other version so will it work?
should i save a location as a string in the database?
hmm thats probably going to give issues with the length
so I was planning to remake hypixel slayers, and I need help with the score board, where the boss name and the amount of mobs killed required to spawn the boss will appear as well as the health showing in 1,65,000 and not in 1.5m format
the part below Slayer quest
is the counter thing
help pls 😔
no no the health
from 400,000
to 400k
I dont see any tuts
or number formatting
does anyone knows what the max length for a world name is?
if (!(boss.isDead())) {
Location l = boss.getLocation().add(0, 0.3, 0);
if (Math.round(boss.getHealth()) > 800000) {
name.setCustomName("§c☠ §bRevenant Horror §a" + Math.round(boss.getHealth() / 2) + "§c ❤");
} else if (boss.getHealth() >= 800000) {
name.setCustomName("§c☠ §bRevenant Horror §a" + Utilities.formatValue(Math.round(boss.getHealth()) / 2) + "§c ❤");
}
boss.getWorld().playEffect(boss.getLocation(), Effect.MAGIC_CRIT, 3);
name.teleport(l);
boss.getWorld().playEffect(boss.getLocation(), Effect.HEART, 2);```
will dis work?
only till / 2
so?
are the minecraft's NMS inventories stored in some kind of registry
or are the removal of the inventories handled by garbage collector after no references to that particular inventory exist
I got ghost pinged
I bet its as long as your OS FS supports
it should be platform dependant
at least in theory
I would cap it if you're storing in a db just in case
Setting an upper limit to the string length.
ah
lets just use a varchar(20)
also whats the best way to create all tables in the database, im creating multiple preparedstatement rn?
Do you need to use a prepared statement if you know what the statement is beforehand?
Any android developers?
uhm ye
What kind of effect?
how do I add custom textures as ranks to the server?
I mean you don't need to though but it doesn't do anything
yeah I now but I cant give a player the rank then
Why it is working on 1.16, but on 1.8 it can teleport player to water
Location searchingLoc = searchLocation(p.getWorld());
while (searchingLoc.getBlock().isLiquid())
{
searchingLoc = searchLocation(p.getWorld());
}
searchingLoc.add(0, 1, 0);

can I also code this ? Like when I do a command it gives a player this custom texture?
Yes the name aspect at least
i saw people replacing weird chinese symbols
oh okey Like is there a server where I can get help with texture packs haha
hi this is my code
https://paste.md-5.net/xoniragono.java
and when i am in the game i can't move things in my inventory and to chest... tag pls help
I'm not an expert but i dont think creating tables have to be efficient
You only do them once
You can even use regular statements
I have a problem adding NMS 1.18, I did everything according to https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-2-release.534760/
But unfortunately it doesn't work
Preparedstatements for getting and setting
no you didn't run buildtools for 1.18 --remapped
hmm ye just a for loops which creates a statement f/e query
Can use 1 statement
Is it possibile to access my plugin classes inside of patched spigot jar?
Statement.executequery(sql)
i have multiple queries for each table to generate
hi this is my code
https://paste.md-5.net/xoniragono.java
and when i am in the game i can't move things in my inventory and to chest... tag pls help
Oh man that code could use some heavy optimization
time to create a gui class with clickevent consumers for eeach slot
@eternal needle why not using a switch in a switch?
kekw
i did find the error
i think at least
how can i make an item entity immune to lava burn?
if I have an itemStack that it's material is Enchanted_book does it glow or do I need to enchant it and hide it?
enchanted_book does glow by itself
ok
however if you don't have any enchants it will translate to normal book ig
fire resistance?
so i add the effect?
wdym
nvm try it and see
you can make an event to detect when you're in lava and give the effect when needed
any android developers?
because i wished to add the item a certain PDC tag to make it immune so i'll try this
ok
i dont think this is the place where you should ask that
@tardy delta It's a general development forum
for spigot
nope
Most people think that, it's false
k dude
any android developers?
ask other questions here
dude just search another server to ask that
No?
this server is for spigot
when people spam "?" even though they know the opposite side is correct
this is literally so funny to see every time
I mean you can ask if there are android devs here but it seems like there isn't
i just don't know what the hell did you mean
because it was dumb
It's a huge discord server, most likely there's many
thats why i sent the ????
I just need to wait
Being unable to understand simple english doesn't mean simple english is dumb 🙂
you mock me to make yourself feel good and strong because you know you're not so you try to be toxic to make the illusion that you're not a loser
Y'all need to chill
The most ironic sentence I ever read, good luck with being so toxic in your life 🙂
I was chill until that
Does lava cause damage or does being on fire because of lava cause damage?
lava
once again, another ironic sentence which he never said 😄
the kids here must vanish
Ty
You'll have to move far away for his chunk to unload
com.mongodb.MongoSocketReadException: Prematurely reached end of stream | Does anyone know how can i fix this error when i try to connect to MongoDB?
public class Deaths_Acolyte {
public static final Color COLOUR = Color.fromRGB(36, 40, 52);
public ItemStack helmet() {
ItemStack item = SkullCreator.itemFromBase64("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjU5MWM4OGY1OTc4ZmZiY2NkMjcyMDM5NmM3NTM0ZTBkNGVkMWI0NzViNmRmOGRhYjdjN2VjODFjZmE3NDA0ZSJ9fX0=");
ItemMeta meta = item.getItemMeta();
return item;
}
public ItemStack chestplate() {
ItemStack item = new ItemStack(Material.LEATHER_CHESTPLATE);
LeatherArmorMeta meta = (LeatherArmorMeta) item.getItemMeta();
meta.setColor(COLOUR);
item.setItemMeta(meta);
return item;
}
public ItemStack leggings() {
ItemStack item = new ItemStack(Material.LEATHER_LEGGINGS);
LeatherArmorMeta meta = (LeatherArmorMeta) item.getItemMeta();
meta.setColor(COLOUR);
item.setItemMeta(meta);
return item;
}
public ItemStack boots() {
ItemStack item = new ItemStack(Material.LEATHER_BOOTS);
LeatherArmorMeta meta = (LeatherArmorMeta) item.getItemMeta();
meta.setColor(COLOUR);
item.setItemMeta(meta);
return item;
}
}
i have some common operations that apply to all pieces such as colour, or other properties
how could i do this efficiently
?kick @harsh totem inappropriate behavior
Done. That felt good.
heh
Hello, how can i place a a player's Perm to the scoreboard
i dont know how to use placeholder
anyone?
I mean COLOUR there is pretty much a constant tho
why do you need the itemmeta in the helmet anyway?
for future use really i plan to add itemlore + enchantments
final Color COLOUR = Color.fromRGB(36, 40, 52);
this better?
why is const still a reserved keyword but still not in use 🤷
🤨
yeah cause static final does the job apparently 🥦
Ok dude
Do you have some tips to learn java for beginners? Some paths or advices
Yeah, don’t dive to deep into stuff at first, focus on learning object orientation and its concepts as well as Java first
I was kicked for responding to a toxic guy
anyone?
fun
?learnjava x)
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.
What is NECESSARY to understand?
That’s a very good question
basics
It doesn’t have an absolute answer
Thank you soo much
Usage of variable types, classes and functions
But once you can understand how for instance spigot api works then you pretty much know the sufficient knowledge @robust zenith (with that being said, also being able to create something similar to spigot api in addition)
Im trying to publish my library using github packages, but I have some errors
build gradle publishing
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/TheTuso/xCore")
credentials {
username = "TheTuso"
password = "token here"
}
}
}
publications {
register<MavenPublication>("gpr") {
from(components["java"])
}
}
}```error```fix
Execution failed for task ':publishGprPublicationToGitHubPackagesRepository'.
> Failed to publish publication 'gpr' to repository 'GitHubPackages'
> Could not PUT 'https://maven.pkg.github.com/TheTuso/xCore/pl/tuso/core/xCore/1.0/xCore-1.0.pom'. Received status code 422 from server: Unprocessable Entity```info from the link```fix
maven package "pl.tuso.core.xCore" does not exist under owner "TheTuso"```
(Beginning) Understanding of Object Oriented, Lists, Methods, Inheritence and Polymorphism, Class Types, Packages, JRE
(Functional) Lambda Functions, Threading and Concurrency
(Corporate) You actually being god in this phase.
how can i check if LeatherArmorMeta meta = (LeatherArmorMeta) piece.getItemMeta(); is not null
god: you own this discord
Md5 
No, Oracle
the meta of leather armor will never be null?
also why are people thinking that there are funny by not having a pfp
alex will see a black circle on his light mode lol
ItemStack#getItemMeta is nullable iirc
i have 4 items in the array one is a skull so no leather item meta
I don't think that they do it because it's funny
some items dont have a meta but iirc leather armor has a meta
Yup they do
to being not dmed
What items don't?
only air maybe
air
air is new ItemStack(Material.AIR)
Yeah but you can use null instead of that in many cases
i 1.16 i sometimes got air and sometimes null from empty slots
it's pretty incosistent
public class Deaths_Acolyte {
private static final Color COLOUR = Color.fromRGB(36, 40, 52);
public static ArrayList<ItemStack> pieces = new ArrayList<ItemStack>();
public ItemStack helmet() {
ItemStack item = SkullCreator.itemFromBase64("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjU5MWM4OGY1OTc4ZmZiY2NkMjcyMDM5NmM3NTM0ZTBkNGVkMWI0NzViNmRmOGRhYjdjN2VjODFjZmE3NDA0ZSJ9fX0=");
pieces.add(item);
return item;
}
public ItemStack chestplate() {
ItemStack item = new ItemStack(Material.LEATHER_CHESTPLATE);
pieces.add(item);
return item;
}
public ItemStack leggings() {
ItemStack item = new ItemStack(Material.LEATHER_LEGGINGS);
pieces.add(item);
return item;
}
public ItemStack boots() {
ItemStack item = new ItemStack(Material.LEATHER_BOOTS);
pieces.add(item);
return item;
}
static void properties() {
for (ItemStack piece : pieces) {
LeatherArmorMeta meta = (LeatherArmorMeta) piece.getItemMeta();
if (meta != null) {
meta.setColor(COLOUR);
piece.setItemMeta(meta);
}
}
}
}
where should properties be called?
ah i thought it was fixed in later versions
Does anyone know how to make custom enchants or has a good tutorial? I haven't found one
is it "safe" to store entity instances or can they change while the server is running?
make your array list private and non-static
Just a simple question.
Inventory CzarnaMateria = Bukkit.createInventory(null, 9, "§d§lSKLEP ZA ANTYMATERIE");
ItemStack elytra = new ItemStack(Material.ELYTRA);
ItemMeta meta1 = elytra.getItemMeta();
List<String> lore = new ArrayList<>();
lore.add("§dTajemnicza elytra dająca Uzbrojenie Klaty");
lore.add(" ");
meta1.setLore(lore);
meta1.setDisplayName("§d§lELYTRA Z ANTYMATERI");
elytra.setItemMeta(meta1);
When I have an elytra i want to give her an armor stats: =+8
How to do it?
You can make it final i think
i mean just do Arrays.asList with some method that applies your stuff to the leather armor
I highly recommend using the API of an existing one. You can use EcoEnchants, it's open source
but where do i call properties?
Ok thank you i'll check it
????
ho to set Armor stat to elytra?
iirc metadata can implement Attributable
run an instanceof check
and cast
then you can use its methods
to get and set attributes
public class DeathsAcolyte {
private static final List<ItemStack> pieces = Arrays.asList(
SkullCreator.fromBase64(/* bla bla*/),
createArmor(Material.LEATHER_HELM),
createArmor(MATERIAL.LEATHER_BOOTS),
// etc
)
private static void createArmor(Material armour) {
var stack = new ItemStack(armour);
var leatherMeta(LeatherArmorMeta)armour.getItemMeta();
leatherMeta.setColor(Color.fromRGB(36, 40, 52));
armour.setMeta(leathermeta);
return armour;
}
}```
also, use ChatColor instead of § and don't use TitleCase for variable names
Just a simple question.
Inventory CzarnaMateria = Bukkit.createInventory(null, 9, "§d§lSKLEP ZA ANTYMATERIE");
ItemStack elytra = new ItemStack(Material.ELYTRA);
ItemMeta meta1 = elytra.getItemMeta();
List<String> lore = new ArrayList<>();
lore.add("§dTajemnicza elytra dająca Uzbrojenie Klaty");
lore.add(" ");
meta1.setLore(lore);
meta1.setDisplayName("§d§lELYTRA Z ANTYMATERI");
elytra.setItemMeta(meta1);
When I have an elytra i want to give her an armor stats: =+8
How to do it?
nefefer read what i wrote just 2 seconds ago
then ask for explainations
imagine using var
cast the itemmeta of the elytra to Attributable
i was too lazy to type it out