#help-development
1 messages · Page 59 of 1
people are having full on fits over that but its not that bad tbh
alltho the chat stuff was added in 1.19.1, normal 1.19 is free of it
what exactly?
the moderation update
welp
that new chat stuff is unnecessary af
the idea is good
its easy to bypass
on my server I disabled reporting
nah
even easier
easy 30 dollars for mojang
that's not the issue
they especially said they won't ban you for messages like i will kill you or stuff
Yourself : wanna hang out?
./msg yourself are you breaking mojang's tos ?
[me => me ] are you breaking mojang's tos ?
[me => me ] are you breaking mojang's tos ?
Them : sure !
Just came here. Is it about this china style data gathering from mojang? Fk that.
hi sorry but i am making my first plugin to spigot
is anyone plugin called devtools for developers that generates a plugin?
but i don't get why tf they have to moderate a server THAT I PAY 50€ A MONTH
i can do that myself ffs
it's to protect microsoft investers
https://plugins.jetbrains.com/plugin/8327-minecraft-development
if you use intellij
which you should
How do i stop natural mob spawns for certain types of mobs? (esp them creepers brah)
EntitySpawnEvent or smth like that
that is so useless
and cancel it if your entity is of type x
mcdev plugin for intellij is the best you get. It generates a blank plugin.
otherwise they could get in trouble for "supporting a game that doesnt do anything against hateful behavior" for eg
oh thank you so much
i am new developing plugins
without doing it yourself, which for mods would take few minutes to even set up
which generaly making pocketmine plugins
I guess
more than that
Do you know the basics of java?
um yes
WhAt iS jaVa
java The isLanD?
i think it's a dance
OOP? you mean OP? NO I don't give you op on my server
Brodway's Java?
did you mean oof?
oh my
Here is a simple setup without the usage of maven or gradle:
https://www.spigotmc.org/wiki/creating-a-blank-spigot-plugin-in-intellij-idea/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Oh javascript, yeah its the same thing
honestly, idk if i find that funny or just stupid
just like C++ and C#
both
probably
thank you so much, i know what is object oriented class on java
and i know the basics of it
good man
for some reasons i hate maven and gradle but that's probably because i'm too lazy to learn
thanks mate
don't use gradle, it will make you life so much harder
i wonder... does directly modifying the commandmap have any con's, except the fact that it uses reflection?
no
I used it for a while and I regret the time I lost on it
for now i'm sticking to the good old ways of manually adding jars
so i'll never manually add commands again. aight
correct
also alex, i now am redstone in the forums again
I just always use ACF

