#help-development
1 messages · Page 471 of 1
worst codebase I've seen in so long
how far ahead of the player can they see
I will try 😄
:3
its like 5 blocks right
I did because I usually grab their hive after they got back in
its 4
how do you live with red on that for non errors
Depends if you're talking about the blocks
yes
honestly I like it, good for distinguishing global/local variables
:p
ur weird
woah
idk what else to say
:(
Most of the devs from my company code with light theme. It doesn't get any worse than that
for fuck sake
how many versions has luckperms had
just downloading it and realised its high as balls
god im dumb
just made command stuff
and never even regsister the command
That’s nothing compared to like
I'm thinking of OpenSourcing my game engine I made at this server just need to replace all their proprietary utils 
That one premium plugin optic showed
hm?
gotta love this command api
Idk what it was but it had hundreds of updates
is that commodore
i think i remember
idk the name
was it plots
?
That’s not so much a command api as it is a method to make each command
Also has argument type parsing
acf be like
I have a builder for my command API but its cursed looking
why shouldnt they
wait
nms.screamingsandles shows deobsfucated code technically
cant they get dmca
do they contain actual method code
not trademarked 💀
then no its not dmca
Because giant builders are ugly
public boolean isEven(int n)©® 2023
anybody knows how to loop in every items of a player in nms inventory and somehow know the index of that item in loop?
there is the "entity.getInventory().getContents()" function, but im not sure since its a NonNullList and you couldn't jump indexes in lists (java)
is it possible that mc adds ItemStack.EMPTY for null slots?

Yeah mc uses itemstack empty
I hate that ItemStack
did you learn binary?
not that i remember
oh guess you haven't watched the video on it yet lol
01101001 00100000 01100011 01100001 01101110 00100000 01110100 01100001 01101100 01101011 00100000 01101001 01101110 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01101001 01100110 00100000 01101001 00100000 01110111 01100001 01101110 01110100 01100101 01100100 00100000 01110100 01101111
what decimal
Base 10
Can anyone help me create code that makes skeletons have aim bot?
If you want to help please dm me 🥹
hey guys
anyone know how i can refer to String.valueOf(delayCounter) as %timer% in a config
String#replace()
You just do str.replace("%timer%", String.valueOf(delayCounter));
oh yeah
thx
im kindof confused
BaseComponent[] components = TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', main.getConfig().getString("actionbar-timer-message")));
this is my line
should i just add
.replace on the getstring method
yes
Anyone know how i can allow player in survival to put spawner with egg inside ?
? you mean let them change the spawner type?
how should i build with paperweight?
Nah just place spawner with egg inside (with a predifine mobs)
i tried gradlew build but it left it unobfuscated
cuz we can in creative but if we place it in survival the spawner is empty
You have to get the vector of the players location and the vector of the arrows location and subtract them from another. Then normalize and multiply it to set the speed. Then set the velocity of the arrow. You should do that in a runnable
iirc gradlew reobf
My spawner is also empty in creative 🤷♂️
I give the spawner with an egg inside
no idea, check and see which are reobsfucated
just checked, see if reobfJar works
you gotta setup stuff
I don't know how that's done so I don't know why it doesn't work. Are you setting metadata to the spawner ItemStack?
anyone got a permissions handler i can have?
luckperms
??
or just player#hasPermission
luckperms my beloved
how do u create permissions and stuff tho
I'd fix that using the BlockPlaceEvent then
plugin.yml
or just check for a permission
you dont actually have to register it in plugin.yml
@remote swallow do you know how i can let people in survival place spawner with mobs inside
BukkitRunnable task = new BukkitRunnable() {
int delayCounter = finalDelayTicks;
public void run() {
if (delayCounter == 0) {
cancel();
return;
}
delayCounter -= 20;
int seconds = finalDelayTicks / 20;
int hours = seconds / 3600;
int minutes = (seconds % 3600) / 60;
int remainingSeconds = seconds % 60;
BaseComponent[] components = TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', main.getConfig().getString("actionbar-timer-message").replace("%timer%", hours + "h " + minutes + "m " + remainingSeconds + "s")));
p.spigot().sendMessage(ChatMessageType.ACTION_BAR, components);
}
};
task.runTaskTimer(main, 20L, 20L);
}```
why doesnt this work, it should be decreasing the timer but it just stays static such as 0h 0m 10s
most likely you have to set the block data or state manually
even for luckperms to detect etc?
no way to let them place the spawner ?
idk how they do it, but it should auto pickup permissions
without you doing something to it no
You are decreasing delayCounter but you are using finalDelayTicks to get your time
they can place it you just need to set its mob
yeah but that happens once no?
oh
int seconds = delayCounter / 20;
so this should work
yes
likely
okay so I just setup nexus
it did not come with a deployment user by default
can I just add one
Reposilite better
in the maven files how do i get it so that it auto compiles into my plugins folder
what is the best way to think about this. I have a tab completer and a command with 2 entire separate requirements
/enchant <player> <enchantment> <level>
/enchant <enchantment> <level>
is there any way I can tab complete this really nicely I'm kinda stumped I'm not going to lie
maybe if I could validate whether the first item is a player or enchantment, but there are rare cases where both are actually true granted this is an extreme edge case
idk bro but why you remaking a already existing command
@tender shard has a tutorial about that on his website
oh nice
not to me :(
well kinda simple the vanilla enchant command kinda sucks
its sort of under powered for what it could be
eh its alright
you just gotta pick one which takes priority
true
blessings man
god I can't visualize this is args.length 0 tab complete showed when you initially press space from the command or is args.length 1 tab complete shown I'm pretty sure its the former I just can't be positive rn lol
maybe my work program was right I do need a brea
I'll take a breaky nvm guys
is there any event for like someone clicking with an item
PlayerInteractEvent
k thanks
i have this here
p.spigot().sendMessage(ChatMessageType.ACTION_BAR, components);
instead of sending it to only the player
how do i send it to the whole server
Loop over Bukkit.getOnlinePlayers
BaseComponent[] components = TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', main.getConfig().getString("actionbar-timer-message").replace("%timer%", hours + "h " + minutes + "m " + remainingSeconds + "s")));
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
onlinePlayer.spigot().sendMessage(ChatMessageType.ACTION_BAR, components);
}```
i was going to say that but i thought there was a better option
Nope, that’s the way
There can't be a better option. Sure there COULD be an internal function that sends it to all players. But in the end that function would loop anyway.
And even that is still pretty much doing the same thing under the hood
But you don’t have to see it do the magic
That’s half the fun
is this valid
worldx12.getEnvironment() == World.Environment.THE_END
will it work like expected
sure
probably
ok#
try it and see
my maven doesent have a build thingy
guys anyone know the best way to create a gun that had a very fast bullet but still isn't instantaneous? e.g. 125 m/s
or is it just not worth it
Yeah, you just move it every tick
yeah ok but what should i use as a bullet
You can use anything you want
particle or smn
6.25 blocks every tick
yeah but it's just clunky
make small armor stand
is velocity accurate in mc
with button in its hand
because teleporting at that kind of rate
use a mc velocity calculator
will look a bit bad
not really
you can create a trail behind
i've tried working with high velocities
any alternatives to worldx12.getEnvironment() == World.Environment.THE_END
its so fast you wouldnt notice
it just breaks
what's wrong
it doesnt work
an error?
if (worldx12.getEnvironment() == World.Environment.THE_END) {
delayCounter -= 20;
int seconds = delayCounter / 20;
int hours = seconds / 3600;
int minutes = (seconds % 3600) / 60;
int remainingSeconds = seconds % 60;
BaseComponent[] components = TextComponent.fromLegacyText(ChatColor.translateAlternateColorCodes('&', main.getConfig().getString("actionbar-timer-message").replace("%timer%", hours + "h " + minutes + "m " + remainingSeconds + "s")));
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
onlinePlayer.spigot().sendMessage(ChatMessageType.ACTION_BAR, components);
}
} else {
}
worked in the overworld
no error
oh its because
yeah i see it now
here's the main project's pom
so there's two modules, api and impl
impl depends on api
I wonder if market entities would be good bullets
I want to include api inside impl
basically shade api in impl
i just don't know if there's a better way then using shade plugin
i saw some stuff about maven-assembly plugin but I didn't really understand how to use it
i tried this
but it added all of my dependencies to the jar, not just the other module
does anyone have any clue what to do here
i don't want to make a separate api plugin because that would be a pain
and wouldn't make sense anyways
Quick question, I keep forgetting this. But how do i reference my plugin in a class over then my main?
im just as confused as you are
Like when using bukkit schedulers and runTaskTimer it wants me to reference the plugin and im being dumb
Doesn’t it only shade stuff marked as compile?
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
how does Bukkit.getWorld work
you can use singletons but not recommended, better to use dependency injection
much much better
what are its parramiters need
?javadoc
The name of the world
ive tried but it gives me errors
nvm got it
.getName
What gives you errors
Yeah those are the only two
ok thanks
i forgot to mark something as provided
that I was using libraries in plugin.yml to acquire
i did event.getPlayer().getWorld() buti just needed to add .getName() to the end
Why are you doing that
that gives you the world object
^
Why do you need to getWorld when you already have a world
^
could be in the nether or end
So?
no those are all seperate worlds
If you already have the world
no i dont tho
player.getWorld returns a world
That’s what entity.getWorld() gives you
Bukkit.getWorld also returns a world
player.getWorld() is the same as Bukkit.getWorld(player.getWorld().getName())
^
and is far far far more efficient lmao
I mean
oh i see
i was thinking of something else
Developers hate this one trick to achieve 50000000% more performance
10^10^10^10^100% more efficient
Bitshifting
Always divide by powers of 2
For example, Java’s hashmaps grow by powers of 2
Because you can use bitwise & rather than mod to compute the bucket
also why doesent my maven have a build thing
To save CPU time on resizing a map simply use an initial size of 2^31
When doing this i have issues
To be fair that’s a potentially valid strategy in some cases
Like, I have 128 GB of RAM, it might make more sense to optimize for CPU than RAM
Such as?
cap
I’d be more interested to know why you need that man map entires :p
?img
Not verified? Upload screenshots here: https://prnt.sc/
No cap
help
okay so
inside of your class its working fine
in the main it has issues
the problem is that when you construct the class in your plugin you need to pass the plugin in
now that you've added a parameter to the constructor
you have to pass that parameter in
somewhere in your plugin you'll have a line that includes new playerMoveEvent()
change it to
new playerMoveEvent(this)
congrats
wdym???
My PC is at home, I’m in a different state at the moment lol
did you set up artifacts in intellij properly.
pretty sure
did you paste your pom
I dont see what i did wrong.
It doesnt send player.sendMessage("jump");
to player so
idk
Do you ever register the listener?
you gotta register listeners?
Bukkit#shutdown
Yes
oh
You can alternatively crash the JVM for extra fun
Then maybe your logic is wrong
What is the difference between delay and period in runTaskTimer?
@brave sparrow does this stop other plugins from starting up
Your logic is wrong lol
They don’t move up a whole block in one go I’m pretty sure, it’s a progressive movement upwards
Yes 20 is 1 second
Whats wrong with it?
So it’s not going to have a delta y of > .9
Yeah the move event is called frequently
You’d have to be going very fast to move that far at once
^
?pluginyml
right. So how would I check for the player jumping
aww
is there an action?
what's the command
i need it and don't feel like googling
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
appreciate it
Could i check via getting the block below the player when the to.getY() is higher than from.getY()
i listed a plugin as a depend and yet it is still loading before the one its depending on
true.
What if they don’t jump a full block up?
its not meant to trigger.
What if they have a potion effect
oh nvm
its not doing that
im just dumb
i saw load and then enable
the dependency definitely loads first
different issue i guess
i mean
it's almost definitely gonna happen in 1 tick
maybe not 1 frame
but that doesn't matter on the server
so could i say, "to.getY() - from.getY() < 0.5"
yea but what if they jump
because when u jump it isnt instant.
jumping is slow
thats the point
it all depends
The easiest way is to use the StatisticIncrementEvent
that wont trigger when going up a slab because a slab is 0.5
on lag and internet and ticks and all of that
and thats other
But even that has edge cases
right cause i could get times they jumped?
ok i redid my things but i still dont have a build thing in my maven
I'll try that.
aall i get when i use the one in run configurations is a folder
where doesnt it have build
lifecycle
you use package
helps if we can see the pom
did you follow the guide i sent you
1
okay, have you reloaded maven
?paste your pom
you didnt follow the guide
Lol
you need the maven jar plugin
delete line 30
then copy ```xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<outputDirectory>C:\MyTestServer\plugins</outputDirectory>
</configuration>
</plugin>
reload maven
?paste your new pom
3.3.0 is latest so check maven is finished reloading
not sying i would reccomend it but pirated accounts work very well
so does carpet mod
alright I am in such a loss
how would i set a sheeps velocity right after spawning it
bc i try to make it EntityType but then i cant set its velocity
in plugin 1, I have this code. the registration is not null. there is a registration
in plugin 2, which depends on plugin 1, i have this code
it definitely runs after
for some reason in plugin 1 there is a registration, adn it isn't null
but by the time plugin 2 loads it is null
Does getSection take this?
https://rape.express/3NJdjAXc6L.png?key=Ix3avTYmyvEdDt
Gui help
ok ok
im spawing a sheep
and i want to set its velocity right afterwards
but i cant make a sheep because the spawnEntity requieres entityType
and EntityType doesent let me set its velocity
- That's one hell of a domain name. Yikes
- If you mean
getConfigurationSection("reclaims"), yes. It will get bothdefaultandastralas string lists
Sorry its random 😿
Thanks!
choco beat me
@worldly ingot , would you be able to help with this
or frostalf or anyone really
i just see that you guys are here
damn
no one knows
tragic
int cannot be null
primitives can't be null
Integer can be
int cannot
i willl bet you a million dollars
that java primitives can't be null
how so?
that's the parameter
getItem is returning null
getItem(int) means it takes in 1 int
getItem returns an item
not that it is returning an int
ItemStack can be null
I use encrypting.host
Yay null
EntityType is just its type (sheep, cow, pig, etc)
and they have like 40 domains
so i upload totally random
sometimes i get smth sus like that
other times like
ilovedogs
yea but that's not the return
you would have to get the entity that spawnEntity returns and set that velocity
the int is not the thing that's null
its the ItemStack that it's returning
that's null
and it's null because there's nothing in the slot i assume
== null
you can't do .equals null
You can’t call .equals when something is null
null has no .equals method
.equals always for names and stuff
.equals is for anything except primitives and null
.equals is never for null checks
also like instances i think
if it's a primitive use ==
if you're checking for null use ==
yes if you want to see if two instances are the same also use ==
otherwise use .equals
the reason you can't do .equals when checking is for null is because there's no object for it to run the .equals function on
instead you're trying to see if both references point to the memory address 0
so many finals
not sure why everyone is using finals everywhere all of a sudden
@young knoll are you able to help with this???
oh
frostalf is here
yes i know
thank you frostalf
i want to make its accualy mod
its good to always declare something immutable if you don't need mutability
except used incorrectly it presents problems
Basically, you would do something like this:
/*(something goes here)*/.spawnEntity(/*location goes here*/,EntityType.SHEEP).setVelocity(/*velocity goes here*/)
and it's a lot easier to use mutability badly than immutability
doesn't mean you can't use mutability
but it should be used with caution
just because the IDE says something can be final, doesn't mean it really should be
oh i didnt know setvelocity was a function
I know what can be final
it's a function for the entity class
which is returned by the spawnEntity function
i assume everything can be final
and then I carefully consider if it can't and why
anyways
while a good discussion
i'm doing an idiot
this is irrelevant to the issue im having
are you sure?
yes
How do i check a statistic against a command arg?
and you know that it is
alright then, I am not needed then 🙂
like setting a variable to it
but final just means you can't set a variable to something else
Statistic statistic = player.getStatistic((Statistic) args[1]);
i will remove every final from those two functions and test if it makes you happy
no need

just to double check it is not the cause of the issue

wdym by check against?
perhaps registered service providers are not meant to be used in onLoad?
but I can't find any information anywhere about if this is true or not
sorry not like that but
try registering it onLoad and getting it onEnable ?
how do i set a variable to a statistic thats gotten with command args
Like so
oh that might be interesting
onLoad fires before worlds are loaded
args[1] being the argument of a cmd
have you tried waiting till the server is loaded before registering services?
if that is the issue it is slightly annoying
my code will not work how I hoped
but alas
what can you do
expose a singleton 
so you want to get the statistic with the same name as the command argument?
I recommend you better articulate in a single message in what exactly you are having an issue with or what it is you are needing help with
like luckperms does
ughhhhhhhh
is there any way to find like how many degreese the player is facing in a way
yes
fineeeeee
yes
how
I thought it wasnt castable, but i wanted to try.
I need the list to loop around it and check for the permission on the player to let him execute it with the name: tengucore.reclaim.sectionNameFromList
But it isnt castable, so now what can i do?
well
how do i get a statistic with the same name as a command argument from the player. So how could i make it so when a player does this cmd "/statistics (playername) (statistic name) it would show them the said statistic?
"degrees" is a bit arbitrary
I'm just confused with the getStatistic();
A player's location is consisted of:
-
World
-
x
-
y
-
z
-
Yaw
-
Pitch
as i want to use it with a command argument
don't snipe me XD
Pitch is vertical rotation, so
think of pitch in a musical instrument where it goes up/down
coo
Yaw is not the pitch, it's horizontal
thanks
You probably want yaw
yes
Yaw is Y rotation
no roll would be turning the head 45 degrees.
that is not all that hard to do, in your onCommand you would get the args array, and parse it first to make sure the arguments are valid, next you then use the API to get the statistic you want
can't wait to make kind of physically accurate planes
roll is a variable angle
im using the player but i dont see any functions for yaw pitch or roll
im not very far along
getLocation()
part of the location
I know im saying thats an example of it
no
you're wrong
that's yaw
Thats what i'm doing but the issue is I don't know how to do the getStatistics()
So basically, statistic is an enum
roll would be craning my neck 45 degrees
enums have the method valueOf
declaration: package: org.bukkit, enum: Statistic
As in tilting it from being straight up towards being paralel to the ground?
that one is pitch
look i know this i have the maximum amount of expertise possible
i play kerbal space program
😎 😎 😎
lmao
What about kerbal space program 2
think of it like this
nvm found issue
Look to your right, that's yaw
look above, that's pitch
crack your neck, that's roll
It's really picky though, so you'll need to make the string all uppercase and replace spaces with underscores
BRO WDYM BY CRACK YOUR NECK 💀
Also i understand that
like turn your frown upside down crack your neck
by tilting ur head "45 degrees" i mean like how anime girls do it in the kawaii pose type shit idfk how to explain it in degenerate language
Statistic stat = Statistic.valueOf("statistic name from arg(might have to capitalize it");
Bukkit.getOfflinePlayer("playerName from arg").getStatistic(stat);
Not what i was on abt at all but mk
Statistic.valueOf(name.replace(" ", "_").toUpperCase(Locale.ROOT));
bro now my thing is just all math
but if you can't handle an enum I doubt you'll know how to turn multiple args into one string
getStatistic may require additional arguments
it can take additional args
The block related ones require a material, the entity related ones require an EntityType
declaration: package: org.bukkit, interface: OfflinePlayer
Only the handful of generic ones don’t need an extra arg
It's probably simpler than you think
but given you asked about rotation
this might help
It’s all fun and games until Mojang adds a vector with a 4th value
you could represent both a yaw and pitch with a short 
and roll too
nvm im idiot but you can use an int
why int over float/double?
What even is a Quaternion
god
Pretty sure that’s a fake word
So I'm making an addon for coreprotect called moreprotect (no regrets on the name at all, I'll die on that hill 🤣).
Just wondering if anyone has had experience with coreprotect and has any QoL ideas to add to the project todo list. Figured u lovely devs would be the best place to ask 😁
GET THAT THING OUT OF MY SIGHT! -_-
Caused by: java.lang.IllegalArgumentException: Tag name must match pattern [!?#]?[a-z0-9_-]*, was statName
at net.kyori.adventure.text.minimessage.internal.TagInternals.assertValidTagName(TagInternals.java:53) ~[adventure-text-minimessage-4.12.0.jar:?]
at net.kyori.adventure.text.minimessage.tag.resolver.TagResolver.resolver(TagResolver.java:95) ~[adventure-text-minimessage-4.12.0.jar:?]
at net.kyori.adventure.text.minimessage.tag.resolver.Placeholder.component(Placeholder.java:82) ~[adventure-text-minimessage-4.12.0.jar:?]
at net.kyori.adventure.text.minimessage.tag.resolver.Placeholder.unparsed(Placeholder.java:68) ~[adventure-text-minimessage-4.12.0.jar:?]
at me.assailent.worldbuildingserverdev.commands.stats.onCommand(stats.java:29) ~[WorldBuildingServerDev.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
... 23 more
```???
org.bukkit.command.CommandException: Unhandled exception executing command 'stats' in plugin WorldBuildingServerDev v1.0-SNAPSHOT
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.dispatchCommand(CraftServer.java:931) ~[paper-1.19.3.jar:git-Paper-404]
at org.bukkit.craftbukkit.v1_19_R2.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[paper-1.19.3.jar:git-Paper-404]
at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264) ~[paper-1.19.3.jar:?]
at net.minecraft.commands.Commands.performCommand(Commands.java:316) ~[?:?]
at net.minecraft.commands.Commands.performCommand(Commands.java:300) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2288) ~[?:?]
What are you doing with minimessage
Coloured messaging :)
thats it i didnt bother with any clickables and stuff
(TagResolver)Placeholder.unparsed("statName", args[1]),
Yeah wrong thing for messages in adventure
seems to be the line in question
It doesn’t allow caps
Huh
If its just for colored messages use the component methods.
I just prefer mini message
shrugs
If it’s just for colored messages you just need MiniMessage.parse(whatever)
Or something like that
really?
That will give you an adventure component
idk i tried looking at the java docs and its weird
You can turn that into a spigot component or just a string
Check if stat exists?
Statistic.valueOf(args[1]) != null
tried this but didnt work
and i check if it throws an error how?
try catch
You never change empty
Also I’d be faster just to loop every space and check if it’s null
What
for (int index = 0; index < inv.getSize; index++)
try{basicJavaKnowledge.acess} catch (LackOfKnowledgeException exception) {system.out.println(urltoyoutyoutubeVideoOnTryCatchStatements)} 😆
Wait until they hear about finally
have a hashmap that contains a UUID as a key, and an entity as a value, trying to loop over all the entities and set their health to 0, but it's not letting me? just straight up saying .health is an invalid refrence.
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
well i would send my code but im coding in kotlin, heard we dont like kotlin here
Mb
this is literally all
for((uuid, entity) in VoidWalkerDamageListener.voidWalkers) {
entity.health = 0.0
}
thats it
Sounds like a kotlin problem to me.
Almost as if not being able to declare your object classes can sometimes actually suck 🤔
Yeah this kills all entities. Make sure you imported the right entity class!
import org.bukkit.entity.Entity
Entity doesn’t have health does it
Ah wait
That’s only LivingEntity
ok well question
Lmao
the main issue im trying to fix is that i want to kill all of a specific mob right
but the code i used previously wont kill the mob if the chunk its spawned in isnt loaded
kill or remove
both? i guess
Ah bukkit you slipepr fucker.
Brought to you by the same code where the Player class only deals with online players, and the Offline Player class deals with all players...
Also if you just want to remove them, use .remove()
Yes as soon as a mob despawns its object is invalid.
Thats why you should never hold hard references to
live objects like players, chunks, entities etc
so theres no way to fix my issue?
There is for sure a way to fix your issue
which is
We just need to find out what the issue is in the first place.
What is your game plan?
I just want to be able to run a command like /vw kill, and it will kill all voidwalkers, in loaded and unloaded chunks.
(im coding a boss plugin, the boss is called voidwalker)
the unloaded chunks part will be difficult and ill advised as there is no sane way to really do it efficiently or quickly
Killing mobs in unloaded chunks means you need to gradually load all chunks on the server
and kill the mobs in them. That can take hours for big maps.
Wait wait wait hang on when do the void bois need killing?
You could keep the chunk bosses are in force loaded
or you can play with nbt files
How about this:
You create a state represented as an integer.
Every time you spawn a mob you simply tag it
with the current integer.
On kill you remove all active mobs and increment the integer.
If a chunk loads with mobs tagged that is older
than the current tag, you remove it before it loads.
@rain sierra
PS: A simple timestamp (long) for when the mobs spawned works for this.
Then you need to define a "death line" in time for this type of mob.
Because if its a clean up job we could hella cheat here and GOD DAMNIT IMMULSION STOP STEALING MY THUNDER! 😭
Delete the entire world folder and regen the world 👍
But yeah nbt scanning is a fucky wucky art but once mastered is amazing.
Couldn't quite belive I was scanning 900 regions worth of containers in a minute and a half 😅
Smort
i was thinking that, since my main issue is that the hashmaps i use to store damage done to the bosses sometimes interfere with each other, ill just create seperate hashmaps for each individual boss, and represent the various different bosses with their UUID
that is a super clever idea though
you can multi-thread it to probably 8x your speed

