#help-development
1 messages · Page 2263 of 1
There isn’t special source for gradle which is honestly..
gradle is sigma
gradle is like "I'm faster than maven, but I also cannot really do anything without 3rd party plugins, not even shade anything lol"
Forking🍴 🍴 🍴 fork
You can!!!!
I use this plugin often, and this is how they handle their nms with reflection
how?
i always thought it requires this plugin from some random github dude
because everyone is using it
Yeah well people like to use that plugin since they don’t have to fuck with the volatile gradle api themselves
Good point
ehhh, well I am making this plugin as a resource for spigot
i dont want to be like, oh and download this!
Could I shadow it?
shadow what exactly?
Shading spigot?
done it, didnt work well
lol
Lol
I'll add a TPS method to my lib now lol
🥲
Gradle superior
but I need a bit because I gotta compile spigot 1.16 to 1.18 before I can recompile this >.<
Gradle stans rise
I don’t play comp but bronze 3 cause that’s what I got in placements lol
Ah nice
My actual rank is probably gold or plat
Well I play against gold players and I beat them before
Guys i am developing mc server
Fair
can anyone say me best kill counter plugin
^
Can u say me pleas
no
Idk any plugins we are just coders
if you are developing it, just make your own?
can u code on script
Lol
Skript?
ugh
yea
wtf is skript
XD
I have written Skript
we people in here cant code, we just bullshit at others code
sounds bad
And it’s quite limiting to say the very least
ik I used it before I started to learn programming
why do you hate yourself
How are you still alive
Idk
bruh
My condolences
ask in the correct channel and stop spamming here
Its like using a bike, just why?
#help-server buddy
kick him
Hi
where?
Lol
compiling spigot on a dual care laptop is no fun
How do you set the obfuscation thing on gradle
Paper weight?
Or do you something else
I use paper weight
But like I get the paper api so ye if you don’t want that it gets a bit tricky
(You basically have to hack around to remove it from the classpath)
Alright
Use spigot 🤷🏿♂️
i love how gradle always only causes problems for everyonne
^ might be worth while to convert in your case
yet they claim its so much better
I know how it feels using a secondary tool but well
paper and gradle, bow down to me
@Override
public double[] getTps() {
return new double[3];
}
problem solved ig
wait whut
return ((MinecraftServer)Bukkit.getServer()).recentTps;
does this actually work? Is the actual NMS server implementing Bukkit's Server interface?
Check implementation to see if CraftServer implements it
I always thought there's a separate bukkit server thing like in CraftPlayer vs NMS Player, etc
yeah as I thought, this is bullshit. no idea why someone sent this
CraftServer.getHandle() returns the MinecraftServer and simply casting the Bukkit Server wouldnt work at all lol
oh wait I'm talking bullshit too
CraftServer.getHandle returns a DedicatedPlayerList? o0
yeah that works fine
if someone here has the time. how would one approach making a "quest" or "achievement" system, ive always been thinking about it but just find it very hard to come up with a good solution. because a quest/achievement can be many different things. anyone willing to point me in a good direction?
but that can't possibly work
it doesn't implement (or extend, whatever) neither Server, nor CraftServer
I’d start with detection systems
Look at mods and how they check for crafted items, smelted items, etc
Like betterquesting
is it open src?
Or HardcoreQuestMode
It’s a mod
thanks. il take a look at that
FTBQuests also good too
heard BetonQuests is neat altho idk if it’s open source
Whats the method for getting ChatColor for RGB values?
looks like it is open source
ChatColor.of(hex)
it's messy to configure but it can do like everything
hmm /reload broke my own plugin
just shut down the server on /reload and tell people not to use it
ok don't shut it down but print many warnings
or fix this problem 😛
the best way to instantly stop the JVM is to use Unsage#putAddress
lmao
yeah sure, just call the shutdown executablbe
How can I get file from the resources folder in plugin?
JavaPlugin#getResource
I think
in case anyone still cares, here's how to get the TPS on 1.19
@Override
public double[] getTps() {
return ((CraftServer)Bukkit.getServer()).getHandle().getServer().recentTps;
}
[0] for last 1minute
oh is that it?
this happens because you add or remove elements from a collection while iterating over it. Use an iterator or switch to a concurrent collectionn
I'm creating a discord bot in a minecraft plugin, which discord server do I ask since it isn't working? (Sorry for butting in)
They are using Iterator
I also tried iterator
like so:
ShipCannon.getShotBalls().iterator().forEachRemaining(as -> {
if (as != null)
CannonBallEventManager.collided(as);
});
or like
for (Iterator<ArmorStand> it = ShipCannon.getShotBalls().iterator(); it.hasNext(); ) {
if(it.next()!=null ) {
}
}
but both threw error
oh its because im not using mappings because gradle is being a blank
just use ArrayList#removeIf
balls.size() > 1
simplify that with false
non
no*
you create a new iterator everytime
you have to reuse the same iterator all the time
i also need to execute some methods
he wants to collide his balls
oh yeah its line above the ctrl c
don't use a for loop, use a while loop
:))
noice
it hurts tho
ngl it does
Iterator<Thing> it = whatever.iterator();
while(it.hasNext()) {
Thing thing = it.next();
// Do thinngs
this should work fine
right thx
some people are into that ¯_(ツ)_/¯
weird ppl
Anyone know any good JavaDocs generators so I can auto generate docs and then go back and edit some things
uhh
?paste
my man just requested paste site
so he can paste into discord xDDD
you are adding or removing from the collection in your collided method
keep getting - Plugin Repositories (could not resolve plugin artifact 'io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.3.3') Searched in the following repositories:
true
but how to remove it and not get any error?
show your "collided" method
I bet you remove or add elements inside there
it.remove()
just use a copyonwritearraylist or a concurrenthashmap lol
collided checks if it collided
thats all
but calls different method that does:
Location loc = as.getLocation();
World w = as.getWorld();
w.spawnParticle(Particle.EXPLOSION_NORMAL,loc,10);
w.playSound(loc,Sound.ENTITY_GENERIC_EXPLODE,6,1);
shotBalls.remove(as);
List<Entity> nearby = as.getNearbyEntities(5,5,5);
nearby.forEach(entity -> {
if(entity instanceof Player){
((Player) entity).setHealth(((Player) entity).getHealth()-4);
}else if(entity instanceof LivingEntity){
LivingEntity le = (LivingEntity) entity;
int remove = 8;
if(le.getHealth()>=remove)
le.setHealth(le.getHealth()-remove);
else
le.setHealth(0);
}
});
as.remove();
or stop manipulating your collection while iteratinng
see? you call "shotBalls.remove"
while iterating
stop doing that
Does Bungeecord have an API way of loading Plugins at Runtime? Or do I need to use reflection
Change your collided method to return a bool, then use if (CannonBallEventManager.collided(as)) it.remove();
Hello guys i have a problem
in one of my old codes there is a bug that i don't understand at all
so its a knockbackffa plugin's jumppad system that if players place a gold pressure plate with a tag,
it will start a task that will reload the thing and give the player the item back
and because of 1.8, if you place a jumppad it can turn into air quickly for some reason in some condition
If you say change to a new version you will be blocked cause im getting payed to do it in 1.8
so i will add the task id to a list that will be looped and make all the tasks in it cancelled when a player dies or leaves or map resets
a new Reload object would be made so it's value will be shown in scoreboard
for some reason the task won't start
change to a new version

- do it in newer version
- ViaBackwards
change to a new version
that one is already blocked
I don't even know what you mean by the turn into air quickly
for some reason
if you place it right next to a rose
it will turn into air
and in the blockplacevent
block.getType still returns gold_plate
alex is into ball busting confirmed
so i will do the check 1 tick later
I think he meant himself by "some people"
i do too.
In teh place event it shows as a gold_plate because you are testing the Block you are about to place (cancellable)
but for some reason this task won't start
in it's constructor
i create a new Reload
that will be addet to a list
If you get the actual world Block not event.getBlock it will be air
changed a bit and works
thx
somehow this object won't be created
anyway if you ask people to not tell you to update, then of course people tell you to update anyway. especially if it's 1.8. I mean that's so old, there have been more releases since 1.8 came out then before it came out
so should i getWorld
and then
getBlockAt
and it will be fixed ?
if you want to see what block is currently IN the world
so i should try getting the actual block
and not event.getBlock
it might be fixed and the 1 tick will go away
?
event.getBlock will be the plate you are about to place
why would I refer to myself as "some people" lol
Change to a newer version
Block me pls
me too
people won't understand
If you took a task that’s 1.8
so it wouldn't look like you are the only one
and stop worrying about performance
and also use ocm
or this purpur option
so 1.8 pvp that kids hate will return
what the heck are you talking about
i don't understand
me neither. just update lol
oh no, debate against 1.8, someone is getting death threats again
why you care
they asked for it
what version i use
if you can
help
if you cant
don't
stop shittalking
and being like a jerk
Update to 1.19 🙂
or 1.19
and make it so people wont even see my shit
but why would they send death threats
some people just need to make something for 1.8 and need help with something, why do you have to be such rude
not like a jerk
being a jerk
not like it
being it
who? I havent seen any death threats
Because we don’t support legacy versions
That’s how it works lol
then don't reply
will it make you happier to
are you currently having a stroke or sth? because this makes no sense to me
bullshit about someone's version ?
i once said that I work with 1.8 and some three individuals sent me death threats lol
No, not just me. We don’t support it
That’s too far. But the concept still stands to update
No they didn;t
Things that never happened
if someone uses 1.8
okay, listen, if you don't support it, that's your rhing, if someone is helping them, don't be rude
that's a bit too much lol. I only just tell people to update to a supported version instead of using a version that is sooo old that it can already legally sign contracts meanwhile
don't reply to them
does it make you happier
this dude literally goes and yells around "love is love support me"
I didn't reply to anyone who sent me death threats, I usually block and delete them, why bother with such smooth brains
yeah i want to say version is version
Not me. This doesn’t just apply to me but this place in general does not support legacy versions
won't ever ask for help in a server with you jerks
that's good
not wanting to help
okay good bye, have a nice day
That’s outside our scope
won't show this annoying thing
but if they ask that question, isn't it easier to just not reply if you don't want to instead of harassing them?
betterdiscord will not magically fix all the quirks of the 1.8 API
Does it look like I’m harasssing anyone?
need help with gradle paper weight
Plugin [id: 'io.papermc.paperweight.userdev', version: '1.3.7'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.3.7')
Searched in the following repositories:
Gradle Central Plugin Repository
noonne harassed them. we only told them "update to a newer version"
You never know, they may take the hint and update. Some actually do
yes
you are trashtalking
about 1.8
gotta wait for some time rn
its war between version now
a version that im asked to use
Trash talking?
well, saying they should update them or they won't get help isn't anything remotely helpful
and being payed to use it
All I said is to update
Not trash talk
no problem at all
oh lol
instead of this
update
Why is it whenever I open this server it's in utter shambles
but why? if they are working on 1.8, that's their thing, don't reply if you don't want to help
Great timing? 🙂
Lol someone drag 7smile here heeheehaw
@small current why are you spamming?
just come to my place and try to "remove me from existance", my address is on my website. but I won't be home until july 17th
🍿
is that salty or with sugar? :3
Lol
give me one as well
🥺
🍿 👌
🦵 🦵
🍿 <- salt | sugar -> 🍿
🍿
👀
thanks, I'll take the sugar one! ❤️
erm
I meant salt
shit
Salt > Sugar
I once sent this to Server Owner
and got blocked for 1 day :DD
🤨
"Good Night"
.<
i’m sorry why wouldn’t it be
this is the spigot discord
more specifically, help dev
čech/slovák? 🤨
cech brasko
yeah this discord is meant to
- mock 1.8 users
and that's all there's to say
let's gooooo
ty taky ne
jaj neva
I fixed my problem while I waited for your version war to end
how?
btw there's no war, everyone knows that 1.8 sucks
fax
i mean the combat tho
even 1.8 users know it. they just call the lack of features "better performance"
and they call "I'm too bad for real PvP so I just wanna spam left-click" "better combat"
Just because its true doesn't make it correct
can I raycast x blocks forward?
and get the furthest location
people got their opinions
i will just do a debug
wait, weren't you also the guy who claimed that I'm a rapist and that I molest children just because I'm gay?
yeah it was you
nice
without having a hit to some block
do you actually want to pass through blocks?
nah
I do that but if I aim at nothing
it return null as RayTraceResult
yes
the player is maybe looking into air
therefore no block
it will return the last air block within distance then
that returns null if no block is in range (targeted)
oh thx
weirdly this isn't documented but I once tried it just for fun and it ALWAYS returned a block for me
I basically used getTargetBlockExact (or maybe just getTargetBlock? not sure) to display a hologram to the player and it worked fine
If you just want the block at X distance then don;t raytrace
yeah just get the player's locationn and normalize and multiply their facing direction with the desired distance
does someone have a maven settings.xml quickly, with repository credentials?
thx works
for someone needing the code:
Location l = shooter.getLocation().toVector().normalize().multiply((shooter.getLocation().getDirection().multiply(distance))).toLocation(shooter.getWorld());
Perfect! Thats definitely way faster than raytracing
was aiming there
but my projectile that was flying to the location landed ~ where my hand is
um, thats long windedjava Location l = shooter.getLocation().add(shooter.getLocation().getDirection().normalize().multiply(distance));
Is it possible to asynchronously register a command?
Is there a purpose for doing it async?
do the IO Async then use Bukkit.getScheduler().runTask to run it sync
the scheduler jumps back sync, or just a Future
I'm using RDS MariaDB, how to pass SSL HandShake?
Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
yes
GameProfile gameProfile = new GameProfile(UUID.randomUUID(), "&cBadger"); Like this?
you may need to translate it first
translateAlt right?
not sure it will auto translate
or is there an nms method
be aware any profiles you do create will be added to the servers playercache
CraftChatMessage.fromString
they will expire, but they do get added
lol
I hate how this method has like a 3058589 characters long name lol
Don’t listen to me with that one second
what does this mean?
translateAlternateColorCodes... why not just "translateColors" or sth lol
It means you will bloat your playercache json file
Because the normal one is the weird symbol and you are using alternate characters to resemble it
I guess
so don;t go creating hundreds of profiles
Erm wait
no
just creating a GameProfile won't touch the player file at all IIRC?
but you can decrease performance
i c
not player file, usercache
restarting clears cache?
no
how 2 clear
yeah that's what I meant. But if you only create the Profile, will it still touch that file?
yes
oh didnt know that
{"name":"Test","uuid":"d8d5a923-7b20-43d8-883b-1150148d6955","expiresOn":"2021-09-27 17:22:03
then I should change some things in some plugins
did you properly sign the texture?
correctly applying it?
but you create a gameprofile with a differennt nname
btw sorry about my typing, my n and b keys are stuck so I sometimes miss those letters or send them twice lol
GameProfile gameProfile = new GameProfile(UUID.randomUUID(), ChatColor.translateAlternateColorCodes('&', "&cBadger"));
JSONArray array = SessionRequest.getJsonArray("f232b11be35542eea524b14a658e2240");
String value = SessionRequest.getValue(array);
String sig = SessionRequest.getSig(array);
gameProfile.getProperties().put("textures", new Property("textures", value, sig));```
profile.getTextures().setSkin(new URL(getURLFromBase64(base64Texture)));```
```java
private String getURLFromBase64(String base64) {
return new String(Base64.getDecoder().decode(base64.getBytes())).replace("{\"textures\":{\"SKIN\":{\"url\":\"", "").replace("\"}}}", "");
}```
oh so i found the issue
also isn't there now an API for this?
ps.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER, npc));
nope 😦
this removes the skin
https://paste.md-5.net/amepedotoh.java
someone posted this a while ago
you sure? what about PlayerProfile?
oh what
twas me 🙂
i have no seen that
it was added in 1.18.0 IIRC
either 1.18 or 1.19
ooo fun
definintely 1.18
1.19 added barely anything
ah ok. On a different topic im looking at decompiled spigot code and i saw this as import: org.jetbrains.annotations.NotNull;
Is that actually there or is that added by my IDE? Im on intellij
who is jeff
me
alex
i thought u were alex
jeff alex
those annotations are already there in the actual code
its not even alex either
ah ok. I'm trying to make an event rn
mfw alex
yeah alex is my actual name (well, it's Alexander) but I some time chose to call myself jeff on the internet lol
no idea why
name twins what??
owo
why are so many people named Alexander in this generation anyways
are you alex too?
i know like ten
Alexander
hmm is reloading the server calling onDisable and onEnable after e/o?
sucks
everyone saw me and decided "damn, what a fine looking, smart cute boi, guess I name my son Alex too"
the alexanders i know range in size and statue from waif to wrestler
so it got nothing to do with that i fear
im a wrestler
i'm more a waifu person lol
mfw
😵💫
mfn
im going back to paper
pepperspigot
nachos
it's paper with excessive usage of lombok
@Cleanup
Weirdos
im not usin it
only annotations i know are @Override and @EventHandler
Won't that block again?
:((((
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>20.1.0</version>
<scope>compile</scope>
</dependency>```
thanks
23.0.0 is latest
probably
new BukkitRunnable() {
@Override
public void run() {
ps.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER, npc));
}
}.runTaskLater(Npctdi.getInstance(), 20);```
so weird
but fixs issue
in a runnable
What?
jetbrains is the company that made eclipse and i was confused why it didnt know the import
Eclipse? Huh
You talking about the IDE?
Yeah lol
No that’s a separate dependency
It’s not automatically added
However, it is made by jetbrains too
yes, but why not?
Wdym
runAsync just runs it asyncroniusly
Doesn’t block
I want to run some IO stuff and if the operations were successful I want to register a command
Then you could do the normal run method that accepts a runnable and runs it on the main thread
iirc you can register and deregister commands and events outside of enable code
that is not the point here
aren't you registering commands on startup? I wouldnt worry about blocking stuff in onEnable or onLoad
Here’s what I’d do
well thats right as well
CompletableFuture.runAsync(IO Stuff).thenRun(Registering Command)
I mean sure, IO stuff should be done async at runtime, but during onLoad... just go sync lol
Yeah is there any reason for what you are doing?
Yeah, so thenRun runs it on the main thread again?
If I wanted to do a db query as I startup I'd CompletableFuture Async in onLoad, then use teh data in onEnable
For the record, Eclipse IDE is Eclipse Foundation. ;p
btw does anyone know if one can tell MySQL to "fake" lags?
It should
not really on startup tbh
e.g. something like WAIT(1000); SELECT * FROM ... just to see if the callbacks etc are actually working?
anyway I'll go swimming now, have a nice day everyone ❤️
wait how are you a programmer and can stand the sun
I’m on vacation right now too lmao
bruh have you never seen me? I'm always tanned af lol
0
DIE();
how do i generate caves with perlin noise?
does anyone happen to know of a way to prevent an entity taking damage without cancelling the event or reducing the damage through the event
preferably also not using stuff like resistance potion effects
ohh right
i could try that
though i still kinda need them to take the damage tick for natural knockback reasons
So why don't you want to reduce the damage then?
im making a custom damage system, it currently works by reducing the damage to a very low value and then setting the health lower manually
Thread.sleep before the query?
issue is it doesnt work with damage indicator plugins/mods
you could use the EventPriority so your custom damage system can still overwrite the damage after your knockback plugin set it to 0
declaration: package: org.bukkit.event, enum: EventPriority
is there like a way i can set the damage back to its original value specifically with the MONITOR event priority
No changes in Monitor
i know the changes dont reflect in the game which is good or is it actually just not possible to edit events in monitor
or would i need to do some packet editing shenanigans so the packet sent to the player still reflects the amount of damage dealt
is bossbar::getPlayers::clear reflected ingame?
i believe so
bump
3d perlin noise spits out a 0-1 double value for every coordinate, differing depending on your seed for it. You declare above which value you're filling in that coordinates with air
So im setting client side blocks and im using player#sendBlockChange() however when doing large scales of changing it causes large amounts of lag on the client side. I want to disable the lighting calcs etc and I need to do this with nms, does anyone know how to do this?
lightning is calculated server side. there should be something akin to not doing a physics update for lightning
the thing is, I have that but it just does basically random.nextBoolean() (it spits out random numbers)
you'll have to look how to generate perlin noise. if it is seemingly random i think your scale is too big
youre supposed to see a gradient
ill look into it later
I'm using the bukkit one
Can someone help me rebuild one project? I just wanted to add three lines to the Hikari MySQL connection, but i cannot build it
Hm yeah lol why havent i thought of that lmao
Thx!
Whats the problem?
help, my perlin nosie/any noise is really random and idk what to do
code:
private ArrayList<Block> makeCave(World world, Random random, Chunk chunk) {
ArrayList<Block> cave = new ArrayList<>();
int blocks = 0;
final int maxBlocks = 10000;
SimplexNoiseGenerator perlinNoise = new SimplexNoiseGenerator(world);
for(int x = chunk.getX(); x < 20; x++)
for(int z = chunk.getZ(); z < 20; z++)
for(int y = 0; y < 20; y++){
if(blocks > maxBlocks)
return cave;
Block block = getBlock(perlinNoise, world, x, y, z);
if(block != null)
cave.add(block);
blocks++;
}
return cave;
}
private Block getBlock(SimplexNoiseGenerator perlinNoise, World world, int x, int y, int z) {
final int octaves = 3, frequency = 8, amplitude = 64;
double e = perlinNoise.noise(x, y, z);
if(e <= 0 && y > 4) {
Bukkit.getLogger().log(Level.INFO, x + " " + y + " " + z + " " + e);
return world.getBlockAt(x, y, z);
}
return null;
}
this generates 202020 big cube that should have open spaces inside, but instead it looks like if I'm doing
if(random.nextBoolean())
cave.add(block);
idk where else should be the mistake because everything else works
I am getting this error when trying to unload a world. Any ideas? Thanks in advance[18:26:01 ERROR]: Couldn't save chunk; already in use by another instance of Minecraft? net.minecraft.server.v1_8_R3.ExceptionWorldConflict: The save for world located at ./gm_game0 is being accessed from another location, aborting at net.minecraft.server.v1_8_R3.WorldNBTStorage.checkSession(WorldNBTStorage.java:73) ~[patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.World.checkSession(World.java:2976) ~[patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.ChunkRegionLoader.a(ChunkRegionLoader.java:121) ~[patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.ChunkProviderServer.saveChunk(ChunkProviderServer.java:278) [patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.ChunkProviderServer.unloadChunks(ChunkProviderServer.java:384) [patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.WorldServer.doTick(WorldServer.java:234) [patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:830) [patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [patched.jar:git-PaperSpigot-"4c7641d"] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
Idk how to build it, i was trying to do it but it won't let me build it
https://github.com/mine-codes/mineEconomy
I wanted to add just 3 lines to the hikari connection for properties
had the same problem, do this:
File worldFile = world.getWorldFolder();
String worldName = world.getName();
world = null;
if(Bukkit.unloadWorld(Bukkit.getWorld(worldName), true)) {
try {
FileUtils.deleteDirectory(worldFile);
} catch (IOException e) {
e.printStackTrace();
}
}
thanks!
How can I increase a players health? even when they die? they keep it. I want to make an Item where they can boost their own health points..
add the attribute to the item
remove the .2
Yeah I know that way, but im talking about like eating this apple, and the health boost applies and it keeps...
Could not find artifact org.spigotmc
pom:1.15-R0.1-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
Could not find artifact org.spigotmc
pom:1.15-R0.1-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
is there a way to do that with a plugin? or is that more mod territory.
no, you can do that with a plugin
OKay..
i think there is setHealth but is deprecated
now you can use Attribute i believe
that didnt work 😦
you dont have the build tools installed
oh true
what version?
thanks
the add this to pom.xml
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
<scope> provided </scope>
</dependency>
Yeah It's just if i do it this way it will kind of take away some of the purpose of my other armor. Because If i use attributes I can only see it being on armor, holding an item is just going to be anoyying and my friends wont like that.
me or adri
you
error
it is runtime
paste it here
I don't understand
I think I found away. Instead of doing an item i will just use their level.
can someone help me why my groupmanger not show the ranks prefix
that with the code that I sent you?
There is an event fired when something has been eaten I think
yes
when do you execute the code?
Why does my prefix not show?
?
i have createde a groupmanger but the prefix i set is not showing
1st mc version 2nd show us some code
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/FoodLevelChangeEvent.html you can use this one
declaration: package: org.bukkit.event.entity, class: FoodLevelChangeEvent
its plugins
wanna create a thread?
1,8,8
yeah but you said setHealth was depricated right? the only other way i think of being able to give health is through the effect health boost.
No
so i though a better way to make it perm is through levels and it can be auto applied.
Attribute
I cant make a player have an attribute without putting it on something
in chat, the prefix?
yea
Wait, mb you can use #setHealth
ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
String sus = "op" + args[0];
Bukkit.dispatchCommand(console, sus);
In the console it writes that it cannot find the command, why?
Is there a way to display an actionbar for a certain amount of time or is a runnable the only way?
Vector l = shooter.getLocation().toVector().normalize().multiply((shooter.getLocation().getDirection().multiply(shootDistance))).toLocation(shooter.getWorld()).toVector();
``` this always points in same direction no matter player Location/Rotation
any clue why?
Im trying to get Location of blocks x distance from player in player look direction
how do you set the prefix?
you need a space after "op"
with groupmanger
I did a plugin with attribute and sethealth and I remembered I didn't use attribute for that @zenith gate
I need code please
String sus = "op " + args[0];
its a plugin i how can i send code
so setHealth is good to use?
because thats wrong. Use teh one I posted for you
I believe
your's always gave me:
x is not finite
but you want help in development of plugin?? go to #help-server
plugin
what? x?
I used it at least
they will help you with plugins
thanks
this is purely for using spigot api and developing plugins
prob X of Vector
since my code doesn't have any X
neither did mine
Location l = shooter.getLocation().add(shooter.getLocation().getDirection().normalize().multiply(distance));```
Why is getHealth depricated then?? im trying to set the health of the player but i want their current max health so i can add on to it. but getHealth is depricated. SetHealth and GetHealth are together are they not? so why would one be now and not the other.
?paste
Yea
Gethealth is deprecated
You have to use Attribute to gethealth
I confused before
my goodness... so many loopholes....
declaration: package: org.bukkit.attribute, enum: Attribute
That code is a perfect location. Its not a vector for velocity or anything
I tried changing the Location from ur code to Vector, and also without turning it into Vector
but both didn't work
Is there a tag or something like that for transparent blocks? 👀
Yeah you are doing a load of crap with vectors. None of that is any use.
if(res!=null && res.getHitPosition()!=null){
to = res.getHitPosition().toLocation(seated.getWorld(),yaw,pitch);
}else{
Location l = seated.getLocation().add(seated.getLocation().getDirection().normalize().multiply(shootDistance))
to = l;
}
also no clue why even tho im looking at some blocks, it still uses else
The code I gave you will give you an end Location (distance) blocks in the direction the origin Location is facing
That code you just posted is convoluted I can;t even tell what you are trying to achieve
first method is parabolic curve
second is usage of it
dsitance, inertia, velocity drag. Thats not what you asked for
Thank you I got it now.
You simply asked how to get teh Location X blocks distant from an origin
ye, ik
but idk why but it doesn't seem to work for me
I can;t even tell what you are doing with it in that code
The code I gave you gives you the precise Location you asked for
therefore thx and imma go figure it myself
X blocks from teh origin in teh direction it is facing
Your getHitPosition() from teh ray trace result is not a Location. It is a vector on teh blocks face where it hit.
dude wtf
I bet that he keeps reading those messages anyway
^
Blocking people doesn't work I'm always so curious what they say I read it anyways
That's what yoh get for hating on 1.8 your dirty piece of shit
👀
chunks only have 16blocks inside them, that might be part of the issue
can you store different kind of object inside private reflected field
lets say in code the variable is type Foo
and via reflection i try to set it as instance to Bar
no
Bro, it doesnt matter about the chunk, the thing is with the perlin noise, i already said it makes 20x20x20 cube, so the cubk clearly isnt a problem
Is there any way to extend class at runtime?
What do you mean override ?
Can you explain what you are doing
i want to inject my own code to specific NMS class
problem is that the class is package private
its inner class
i cant even instanciate it at compile time
Depends on the purpose, but in this case you could probably just use reflection
Don't fucking laugh you know what you did
i can create new instance of it via Constructor#newInstance() which works well
but i need to add new functionality and override some methods
but because its package private i cant extend it in IDE
And I’m proud of it
Ah I see
What is the class if you don't mind saying it?
Because there could be another way to solve your problem
BeaconMenu.PaymentSlot.class
it would fine if the type of field would be generic
like Slot
but its concrete class type
Idk much about forge, but maybe you could just make a class in that package
that's spigot nms
That's nms 😂
Oh right I was looking at the wrong thing lmao sorry
that class isn't static even
Yea I had an issue with nms similar to this so I just quit trying
like, you'd need the beacon instance
the easier way would be to just modify the tag it uses no ?
I presume that is what you are after
wdym the tag
private field type is Concrete class
not a slot
but it doesnt utilise any new methods inside that inner class
what are you trying to do xD
mayPlace or getMaxStackSize
getMaxStackSize you are pretty fucked without bytecode
im trying to hook into mayPlace() and mayPickup()
Yea, but mayPickup is just return stack.is(ItemTags.BEACON_PAYMENT_ITEMS);
So why not modify ItemTags.BEACON_PAYMENT_ITEMS 🤔
and i need to add new check
Couldn't you call the method and add logic in some sort of clas you use as a buffer
that would require to create me at least 5 classes and inject them into private fields
just for these methods
or mixins 
😳
if I would modify this, every beacon would be broken inside my server
Wished spigot had them
no
Doesn't spigot have the whole don't modify the game stance though
Is there a web tool of some sorts to help make custom items a little less annoying to do?
Maybe I'm wrkng
if you give spigot developers mixins it would be the apocalypse
Whys that
Spigot plugin marketplace is like google play store
Shitty code everywhere instead of isolated instances of shit code
Cause it will conflict with each other
bunch of shit, but bunch of goodies
^
spigot SHOULD really adapt adventure ffs
is it a bad idea to just put them all in one
Lol
You'll awaken the symbol thingy lovers
^
I use iridium chat color api
I don't know if I wanna shade adventire
Isn't it big
I use spigot api
Don’t you have to also use the Bukkit platform
Bukkit platform?
^
There is adventure API and also the Bukkit platform and platforms for other stuff
NMS server with no bukkit api and mixins as an option would be great
I couldn’t do that when I tried
It just would give me package errors and stuff

it would be great for proprietary server code
why... i mean if i dont load the class surely it would be fine?
dont want to say i told you so but i told you so
divide the input for your perlin noise function by five or so
your scale was wrong
so how can I change it?
Make text files in the resources folder of each of the NMS Java classes
Then use ASM or something to load it into a class
if(generator.noise((loc.getBlockX()+x)/div,loc.getBlockY(),(loc.getBlockZ()+y)/div)>0){
loc.clone().add(x,0,y).getBlock().setType(Material.STONE);
}
Lol
that's in basic terms Skript
whereever your function is that grabs the noise, divide that input by some number between five to fifteen
I mean hey at least you don’t need BuildTools
depending on how big you want your scale
Lol
intellij iirc suggests you to use nullable parameters instead of optional
if you want to abide by that, up to you
ughhhhhhhhhhhhhhhhhhhhhhh
Nullability 🤢
im not sure lol
Nullables are faster and no memory footprint
if i change it to five for example this is the result
Hey, I'm making an open source 1.19 plugin that uses a lot of nms, and so I was wondering if I'm allowed to share code using the Mojang Mappings on GitHub
whats the div?
first image ten second image five
as said, the div is dependent on how big you want your features
As long as it’s not the actual server code
You should be fine
and the bigger than number dependent on how much coverage you want
Ok, ty
if you want 50% do >0
at least with this noise function
basically its this:
double percentage;
double biggerThan = -1 + percentage * 2;
double scale;
if(noise.get(x/scale,y/scale,z/scale)>biggerThan){
block.setMaterial(Material.AIR);
}
take note that im using util.noise.PerlinNoiseGenerator
?paste
so where should I put it in this? https://paste.md-5.net/ohojakahir.java
Im trying to get a list with all the warp names using the following code
String[] warp_name = warpSaveFile.get().getStringList("warps").toArray(new String[0]);
But for some reason warp_name is empty.
Does anyone know what I am doing wrong?
double e = perlinNoise.noise(x, y, z);
=>double e = perlinNoise.noise(x/noiseScale, y/noiseScale, z/noiseScale);
You don't. Enums are compile time objects
is there a way to create atleast little bit similiar particles?
No, enums are for when you know ahead of times exactly what your options will be
what should the scale be?
that depends on how you want the caves to scale
if you want them in 1.18 cave size i think around 12 to 15
but then again
thats far too big for a cube with 20 side length
for that scale I'd tell you to use a value between 4 and 7
thats for testing purposes only
and?
what im doing is that im using a test command to generate it in front of me
i enter the scale i want in that command
that way i can test it really quickly
?paste
i'm using this to generate world and thank, it looks amazing, I just need to swap the bigger tan/less than and it will make caves, thanks a lot
Can anyone help me with a Spark Profiler in DM?#
?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!
#help-server too
Im trying to get a list with all the warp names using the following code
String[] warp_name = warpSaveFile.get().getStringList("warps").toArray(new String[0]);
But for some reason warp_name is empty.
Does anyone know what I am doing wrong?
show your yaml structure please
youre setting the length of the array to zero
that's correct
zero provided here is for to represent for invoked method that the returned array should be the size of the list
yaml list is not what you think. list in yaml is:
warps:
- one
- two
or ```
warps: [one, two]
Here is not a list. @balmy fox what you have to do it get all the keys in section "warps"
So I should use warpSaveFile.get().getKeys(false)?
most effective way of getting blocks around one block but only the ones on top and around, none from below?
First get the section "warps", then gather all the keys (yeah the #getKeys)
getConfigurationSection("warps").getKeys(false) I think
Right
Haven't touched this stuff for a while :o
Set<String> keys = warpSaveFile.get().getConfigurationSection("warps").getKeys(false);
for (String key : keys) {
ConfigurationSection section = warpSaveFiles.get().getConfigurationSection(key):
String creatorName = section.get("createdBy");
}
Alright I will try that, thanks everybody
You forgot to go into the warps section
For loop :)
done how?
fixed it
From x-1, y, z-1 to x+1, y+1, z+1
So it's a 3 for loop
@limber owl (forgot to mention you)
Hey there, I wanted to ask... Whats the best way to identify specific items?
lores
or nbt tags
Can you explain more deeply? Like describing each one of the terms you used
appreciate it!
Sure will. Thx!