yaaay
now waiting for the namechange to apply
what pros does it have over the regular way?
Does that actually have any benefits? Always seemed like a waste to me.
you don't need to manually add 50 commands into your yml
what? using command map?
ffs my plugin is 2mb in size now...
so smoll?
stop shading everything you dont need
i guess, i tend to only implement a single command with subcommands
let spigot download the dependencies on runtime
But I need all the stuff I shade
with a signature system that handles completions, permisisons and aliases for me
so what do you shade, and what versions do you support?
1.17-1.19, I shade my lib, bstats and commons
bstats is like 30kb
why the heck commons
commons is quite big
commons-io
why
so creating a single command ends up looking like this
||```JAVA
this.COMMANDS.add(new FCommand() {
@Override public String getArchitecture() {return "ofaction%%%ofac%%%of faction%%%fac%%%f set%%%s %P% %F%";}
@Override
public boolean execute(CommandSender sender, ArrayList<String> vars) {
Player target = Bukkit.getPlayer(vars.get(0));
if(target == null) return DELogger.pError(sender, Lang.ERROR_GENERIC_NOPLAYER.toString().replace("<%PLAYER>", vars.get(0)));
Faction faction = DragonEarth.i.factionManager.getFaction(vars.get(1));
if(faction == null) return DELogger.pError(sender, Lang.ERROR_GENERIC_NOFACTION.toString().replace("<%FACTION>", vars.get(1)));
return DragonEarth.i.factionManager.setFaction(target, faction, sender);
}
});
Because if I don't I get a class not found error
here's for example what i use to register a whole new command, with it's own RunAction:
PluginCommandManager.registerVanilla("helloworld", (sender, command, label, args) -> System.out.println("Hello World"));
if i'd have to manually add it to the plugin.yml everytime, it'd be a pain for me
hm
And I don't use libraries
google "spigot library loader"
I'm assuming you are talking about libraries in the plugin.yml?
looks more or less the same as the regular way except you dont bother with the .yml
using the yml for commands sucks
i know
e.g. if you wanna make the command name configurable D:
i use subcommands
o_o
that's
a really fricking good idea ngl
well, in theory it is lol
oh and I shade minimessages
i'm still gonna stick with my implementation, it's soooo fricking useful
thats also on maven central
Guys do i have to keep on restarting my server when i want to reload my plugin? I can't replace it with a new jar because "You need permissions to perform this action" I'm guessing because the server is using the jar somewhere?
essentially this is all it does
just get it through plugin.yml "libraries:" feature
cave brain me no comprendo
why would anyone use one of those longass one's instead of like /ac
I put a lib called minimessages in my jar file which makes it large
they might have another plugin that already uses /ac
i handle aliases differently
ofaction%%%ofac%%%of faction%%%fac%%%f set%%%s %P% %F%
looks ugly
i hate my polayers
sounds like a disease
and handles it this way
you go to the doctor, he takes your blood, makes a sad face and says "sorry mfnalex, you have polayers"
what even is that now
me making a typo
^^
oh
but yeah this way i dont bother with anything anymore
just give it a signature and get a sender and args passed in in the execute function
permissions generate using the first alias of each
sometimes makes ugly perms but they're functional
I give the zombie a shield but it doesn't use it, can i make it use it in some way?
using spigotAPI only though you wont get anything since isBlocking is specific to HumanEntity
whihc zombies are not iirc
When I shade commons-io do I need to relocate it?
can't find this, there's isBlocking() though
unique to HumanEntity
Tough luck then okay
Could I?? :O
listen to entityDamageByEntityEvent, if its a zombie and the damager is in front of the zombie (vector.angle(vector)), cancel the damage, play the sound and know back the damager
you can get the way a zombie is facing thorough its location
.getDirection() returns a vector
very hacky
then make a vector from getEyeLocation() to the damager and chack if the angle is less than idk, 90 degrees
theres isnt really any other way though
DAMN, I see that's interesting, I'll try this out
I don't really care about the animation, as long as the concept is there so this is gud!
you'll have to spend a lot of time tweaking stuff as i dont think you can get the exact values directly from the source code
Mhm Yeah, trial and error I guess
(for eg idk how large is the shielding angle normally)
afaik it's either 160 or 180 deg
It would be alr pretty cool if it works practically, being a one to one copy with the mc shield physics would be insanee
but not entirely sure
:o noted
you could actually peek into the source code but idk if that'd be very insightful
Oh O_O, source code of? net.minecraft.client?
Yeah? The one with NMS right
not that hard to do, just long a tideous to look for somethiung specific
that's minecraft itself but i guess it also works
i just did, and i instantly regret it
lot of a(); etc
help im using rose stacker and when someone mines a spawner they get the spawner itself and also pig spawner with silk
you're looking at the obfuscated one
ofc i am
Will check that out,
Is there any other mob in Minecraft that uses shields BTW? i haven't played the latter versions
xD
but i'm too lazy to mess with deobfuscating it
its not that hard though
i'm still too lazy
wait lemme check before saying anything
nope
Okie fair enough
There's a dude that throws axes though aye?
Wait what?
no one "throws" axes lol
Vindicator throws axes right
help
olaf?
Oh WHAT
he doesnt throw them lol
he just has one
as a weapon
he charges at you
I vividly remember him throwing at me and spikes coming out and whatnot
lmfao, imagien they would throw them at you
LOL
what is a vindicator
new warzone player or what
i think you missheard someone say an evoker throws vexes
an evoker doesn't "throw" the vexes tho
Good old MC 1.8.8 didn't have all this unnecessary shit
he also summons evoker fangs but thats smth else
No clue, I have no grasp on evokers either
no weapons
summons mouths from the ground and flying bitches with swords
yea
what do you guys think will be the next major addition to the game?
Ahhh, phasing through walls and pestlike?
and hates blue sheep
y e s
yep anyways, thank you guys so much for the help appreciate it
it's what the server is for x)
think? idk, hope? inventory update
Does anyone know if I need to relocate my commons-io after shading it?
or just optimization update
no idea what that is
Communist party update
Inv update, like what?
help im using rose stacker and when someone mines a spawner they get the spawner itself and also pig spawner with silk
i wonder if my name actually auto-updates in here when it does in the forums hmm
lets see ig
idk but something to help out with inventory managment
Cxlina, do I need to relocate my commons?
that would be sick
i have no idea
i never did it
i just added it with the compile scope and it worked
look at phoenixsc's video, it has a few good ideas
lucky you
I didn't work for me lol
you saw my pom
anyways
After 100 downloads or so I should find out if it works or not
which one?
damn some are really sick
what about some extra slot which takes a backpack and is above your armor?
so you can craft a backpack and always take it with you
help im using rose stacker and when someone mines a spawner they get the spawner itself and also pig spawner with silk
Show some code pls
Read the channel name again
plz tell me
Tell you what?
this
when i mine any spawner with silk touch it give me that spawner and extra pig spawner
no one talk there
Then ask the dev of the plugin
How do i convert bukkit ItemStack to net.minecraft.world.item.ItemStack
CraftItemStack.asNMSCopy()
Use CraftItemStack factory methods
sniped

ty ty
With your derpy ass bronze retriever

bronze retriever? its called golden retriever in the uk
think its a joke lol
What would be the best way to download a private GitHub release through a plugin?
funny dialect stuff
if its private, you cant
I was thinking it was possible using GitHub tokens
My dog is just fat and wants snaggos all day
hmm, i wonder what their api exposes
Genuinely speaking, my doggo isnt too different
My 17 year old, just getting over a dog attack 😦
@Getter
public class ItemDropEntity extends ItemEntity implements CustomEntity {
private final ItemStack itemStack;
public ItemDropEntity(Location loc, ItemStack itemStack) {
super(((CraftWorld) loc.getWorld()).getHandle(), loc.getX(), loc.getY(), loc.getZ(), CraftItemStack.asNMSCopy(itemStack));
this.itemStack = itemStack;
}```
I rule the world now >:)
Nope you're a slave to @getter
i think every single class in my proj has it lmao
delombok that shit
so many methods though 😦
god interpolation kinda tricky
so hopefully, if im correct I can hide the dropped item entity to any player
using my already existing entity hider system
Like if i use every block as a control point, it just looks like the existing path
what about every other block
im now trying that
it looks ok, much better on diagonals but going upwards is a bit wonkey
uhh
A*?
now wtf is that and why does it look like its for a very cool plugin
one problem is i am doing it on a block basis, and it is just using the block coord so i should probably put them all in the middle
Any know how to create a custom entity with custom models ?
yeah its my pathfinding thing
ModelEngine and BlockBench
Use ModelEngine
I tried making my own model system, its a massive pain in the ass
100% worth the $20
I want to create my own system for learning purposes
dont
Try with maze things :>
try to launch a sword with armorstands first
even 7smile7 tried and i dont think he could finish it
That is only thing i need to know for now
and hes legendary
Alreadly did
oh
With item there is its own tribute customdata
is it aligned with your player head and stuff?
Wdym ?
usually the problem comes with the fact that an armorstand's arp is offset to its actual location
importing models, animations and all the rest from blockbench is much harder than it seems
making lining it up a hassle
a lot of quaternion maths aswell
Models isnt a greate deal
I got a few national awarded in competitive programming so nothing to be hard with me
even Origin Realms uses Model Engine
go for it if you want ig
im just saying not to waste ur time
But i still have no clue how it work ..
Armor stand cant be that detail
yes they can
multiple armorstands
with custom models on them,
but its not that simple, theres alot of maths
cant just rotate it and it works
I upgrade my api to 1.16.5 just for the custom model things 😦
how do I get entity type name from an entity? it says entity.getName() is depreciated
AABB hitbox
It have a unique hitbox
works dynamically with any entity
whats the opposite of a consumer
and transfers any damage etc
wdym
Producer
provider?
thats the one
Entity.gettype
smth like that
Im getting this error when loading my plugin: org.bukkit.plugin.UnknownDependencyException: Core
this is my dependency
<dependency>
<groupId>net.grandtheftmc</groupId>
<artifactId>core</artifactId>
<version>X</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/Core.jar</systemPath>
</dependency>
what can I do?=
also handled by modelengine
Your verrsion ?
get type isn't a method for me?
minecraft version?
is there such thing as a supplier with a parameter
EntityType entity = cs.getSpawnedType();
wdym?
like:
var result = supplier.accept(value);
if it's deprecated it means dont use it though
well what do i use then?
a sec
So here is what i got:
Custom entities with models is constructed from a bunch of armorstands which have its head is
custom item with custom texture ?
but i get entity type from a spawner?
and get name returns org.bukkit.etc
@FunctionalInterface
public interface ParameterizedSupplier<T> {
T accept(T value);
}
just whipped this up - should work i guess
what would you use it for though?
also are u saying use it or don't use it?
dont use deprecated things if the replacement is there
well spigot doesn't specify a replacement sooo
you can make pr's to update the wiki iirc
@NonNull
@Override
public Path mutateLocations(ParameterizedSupplier<PathLocation> mutator) {
List<PathLocation> locationList = new LinkedList<>();
for (PathLocation location : this.locations)
locationList.add(mutator.accept(location));
return new PathImpl(locationList.get(0), locationList.get(locationList.size() - 1), locationList);
}
its so that the user could mutate all the locations in a list
hmmm to much effort it's alright
my french brain doesnt know what mutate means
like change, x mutates to y
update / edit?
yeah sure
oh alr
i suppose its the term to mean update a list of things
OH
random question, what's the closest thing to List<T> since you can't instantiate it i always use ArrayList<T>
ArrayList is what i use
i noticed you're using linkedList for eg
yeah, linkedlist is appropriate here i would argue as its like:
pos1 -> pos2 -> pos3 -> pos4
LinkedList is rarely ever better, tho for add and remove it may be more scalable in terms of time complexity
(Well it can be used as a queue/deque also)
Linkedlist is a chain of nodes, where each node holds a value and a reference to the next node
arraylist uses an array that resizes itself whenever you do operations
ok so
if i got that right
arraylist is for list that requires frequent access and linkedlist for things that uses lots of adding/removing in a queue like fashion
arraylist is good because it has less memory footprint iirc, and is faster for iteration and index based operations
But else linked list might be a good alternative
Then you have the CopyOnWriteArrayList for concurrency
so.. TL;DR linked list for queues, ArrayList for rest
Mye
alrighty
And usually its smart to pass an initial capacity (the default size of the backing array)
Yeah, non the less, ArrayList::ensureCapacity and ArrayList::trimToSize messes with the backing array <:
Altho those methods are ArrayList specific, not List ones
Can someone provide a link to explain how i can work with percentages in java? eg if i click a block it has a 60% chance to do something
What's a parameterized supplier?
i love you
Looks like a function
ohhhh
Bootleg UnaryOperator
Kek
i had no clue what it was called so i just made something up real quick :))
<:
Cute doggo