Oh ho I am well aware. We are using it now to make a scanning application for helping catch dupers who've found ways round the logs
Problem is the limitation for certain nbt files. For example chunks can get broken if
the stored nbt data in them is too big.
Also why has nokne said the obvious and told this poor man to just go buy mythic mobs and download the api? 😅
No no we aren’t using the PDC to store the region file somewhere
I would assume that this is more limited by the hard drive speed. But maybe 1.5x is possible.
Like they have spent years working on these problems do we don't have to 🤣
We are just loading the entire region file into a PDC for wrapped access to the contents
hard drive 
Ngl 670 million blocks of scanning a second is more than enough for me 🤣
if you have that many regions you're probably rocking a raid0 nvme setup
I wonder if you can use the heightmaps to your advantage
3G/s persistent storage is really nice to have
Thats like DDR 1 but persistent.
But like ong why?
Being able to scan 900 regions in a minute is fine..
No user is gonna complain at that 🤣
but you're most likely just skimming through tile entities instead of actual blocks
I pray
Actually in theory you should be able to load any NBT data into a PDC
Like a schematic
let's store an operating system in pdc
Which means PDC would actually make a good schematic api
A single, good NVME SSD currently reaches DDR2 800mhz speeds
Ngl the big dream project is reverse making the way they store block data in binary longs and palletes to use as a compression archiving method for plugons that have large databases that need purging from time to time
Well. Maybe as long as the cache holds up and the SSD is very empty.
I mean ur average user js used to async world edit being fast... I dont think they will complain at 900 regions a minute 🤣
Damaged pins i would assume
I just recently learned that those lines ar brittle af.
Rolled over a cable with my chair and it just was unusable afterwards.
Or im just fat
HDMI cables are made to break easily
so that you don't break the ports
source: I've broken a cable by unplugging it from my gpu
the connector was stuck inside
Even smarter would be to strengthen the first bit of each end so it doesn’t break in a way that leaves the connector jammed inside
they're smart but not that smart
waiting for the day that ssds get so fast, we don't need ram anymore 
and then you fill up your drive and your pc is fucked
When i run /stats assailent entity mob_kills enderman
No
it returns false
No
You are hiding exceptions. Never do that.
whats wrong with the highlights idgaf abt them
fun
and you should lmao
Also those
I can spam your command with random strings and crash your server
compare strings with String#equals
maybe if you read them
not ==
Use .equals() for Strings and pretty much any other object
for a fucking reason
That's literally how I learned java, I just fucked up enough times and my IDE babysat me
^
lol
ffs
🤡
yeah bro I code in microsoft fucking paint
based
Hey you joke but paint ide is a thing
the advancement in technology that it can now teach you
I wish I had that
this you?
based

| will check the second condition even if the first was right.
Which i dont think is needed here.
you remind me of that dude who spent like 15 hours here trying to code a plugin by being 1000% spoonfed
gotta love bitwise AND
As an engineer irl, who knows nasa blew up 30 engines till they randomly solved the problem with the saturnv engines, and to this day still don't know what caused it... you are in good company! 😎
down to the process of installing ide
Thats... An OR
Installing an ide aint being spoonfed bro
yes I'm an idiot and it's almost 6am
don't spoil the fun
thats called telling someone how to install an ide
but that was part of my hypixel dev interview challenge
Okay but what about
& is and, | is or, ^ is XOR
&|
so you completely ignored the rest of my message
then there was something about <<< being different than <<
It’s for quantum states
Didnt you get a fked up class where you have to find as many bugs in like 5mins?
InventoryOpenEvent
inventoryopenevent
yes
nah
they were doing http requests onPlayerMove
use
StatisticIncrement or whatever and then check for each time a thing happens
fweajfweajfa
they were also doing location checks with a single |
and checking if a bukkit entity was instanceof NMS' Player
was like
Seems obvious enough so far
when i do (array).length() does it return the length starting from 1 or 0?
if(entity instanceof EntityPlayer) and I was the first one to point it out in all of their interviews
like [1, 2, 3] is i and i.length() = 3 or 2???
also length is a variable not a function
or they had the nms player import or something
.
Aight here is the best piece of advice ull ever get.
Fuck around and find out
?tas
plus that kind of question is basic programming knowledge
not even specific to spigot
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.
yep
Maybe we’ll get a #help-java channel
please no
this is already help java technically
"Son, don't hold in a fart just cause ur scared of shitting urself"
plus I bet that the channel would be used as #spoonfeed-java
actually sounds like something I'd do
"What int mean"
lmao
internet
this is why controlled environments exist