You can draw a number between 0 to 100 or sth inclusive-exclusive and check if n > min+delta
(In java RandomGenerator is what we use)
Theres also the classic weighted random you can implement for stuff like rarity based drops or whatever you might have
Is there a way to profile the memory/CPU usage of your specific plugin?
I think spark can do that
Else you have jfr which might help to find issue sources, then any profiler will probably do
ye that is what i am looking for
Oh is that a plugin?
Yep
Just google weighted random, should drop plenty of succulent guides
Best of luck
ok cool thanks :D
is there a quick way to transfer entity data? for example: my entity has gravity set to false and other attribs, i want to transfer those to another entity of the same type
With NMS or without NMS?
You can save and load the nbt compound of your entity
ah so entire nbt
ooh la la
What would something like int random = random.nextInt(10); if (random < 6) work out to be
wait is there no mappings for NBTCompound
whats the name?
oh CompoundTag
Ye
Looks bout right
👀
this is an issue lol 😆
that is way simpler than weighted randoms lol
Myeah, tho weighted has its benefits
yup i am sure, but i don't need it to be complex
Fair Ig
How can open Sign and player tip a playername and Enter for search (and my action launch) ?
like /nick in hypixel
With those books?
but i appreciate the tips and could be useful in the future
he's ascending
any ideas on how to find out if the boat will collide with a block in the next tick, given we know the boat's velocity? Currently I'm shooting a ray out from the centre of the boat, in the direction of the velocity, with a max distance of the velocity + 0.8. However, this is not fully reliable as the bounding box is wide.
hmm i cant find a way to get a CompoundTag from a remapped nms Entity. NMSUtils and NmsIo doesnt have a method for it either. I can do Entity#getTags but that returns a list of strings
Use one of the save methods
in Entity?
I've noticed that the raytrace function allows for a width, but I'm currently using raytraceblocks which doesn't have that option. (Though raytrace also detects blocks) So perhaps I could increase the width of the ray to be the width of the hitbox?
oh didnt see that thanks
how can I get all folders in the plugin.getDataFolder()
list the files and filter by directory
pretty sure theres a method
File#listFiles(FileFilter)
declaration: module: java.base, package: java.io, class: File
^
File[] folders = plugin.getDataFolder().listFiles((directory, fileName) -> directory.isDirectory());
yeah
wacked
actually no
you need to remove the fileName argument
that makes it a FilenameFilter
you need a FileFilter
yeah
Wouldn't both methods yield the same result?
nah
FilenameFilter provides the parent directory of the file as the first directory argument
so when calling myFile.listFiles(FilenameFilter), the directory parameter would always be myFile
i think
and the fileName parameter is the name of the actual file
I mean if it works
the first method doesnt
you cant check if a file is a directory using only the name
Yeah I know
Hello, I made a code to set block, but when set, the block is invisible and I can only see it if I leave the server and enter again
MyCode
Block blocknext = p.getWorld().getBlockAt(x, y, z);
if(blocknext.getType().equals(Material.AIR)) {
blocknext.setType(Material.BEDROCK);
}
hello, not sure if I should ask here but, I'm looking to start learning about how to make plugins for spigot, any recommendations on where to start? my current goal is to make a villager trading plugin (with money) but, have no current knowledge of where to start.
getType().isAir() 😏
I have followed this guide, since I need remote debugging (not jar hotswap) for my server, but the build part doesn't work, and to change the plugin I have to run the package task, close the server and put the plugin in manually.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Is this intended, or have I done something wrong? I followed this guide religiously, method 1.
With this code, how can I check if its a directory inside a directory without creating another for loop?
for (File file : dataFolder) {
// Add all yml files in the data folder that are directories
if (file.isDirectory()) {
InventoryGUI directory = InventoryUtil.createInventoryGUI(null, 54, file.getName());
addFile(file, directory);
pluginMenu.addItem(new InventoryItem(ItemUtil.createItem(Material.CHEST, ChatColor.RESET + file.getName()),
new OpenInventory(directory), null));
continue;
}```
Use streams
who?
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
will look ugly lol
idk seems sussy
could just separate it into two methods and call on each other
might be easier
Out of ten
private boolean addFiles(Plugin plugin, InventoryGUI pluginMenu, File[] dataFolder) {
if (dataFolder == null) {
return false;
}
for (File file : dataFolder) {
// Add all yml files in the data folder that are directories
if (file.isDirectory()) {
InventoryGUI directory = InventoryUtil.createInventoryGUI(null, 54, file.getName());
addFiles(plugin, directory, file.listFiles());
pluginMenu.addItem(new InventoryItem(ItemUtil.createItem(Material.CHEST, ChatColor.RESET + file.getName()),
new OpenInventory(directory), null));
}
// Add all yml files inside the plugin data folder (excluding directories)
addFile(file, pluginMenu);
}
return true;
}```
Id advice using Path and Files
i'm trying to make a custom potion to regenerate mana, should i try and create a custom potion effect or just listen to the potion consume event and do it manually?
She will be right, it works
weird my recipe doesn't show up even when the user has enough items
How do I get the ConfigurationSection for the root part of a config?
the config itself extends configurationSection
deez-nuts: true
commandGeneric:
errorPlayerNotFound: '<red><bold>Player not found'
ohhhhj
So how do I get the section where deez nuts are?
it shows up in the book once i craft it one time
a sec
File file = new File(plugin.getDataFolder(), "foo.yml");
YamlConfiguration config = YamlConfiguration.loadConfiguration(file);
deez-nuts isnt a section but a field
part of the root section (here config)
you can't since it's not one
you can retrieve the value though
config.getBoolean("deez-nuts")
No that won't work for me
I got this code I need to integrate with
private boolean addSubKeys(FileConfiguration config, File file, ConfigurationSection key, InventoryGUI keyMenu, Plugin pluginEditing) {
if (key.getKeys(false).isEmpty()) {
return false;
}
for (String subKey : key.getKeys(false)) {
if (subKey == null) {
continue;
}
ItemStack item = ItemUtil.createItem(Material.TRIPWIRE_HOOK, ChatColor.RESET + subKey);
String perm2 = Objects.requireNonNullElseGet(perm, () -> "neoconfig.edit." + pluginEditing.getName());
InventoryItem inventoryItem = new InventoryItem(item, new ChangeKey(subKey, config, file, key, keyMenu,
completeFunction, perm2, permMessage, plugin), null);
keyMenu.addItem(inventoryItem);
}
//Set not to unregister the keyMenu as it opens an anvil that tricks functionality to unregister all
keyMenu.setUnregisterOnClose(false);
return true;
}```
well
if you give it the config it'll create an item named deez-nuts and another named commandGeneric
if you want it to be a configurationSection it needs to look like something like this
deez-nuts:
errorPlayerNotFound: '<red><bold>Player not found'
commandGeneric:
errorPlayerNotFound: '<red><bold>Player not found'
then config.getCOnfigurationSection("deez-nuts")
although it cycle through it's keys and generate an item named errorPlayerNotFound
i've essentially explained how it works
in the example you sent, deez-nuts is a YAML field
you will never be able to cast it to a configurationSection
I'm not wanting to cast deez-nuts to configurationsection
???
^^
🤔
I want action and we got the power
gdhfgh
sorry I though we were being silly
I want the root config section
you can't edit the file for eg
well then you already have what you want
but I don't
i'm wondering wth the question is
want me to reiterate?
File file = new File(plugin.getDataFolder(), "whataver the file name is.yml");
YamlConfiguration config = YamlConfiguration.loadConfiguration(file);
DeezNuts = config.getBoolean("deez-nuts");
ig
.
uh my brain is hurting from that code
#YamlConfiguration extends #ConfigurationSection
Yes and I passed it and it didn't work
passing any other configuration section does work
cycles through the keys of a yml conf and generates an item for each key found essentially
hmm
it does as much as joe biden
dont getKeys(false) twice
this building is collapsing, oh but it needs a fresh coat of paint!
File file = new File(plugin.getDataFolder(), "whataver the file name is.yml");
YamlConfiguration config = YamlConfiguration.loadConfiguration(file);
addSubKeys(otherMenuConfig, someFile, config, keyMenu, this);
given this is in the main class otherwise replace this by the instance,
we dont have enough context to help much more than this
oh thats fucked
??
I had it right but pterodactyl didn't upload my file....
I hate pterodactyl
but love it
i was right
I was right as well
It was a simple question that was over complicated by the errors of a stupid panel.
you were starting to make me doubt that i actually understood how it works and made like, 15 plugins work by chance
pardon?
i was starting to doubt myself essentially
despite having done this for a lot of plugins that worked perfectly
Never doubt yourself. If someone questions you, use the power of your tongue or your fist
Noted : next time, punch KyTDK
lol
Do you need NMS to make custom mobs, npcs ?
yes
paper moment when doing /locate lmao
lmao
Hello, i tried to sent velocity by setVelocity or with packets, but it not acts exactly same as usual velosity (when playet hit by player), what may be reason?
tbh that paper ver youre running is old lol
test server so i dont give a shit
I am not online on my server anymore, but Bukkit.getServer().getOnlinePlayers() contains me in it. Why's that?
lol fair
oof same
so im just working on my plugin for my server which i dont have :(
I would suspect you are doing somethgin wrong in yoru code. You will not be in there if you are not online
you sure you are not calling getOfflinePlayers() ?
Do you need https://git-scm.com for buildtools ??
BT will download everything it needs
I'm calling player.getWorld().getPlayers(), since its the same and doesn't get anything static
and it still returns me
even though im offline
is this supposed to be as low as possible?
All I can guess is you are doing it too close to you disconnecting
I see, thank you.
its not removed you yet
Anyone know why when I create a hologram with an armor stand, I see the hologram normally on one account and I see an armor stand on the other account?
Do you use packets?
if you want knockback
you need to calculate the vector yourself
does special source remap reflection fields?
no
awww shit
How can I compare a ProtocolLib WrappedBlockData to a bukkit BlockData
There's the material comparation but I'd like to actually compare the internal data (powered levers, for example, fail the check)
what can cause: java.io.IOException: The system cannot find the path specified?
just thinking of scrapping the whole code
and start fresh
😅
Dammn path error
past me deleted one line
folder 
does anyone if its possible to get the cpu name of the running machine with java code?
hopefully not an external lib
found this but idk if thats a linux thing or not
i did, its very similar but still diffefent
Hello, how to send command to console? ( BungeeCord )
i tried this method before
something wen wrong..
dont remember what
can i just catch packet with vector of velocity that played dealt to player?
Hi, I have a SQL connection set like in the code below, but sometimes, I don't know why, it says that the connection is closed even though I get it everytime before starting the prepared statements :/ Does someone has a clue on how to fix that?
Btw, I'm using HikariCP
https://paste.md-5.net/evopukasih.coffeescript
?paste pls
anyways would anyone know a way to get the entity amount on the server? rather than Bukkit.selectEntities(sender, "@e").size() or smth
everything ok with the X and Z, but i feel like something wrong with Y
isn't it an entity counter?
hmm that should be implemented per world im stupid ig
hmm yep
this is horrible
lets use a text block ig
is says to use 0.36 as vertical but it doesnot act the same as vanilla at all, for example you cant throw the player 1 on block high
that is a Linux thing, that directory is a "fake directory" that holds a bunch of other various OS stuff you can read
yeah that wouldn't work in windows
OSHI is a good library if you can't find a non library way
that is what minecraft uses
System.getenv("PROCESSOR_IDENTIFIER");
System.getenv("PROCESSOR_ARCHITECTURE");
System.getenv("PROCESSOR_ARCHITEW6432");
System.getenv("NUMBER_OF_PROCESSORS");
:o
what's a quick way of checking if a player is within a cylinder? fastest hack I can think of is checking x and z distance and simple y boundaries
Hi, I need to send a gradient colored chat message to a player, using a generator that creates a colored message using the CONSOLE format. If I use player.sendMessage() it works very well. But I need to use the bungee Text Component function, in which case the message will be colored in completely different colors than I would like.
Player.Spigot#sendMessage aceepts textcomponents
like inside a cylinder ?
or near it?
like I have a cylinder-shaped arena and I need to check if people are in it
does that really have any advantage over the alternative I mentioned?
It's less code
huh it doesn't sound like less code
accuracy and it isn't much code to convert a square to a circle
But if I use the Text Component, the message looks like the one on the first line. In the case of using player.sendMessage(), the message is displayed correctly as on the second line.
so in the bounding box which method actually allows me to modify its squareness?
it doesn't, you would need to keep a list of locations for the edges that are not full squares instead. Depending how large your arena is, you won't have that many, everywhere else can be checked using the normal methods.
that... doesn't sound very fast
also, note that only the curve edges will go beyond the bounding box
not sure what you mean by this
in terms of optimization this doesn't sound like it would scale all that well
you want fast to code it? Or fast in doing a check? Because checking a collection of certain types does not take very long
and the scaling would be fine unless you are trying to use some million block boundaries
Just check if x and z are within the bounds of the cylinder...
that makes a square
Was that pointed towards me?
misread that I think
I am not defining a cylinder in the first place, I was sort of trying to avoid that
You simply check if the distance squared to the center of the cylinder is smaller than its radius squared.
With this you can literally check thousands of cylinders in under 0.1ms
side length = √2 × radius this formula tells you the largest square that fits in a given circle
radius=side length/2 this will tell you the largest circle that fits in a square
Someone help me pick better default colors, I'm bad at this
public boolean isInCylinder(double x, double z, double cylX, double cylZ, double radius) {
double dx = x - cylX;
double dz = z - cylZ;
return dx * dx + dy * dy < radius * radius;
}
How to use color gradient in TextComponent?
MiniMessage
if you are not defining a cylinder then why do you even care about cylinders to begin with
I am not defining one in code, I have a cube and inside that cube my arena is actually cylindrical
FF99FF and FFCCFF
which was fine until I realized the corner of the arena clips into the staircase leading to it....
What do those look like
that does seem like a good one
Oh
I don't wanna use hex colors by default
and how to import it? i have never used java, i just need to make a simple plugin
Since some people might use it on older versions
I guess that disregards y, right
If you have never used java you should learn more java before trying to write plugins
:(
Yes. But you can append a simple y check.
Check if they use older versions and if they do simply rm -rf / in the runtime executor.
for arena's Y isn't super important to be part of the calculation as it is generally assumed that y extends to both limits
yeah it does matter in this instance, but I can see why this is usually the case
At this point you should wrap the arguments into objects
public boolean isInCylinder(double x, double y, double z, double cylX, double cylY, double cylZ, double cylHeight, double radius) {
double dx = x - cylX;
double dz = z - cylZ;
return dx * dx + dz * dz < radius * radius && y < cylY + cylHeight;
}
What offset?
oh never mind actually I guess cyl coords are for the center
Yes the bottom center
@RequiredArgsConstructor
public class Cylinder {
private final Vector center;
private final double radius;
private final double height;
public boolean contains(Vector position) {
double dX = position.getX() - center.getX();
double dZ = position.getZ() - center.getZ();
return dX * dX + dZ * dZ < radius * radius && position.getY() < center.getY() + height;
}
public boolean contains(Location position) {
return contains(position.toVector());
}
}
This should be a very efficient check
I am totally not writing a very dumb even faster version of this right now
oh boy is it ever dumb
yea that looks good
👍
Not sure how it will be faster than
2 subtractions
3 multiplications
2 additions
3 conditional checks
Those operations are quite fast and you can do thousands every 0.1ms
consider underlining the command itself
that will look good probs
Try making target white
So §e/test §e<§ftarget§e>
this is how mine ussually look
Yo This is freaking cool!! 😮 woah
Oh no gen stuff
yeaa pain
It's set up to be extremely configurable so that anyone who wants to change the help format can customize it
I'm just trying to make a solid default
i even use your stuff in here redempt 😄
A simple one
Crunch?
yep
Nice
Make a Config
grab String in config replace & with §
I use crunch in all my projects when it comes to calculating level and experience curves
It's already more configurable than that
yea crunch is nice asf
😎
Crunchy chimken
sounds neat
It's nearly ready for use on spigot
If only the operators would be evaluated in an order that made sense 
Just got put on the finishing touches and write all the documentation
crunchy pasta
whats crunch
How aren't they
Did you manage to get a brigadier implementation working?
I mean now they are
Add vector math so i can do [20, 30, 40] * 0.025
Not gonna happen
XD
Part of what makes it fast is that it only supports one data type
just add linear algebra while youre at it
just an entire MATLAB library but for jjava
Ah yeah. Forgot that everything is a double in there.
Even booleans lol
There is actually a JEP in incubation for vectors
iirc
How about you use the Cylinder class ive sent? I promise that there is no faster implementation.
A* always beats Dijkstra in a discrete space with path costs
what's that
if (radius == -1)
radius = (Math.abs(maxX) + Math.abs(minX)) / 2D;
if (center == null)
center = new Vector((maxX - minX) / 2D + minX, minY, (maxZ - minZ) / 2D + minZ);
return location.getWorld().equals(world) &&
minY <= location.getY() &&
maxY >= location.getY() &&
center.distance(location.toVector().setY(center.getY())) <= radius;
But then how can I create a monster?
how to chek if somoone touching ground?
Player#isOnGorund
But this can be faked by the client
hello. I want to add a jar file thats in my project folder as a dependency to my plugin. how can I do that?
are you using maven?
yes
How do you compile your project?
researching the difference between A* and Dijkstra makes my head hurt cuz i dont know what any of this nonsense means
center.distanceSquared(location.toVector().setY(center.getY())) <= Math.pow(radius,2); ah yeah I forgot
<dependency>
<groupId>net.grandtheftmc</groupId>
<artifactId>core</artifactId>
<version>X</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/Core.jar</systemPath>
</dependency>
this is my dependency and this is the error wenn loading my plugin: UnknownDependencyException: Core
it goes fast like sanic
just use radius * radius
what am I, some kind of caveman?
ya
This is for sure slower
it says derecated, but it should work?
Read the javadocs
well is the Core plugin on the server?
How do you compile?
oh wait I thought it would be enough when I have it in my project when building mb
fine, man people don't appreciate frankenstein code these days
thanks for the class btw
oh yea definitely looks like i should use Dijkstra anyways
i have a start point an unkown endpoint
and im trying to find the furthest endpoint
I just google until the math works
Where do I put default values, the onEnable? And then maybe extend to another class?
How can add custom nbt tag to a item ?
i want set "HatId" and a UUID (toString)
?pdc
Does
PlayerChangedWorldEvent event
event.getWorld();
return the world the player went to, or the world the player left
?jd-s
what’s the best way to get access to the main Plugin object from a different file? kinda new sry
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
Syntax: ?selfrole <selfrole>
Server admins must have configured the role as user settable.
NOTE: The role is case sensitive!
list Lists all available selfroles.
?selfrole list
There are currently no selfroles.
Syntax: ?findcog <command_name>
This will only work with loaded cogs.
Example:
- ?findcog ping
Arguments
<command_name>The command to search for.
?cleanup 5
Syntax: ?cleanup
?cleanup
Syntax: ?cleanup
?help cleanup
Syntax: ?cleanup
???
what are u tryna do here
find all commands like ? di
ye I was just trying to find a list or something lol
@chrome beacon any examples on changing the goals…?
How can check if player quit event is due of kicked or just player disconnect ?
declaration: package: org.bukkit.event.player, class: PlayerKickEvent
I know, but I would like to know if the PlayerQuitEvent is caused by a Kick or not because I have an action that I would like to cancel if kick or not
Ah. In this case:
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/player/PlayerKickEvent.html
declaration: package: org.bukkit.event.player, class: PlayerKickEvent
How do I cancel damage that comes from direct player pvp (like fists), but allow damage from arrows (also from players)
thanks
I would rather check if the attacker is instanceof Player
It doesn't help me to find anything related to my request 😕
But doesnt the arrow kinda count
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDamageEvent.html#getCause() more specifically ^
declaration: package: org.bukkit.event.entity, class: EntityDamageEvent
Hint: This event is fired before the quit event
kick event only gets fired if well they are kicked, really the only thing you should need to listen for
and as 7smile said, it happens before the quit event
wut
@EventHandler
public void onDamage(EntityDamageByEntityEvent event) {
if(event.getDamager() instanceof Player) {
event.setCancelled(true);
}
}
Its basically just this
thanks
And the DamageCause wouldnt really help here
look at the loot table api
EntityDeathEvent or loot tables
public void onMobDeath(EntityDeathEvent event){
if(event.getEntity().getType() == EntityType.COW) {
int a = new Random().nextInt(2);
if (event.getEntity().isDead()) {
event.getDrops().add(new ItemStack(Cleather1, a + 1);
} } //Mob drops//
else return;
}
}``` something like wouldnt work?
custom item is Cleather
lol
i need answers tho!
loot table might be better if you are looking for randomness
as the server would do that for you
I would create a Loot class and a LootManager and a LootContainer and a ton of other classes to have better and cleaner control over the drops
its not nms btw
I can see that...
alright
or just use the loot tables
I am once again asking for your assistance in #1007898521942372364
not a single reply to my spigot thread overnight
declaration: package: org.bukkit.loot, enum: LootTables
thanks
there is more, just use the search bar on the upper right
some1 know why the line particles being displayed like this:
https://paste.md-5.net/xelunibobu.java
i want display like that
Then you need 12 lines and not 3
yes and why is looking like that xd
Because you are displaying 3 lines and not 12
in this case, I had collected this code but I didn't find anything referring to the number of lines
You basically need to do what you are doing right now for a total of 4 corners
Hello
I have imported a maven project from github into eclipse but for some reason the syntax check is not working
lol...
wtf
is there a way to disable players pushing eachother without making a team
kek
there is a spigot config for this
???
bro is just 6 sides on the outside, and 6 sides on the inside 🤣
6 + 6 = 12
shut

This doesn't stop damage from a player... any idea why?
public static void onAttack(EntityDamageByEntityEvent event){
Methods obj = new Methods();
if(obj.isWorldType(event.getEntity().getWorld().getName())) {
if (event.getDamager() instanceof Player) {
event.setCancelled(true);
}
}
}
this does not influence this issue of lines
Methods obj = new Methods();
if(obj.isWorldType(event.getEntity().getWorld().getName())) {
tf is this
(nvmind that)
Registered the listener? Added the EventHandler annotation?
EventHandler annotation
...
damn
thanks
How do i loop though my inventory content in a config?
Depends on how it's stored in the config
You stored inventory contents in a yml config file?
^
is it YML, CSV, JSON, something else?
yml
show us the config
https://helpch.at/docs/1.14.2/index.html?org/bukkit/material/Cauldron.html is deprecated, is there another way to get/change a cauldron's fill level?
using just spigot
exemple
``
EnderChest:
- ==: org.bukkit.inventory.ItemStack
v: 2975
type: STONE
amount: 64 - ==: org.bukkit.inventory.ItemStack
v: 2975
type: STONE
amount: 8 - null
- null
- null
- null
- null
- null
- null
- null
- ==: org.bukkit.inventory.ItemStack
v: 2975
type: STONE
amount: 8 - ==: org.bukkit.inventory.ItemStack
v: 2975
type: STONE
amount: 8 - null
- null
- null
- null
- null
- null
- null
- null
``
FileConfiguration config;
config.getStringList("EnderChest");
