#help-development
1 messages · Page 1624 of 1
lets put it this way, the fastest documented java IO I can find which is using a reader is around 20ms, one database type can do .85
I feel like this isn't possible without mods but I'm going to ask anyway. Is there a way to tell when a player manually crashes the game using F3 + C? Obviously there's no like "keylogger" so my idea was to use NMS to get the crash reason and hope the force crash message has a specific message to test for. This is the message you get when you force crash the game so I went to the stacktrace in NMS and tried following along. I have never used NMS before so I'm not really sure how it works nor how to implement it.
but they never fucking explain how can u store stuff faster on databases, databases are literally just ssds and hdds?
okay so databases are faster than IO
i dont understand how databases are faster but whatever. the strange thing is
my server host
A database is all about persistence (i.e storage). A database system is about storage, retrieval and updating of records and the medium exposed to achieve the above. A database system is a combination of both software and the hardware. We can make...
how do I set a block location variable in an InventoryClickEvent?
prob the best thing to link, I dont fully agree with this but its really good
omg i went through like 5 quoras how did you find such a one
Bing your question before asking it:
https://www.bing.com/
also its literally the first result https://cdn.rackdevelopment.tech/img/rRFacenwAo.png
@EventHandler
public void onClick(InventoryClickEvent event) {
Player player = (Player) event.getWhoClicked();
if (event.getView().getTitle().equalsIgnoreCase(ChatColor.AQUA + "GUI test")) {
event.setCancelled(true);
switch (event.getCurrentItem().getType()) {
case IRON_ORE:
player.getTargetBlock((Set<Material>)null,6).setType(Material.IRON_BLOCK);
event.getWhoClicked().getWorld().dropItemNaturally(blockLocation, new ItemStack(Material.IRON_INGOT));
break;
}
}
}``` I need to add my blockLocation variable to the Iron block
so the straneg thing is, my server host gives me 2 free DBs and the DBs dont have a storage cap
I presume thats mysql
i could literally store 10s of thousand of pentabyest in it
I think thats the standard for most plugins
thats cap
it has a storage cap
DBs have a cap just they might not advertise it
they dont tell you
there def is
maybe not on you
but on the host
DBs dont take up much space, like this is my local testing one and you can see the storage sizes on it
like google unlimited drive
is it possible for me to store server files on to the DB? I am running out of my hdd and i have 2 free DB which apparently are "unlimited"
huh? okay
you define what a DB can store and it will do it, normally its in a string or something like that
mysql is more limited but for my case as I use Mongo I have to store it as JSON
well server files are structured too
oh so thats how it is
ip leaked
ip hash leaked
so databases arent some new tech that can store any kind of data faster than hdds
cool
they store keys and values normally as a string
dbs have been around for like 40 years
also imagine if you dehashed that it would be 127.0.0.1 lol
Hashmap but faster? bc u store it on a DB?
Jesus christ
Maps are stored in memory
so its older than me
thx
my eye hurts
why lol
idk
by “unlimited” they most likely mean “unmetered”
as long as your use is within reason they don’t care
someone can maliciously store a ton of data lul
my right eye hurts whenever i look somewhere
good job imajin
911?
tf i need 911 for
lul
its eye strain
theres an amazing thing called passwords
go rest
then get off your pc then
or if local just make it not public
want a discord crash gif to force you off discord?
i'd not
🤣
you should totally send it in general /s
and get banned?
yes
:?
Waiting for him to do it so I can kick
:/
sry bud
"bud"
hey hey be nice
thats the worst thing to call someone
agree pal
who are you?
someone please tell my why everytime one of my classes is mentioned it turns red in intelij
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.
the person that just blocked you
LOL
@quaint mantle can u del this so i can screenshot
its the meme for me
no
;( but its funny
tHE pErsON tHaT jUST blOckED yOU
fucking
why
i relogged
i left this server
and rejoined
and my fuckin name didnt change
you know theres an amazing thing called the edit button
nah hes being salty idk why
its your forum name
the base name
your account is sync'd
oh
so you're verified, its the nane on your spigot forums account
looks like you’re stuck being a supa gamer forever
?changename
Name changes on the forums are granted to those who have donated to the project. Donations are processed manually and generally take up to 24 hours. The donation widget can be found on the home page of SpigotMC at: https://www.spigotmc.org/.
oh well
thats such an amazing feature...
i contributed to spigot community :<
two
three
four
can you not flood this channel?
i have 5 public plugins
its 6 now
im releasing a new one
agreed
Question, Im currently using gradle and i have two projects, core and spigot, spigot depends on core and i want classes from a dependency in core to be accessible in the spigot project
im a sad boi
but it isnt showing up
tommyinnit cringe
stop flooding this channel
just trying to catch the trend
🦐
well I failed
obviously
i dont need you to remind me of it
:/
what?
that u?
ive just had it for 5 years on discord and cba to make a decent one
cba?
?cba
Imajin#0001 definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.
SG#9444 definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.
are you 75
Lol
poopy among us fortnite dance!
cba can't be arsed ?
who
ding ding ding
hello all
You know its bad when Rack says he wants to leave
when did I say that?
yeah idek who he is tbh
who rack?
hes one of the best helpers out here..
oh ok
Is there a way to use brigaider crossplatform like spigot and fabric at one time
I wanna make an adapter for it but no idea how
crossplatform stuff ew
lol
🤡 ignorance moment
well this is spigot discord
if you want serious help
go to the discord of the crossplatform program
that ur using
well this discord offers help for all with development
so maybe instead of printing loike
10000 messages...
maybe just leave, or ignore it so someone else can help?
well i doubt many people here know a lot about the crossplatform program he is mentioning
ok but theres thousands of people here
so doubting that many people here know that.. is ignorant
You should be able to, you would prob have to implement it into fabric yourself tho
It is open source https://github.com/Mojang/brigadier (you will prob need to make a fork that works for fabric)
@bright jasper sorry for ping just your message is a bit high up
Im trying atm to make an annotation based command compiler and just feed the CompiledCommand into brigadier since its a little different for spigot/fabric
fabric uses base brigadier and spigot has commodore, there arent many examples on how to use it on its own which is the problem
Plus due to platform agnostic nature I have my own PlatformPlayer class which makes it a little more complicated
🙏 so yeah thats that
Spigot should be using brigadier but it might not be accessible through the api
Might need to use NMS
can anyone help me make a plugin 🙂
What do you need?
Is this a problem with coding a plugin or a plugin request?
a plugin request
please someone help me make a plugin
Anyone have a good code example of hypixels color scrolling scoreboard displayname?
hey guys
i have a list
formatted like this
{NUMBER}. {PREFIX} {USERNAME} - {TIME}
how do i sort it
by the {TIME} thing
e.g.
what is the list
- OWNER Quared - 60s
like whats the schema
like that
is it a List<String>?
mhm
actually
the list is formatted like this
{PREFIX} {USERNAME} - {TIME}
mb
any ideas?
goswimmy
you want to sort it by a section of the whole string?
yea
is the value actually inside the {}?
nope
or its just on the end?
example
OWNER GoSwimmy - 60s
yep
yea
Making my own crossplatform command framework ig
@Command(
aliases = {"test"},
permission = "discordlink.test"
)
public class CommandTest {
@Default
public void test(PlatformPlayer player, String name) {
}
@Command(aliases = {"sub"})
public void sub(PlatformPlayer player) {
}
}
what yall think so far
🤡
supposed to support brigadier in fabric and support normal minecraft whatever in spigot
its supposed to be platform agnostic so it will work in fabric and spigot
good job!
my plugin is supposed to work on multiple platforms so yeah
yee
Anyone have a good code example of hypixel's color scrolling scoreboard displayname?
can anyone help me make a plugin?
meaning?
in mc I wanna make a plugin to play
what kind?
can I show in dm
you can show here
Do you know how to make a plugin?
no
I would recommend getting this made by a service team
I don't have one
because there is no way a starter will make this plugin in a timely manner
means can you make me this plugin?
Yes, but I don't have the time to make it
not rn tomorrow or after 1 week
No, I'm starting college and I also don't work for free
ok
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
[00:38:07 ERROR]: Error occurred while enabling AbsenceBasics v1.0 (Is it up to date?)
java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203) ~[?:1.8.0_292]
at dev.bunk.absence.AbsenceBasics.onEnable(AbsenceBasics.java:56) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:407) [patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:359) [patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:318) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:408) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:372) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:327) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:267) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched.jar:git-PaperSpigot-"4c7641d"]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292]
help
?paste next time please use this
but code?
no
[00:38:07 ERROR]: Error occurred while enabling AbsenceBasics v1.0 (Is it up to date?)
java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203) ~[?:1.8.0_292]
at dev.bunk.absence.AbsenceBasics.onEnable(AbsenceBasics.java:56) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:407) [patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:359) [patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:318) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:408) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:372) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:327) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:267) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched.jar:git-PaperSpigot-"4c7641d"]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292]
mmk
I can't help without code 🤔
o
You need to learn how to read a stacktrace
start at the top and start readng
wat
i did
then you didn't read right
at java.util.Objects.requireNonNull(Objects.java:203) ~[?:1.8.0_292]
at dev.bunk.absence.AbsenceBasics.onEnable(AbsenceBasics.java:56) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[patched.jar:git-PaperSpigot-"4c7641d"]
wtyf this eman
yes, what do you think that means?
With?>
you ever played hypixel?
no
no
I've never played any hosted servers, other than mine
What do you need help with?
im trying to make this scoreboard https://i.goswimmy.com/47tpGS.png
not like the scoreboard
just the scrolling displayname
like how it scrolls color not text
thats just a scheduled task updating it
yes but how
hypickle bw is kinda good
its like
you run a repeatign task
I am i mean how do I get the scrolling color over the text?
with a delay of however fast you want teh text to update
ah
well, I can;t really se in a screenshot hwo that color scrolls, but
bc like I thought of a scroller but i dont think thatll work
you have a 1.7 client?
yes
I'm just firing up a test server that does colour cycling using a scoreboard
Yep, not difficult
damn im just dumb
ok, join palmergames.com:1
im on 1.17.1...
thats fine
ignore teh flames, on teh server, but look at the mobs
.1 is fine
yeah but I dont think that will work because its a scoreboard objective displayname not a team
you do exactly the same, but you step your colour change in yoru text, is the only difference
works exactly the same, its just text
yes, but one step at a time
first get yoru text updating colour
once you have that working you then make it cycle
hmmm
so what i'd do, is i'd split the text at every character
add it to a list/arraylist
yes
and then join it by colour codes
then you do a colour change depending on where in teh text the character is
i dont actually know HOW to, but this is how i can picture it being a better system than setting each and every frame of text
yeah
and maybe make a String return of getScoreboardTitle()
that just returns the list, joined and formatted correctly
and update it every 2/3 ticks
You don;t even need to do an array, you could simply insert a colour change into the string based upon length and timer
yeah, also true
so change to gold, then change to yellow, then back to white
can I have a code example because this is hard to comprehend for me
cbb to make a code example, but hopefully this is easier to comprehend
because i too get confused
so basically, make a repeating task
run the repeating task to update the scoreboard name
wait let me tell you what I have first
ok
so I have a repeatingTask
just send the code
that updates the objective displayname
that's all I got so far
jut send the code
one sec I'll see what I can do
okay LOL
im curious too now on how to make like
scrolling text
I know how to do scrolling text
just not scrolling colors
with static text
i imagine it'd be the same system just altered
how do you do scrolling text?
scrolling text just take teh character from teh end and add to the beginning, or reverse
yeah im thinking of uh
wave?
wave colours
idk
lmao
Ahoy!
I've made a resource that will take a String, and split it up so the next() method can be called continually, which scrolls the message along a...
you should make a fast scoreboard system
List<String> lines = new ArrayList<>();
int i = 15;
for(String line : lines);
etc.
but then I can't update?
my update uses teams
bc of stupid ass flicker
ohhh
i see
my scoreboard is super simple, it just displays like links
so idrc about flicker LOL
but yes that's probably not a good idea
yeah mine updates the displayname, rank and coins
and minigame stats when I get to that 😢
whats this
ChatColor.BLUE.toString() ?
that's gonna return "BLUE" im pretty sure
to differentiate teams
because Enum.toString()
prob
returns the ENUMNAME
this is always how I've done it so idk tbhj
alr
as long as it works i guess
I prob could change it to "sometext"
yeah
it works great
@eternal oxide any word on the colour
scroller
sec
tyt
it's so much fun making a custom server apart from the big boys (luckperms, fawe, wg)
what do i do with that
i hate luckperms
WHY?
I adore it
just make your own perm system @quaint mantle
I use to do that but there is no point
just add what perms you want into a list, and make permission attachments
if it's there and it's better than why not use it>?
^ plugins that big
not small plugins like Sitting and shit
show all of your code
you create a comparator that compares the time section of your string
TreeSet<String> pklb = new TreeSet<>(parkourLeaderboard);
pklb.comparator();```
idk
what to do with comparator
returning -1,0,1 depending on the sort
uhm
google java comparators
im trying to sort a list
from lowest double to highest
like this format
{PREFIX} {USERNAME} - {DOUBLE}
the prefix is sometimes null
mysql ORDER BY function is looking king rn lmao
i am playing among us, and i am the intruder
i know i mentioned this earlier, but why tf is intellij doing such weird things? they're all created like seconds ago, never used, and some of them are saying never used as warning, some are not... the fuck?
thats why i use Eclipse
Can i somehow "simulate" the result of 2 itemstacks being merged by the anvil ?
any idea how to build maven repo for 1.16.5, i get errors while building purpur. Ik its a spigot discord but anyone have an idea why im getting Could not obtain git hash while building the via gradlew batch script?
eclipse looks like we would still live in 2012
but preference..
i prefer it lol
i would prefer eclipse if its marketplace weren't so dead
gosh most of the extensions there are dead links or doesnt work anymore
fax
@quaint mantle try this (untested) https://paste.md-5.net/sijapuhace.pl
yeah ofc, its cool.. and tbh, it's much easier for people for example, who are starting with java/spigot etc, but i personally prefer intellij, because it has the better code-correct, it looks cleaner
text is teh source string, result is the string you put into your scoreboard
okay let me try it out!
imo, intellij looks way cleaner, and i like clean
actually I see a bug already
idk (free anti-dupe code for the recent dupe mod :D)
cant really get used to it
Intellij pros:
Great autocomplete,
syntax highlighting
yea
faster, easier to navigate
wdym with easier to navigate
intellij is pretty easy to navigate imo
IntelliJ
imagine how long my ide takes sometimes with my 3000+ classes :)
@eternal oxide it kind of worked and then threw this error https://paste.md-5.net/iyidamijex.pl
guys any ideas why i can't build 1.16.5 purpur?
i cloned the 1.16.5 repo
from github
and executed the command
what is bad with it? i like it
did you update it? I changed teh code slightly
yeah
also, it is pretty default still, bc i setup my ubuntu like 5 hours ago lol
pretty much still setting everying up
ah ok, sec
cant build isn't really telling me smt
where
scroll
no idea tbh
Nope, that code shoudl work fine
idk if the issue is on your side, or on their
Show what you are using
I'm getting this @eternal oxide java.lang.StringIndexOutOfBoundsException: offset 9, length 8
show code
does anyone have pom.xml with 1.16.5 purpur repo? i need proper artifactid and groupid
paper 1.16.5 should work with it
Line 65, take the +6 off
you're going out of bounds with string operation
so just if (index[0]++ > length) index[0] = 0;
subtract one
i know
line 65 take teh +6 off
close
very
change the second and third colors
wdym
what
^
yours is light in teh middle, dark on either end
you are using other formating than colors?
wdym
Its not a complex question
I'm using hex colors and normal colors
it looks like you are also using bold or something
yes I am
take it out and get it working first
so everything works except the middle 4 chars dont turn color until all 4 chars are shown
ok
why aint this connecting
Properties connectionProps = new Properties();
connectionProps.put("user", username);
connectionProps.put("password", password);
connectionProps.put("testOnBorrow", true);
connectionProps.put("validationQuery", "SELECT 1");
connectionProps.put("validationInterval", 60000);
Class.forName("com.mysql.cj.jdbc.Driver");
setConnection(DriverManager.getConnection("jdbc:mysql://" + host + ":"
+ port + "/" + database, connectionProps));```
?paste
use Hikari
whats that
can anyone help me make a plugin
@eternal oxide It works!
now I just need to add bold
@eternal oxide https://i.goswimmy.com/KPVyM2.gif
loses bold
add a bold to the beginning of the result string
so result = bold + builder.toString();
nice
connectionProps.put("testOnBorrow", true);
connectionProps.put("validationQuery", "SELECT 1");
connectionProps.put("validationInterval", 60000);```
whats that equivalent to in hikari
well
how do i keep on refreshing the connection
so it doesnt say like
"the last connection was successfully made 3932459ms ago"
@quaint mantle
just look at the code I sent. It works
what code
what is max-pool-size
what is min-idle
what is max-lifetime
what is connection-timeout
config settings
yes
if it's not set in the config it uses the value to the right of it
mconfig.getInt("storage.max-pool-size", 8) if storage.max-pool-size isnt set in the config it uses 8
did you add it to your pom.xml
it there a way to get the ender pearl item that is used when thrown
ProjectileLaunchEvent doesn't seem to have the actual item used
If not, if I put a something into ender pearl item's PDC, will it carry forward to the entity's PDC when thrown?
no
sad
it becomes an entity when thrown
you need to put the pdc again to the entity ender pearl
diff pdc
Just check the PlayerInteractEvent? If it's a right click with an ender pearl, and it's not cancelled, then it's likely you're throwing an enderpearl.
but if I can do so, then I won't have to do so
can you just get the shooter from the projectilelaunch?
cant even
wdym?
if I could assign data to entity's pdc, then I would already have achieved this
why overcomplicate it when a InteractEvent would work?
lemme try
yee
I prefer ProjectileLaunchEvent as I could instantly despawn the pearl entity being thrown if the item in hand has certain data, but retain its cooldown
lemme think of a work around
public class IronDoor {
public static void ironDoor(Block block){
Location blockLoc = block.getLocation();
BlockState blockState = block.getState();
Openable openable = (Openable) blockState.getData();
int x = blockLoc.getBlockX();
int y = blockLoc.getBlockY();
int z = blockLoc.getBlockZ();
if(((x == 1062 && z == 1327) && (y == 23 || y == 24)) || ((x == 1057 && z == 1284) && (y == 23 || y == 24))){
System.out.println("test");
if(openable.isOpen()){
System.out.println("open!" + openable.isOpen());
openable.setOpen(true);
}else {
System.out.println("close!" + openable.isOpen());
openable.setOpen(false);
}
blockState.update();
}
}
}```
how to open Irondoor?
add block.setData(openable.getData()); after setting open and closed
How can I find memory leaks
How would I push my project to an already-existing github repository, that my project is not currently connected to?
Putting your existing work on GitHub can let you share and collaborate in lots of great ways.
git clone it
then you can use all the other command
Hey so like
my linked list is in the reverse order to what i want it to be
is there a good way to just inverse it?
nvm there is a method under Collections
Anyone have issues making skulker entities invisible in 1.16.5? method from 1.15.2 no longer working
WorldServer world = ((CraftWorld) bl.getWorld()).getHandle();
EntityShulker entity = new EntityShulker(EntityTypes.SHULKER, world);
entity.setPositionRotation(bl.getLocation().getX() + 0.5D, bl.getLocation().getY(), bl.getLocation().getZ() + 0.5D);
entity.setHeadRotation(0);
entity.setInvisible(true);
entity.setInvulnerable(true);
entity.setNoAI(true);
entity.setSilent(true);
entity.setFlag(6, true); //Glow
entity.setFlag(5, true); //Invisibility
PacketPlayOutSpawnEntityLiving spawnEntityLiving = new PacketPlayOutSpawnEntityLiving(entity);
((CraftPlayer)p).getHandle().playerConnection.sendPacket(spawnEntityLiving);
PacketPlayOutEntityMetadata entityMetadata = new PacketPlayOutEntityMetadata(entity.getId(),entity.getDataWatcher(),false);
((CraftPlayer)p).getHandle().playerConnection.sendPacket(entityMetadata);```
it just spawns a black shulker, no glow or invisibility
Why are you using NMS for this
Manually spawning entities 
Still curious if there is any way i can virtually merge 2 itemstacks as if it would be done through an anvil so i can get a result of that merge
fOck
I can PROBABLY use NMS cuz the plugin that i depend on IS using NMS
EcoEnchants?
But i've never done that and i feel like if i try it would make me want to jump out of a window
yeah
in itemstack or not?
im not sure
i don't actually looked for it
but in my theory there should be a method returning the resulting NMS itemstack if two items are incompatible it would return null
pls
can someone fix my
problem
with gradlew and purpur
it don't know why but while building 1.16.5 version of pupur
i get that git hash not found or smth like that
Did purpur even build with gradle in 1.16.5
according to build instructions it does
I mean, did you applyPatches 😅
Yikes
How can I make a plugin, that is multiversion. But for the 1.13-1.17
use interface
If you don't use NMS you should be able to simply code against 1.13 spigot API
and implement methods
or use reflections if you're sure that the methods are working more or less the same
but its not guarantee that it would work on future versions while interface approach would stop you using that plugin while developer updates to newer version
But the JRE/JDK version is in the 1.17 different
yes
i think then compile it in java 16
it should work with older versions of servers
iirc
i get the same error while applyingPatches..
:/
i though this was gonna fix it
does purpurclip jar do have install argument?
Concerning it is based on paperclip I'd hope so
how?
create an interface with defined methods which are incompatible with versions. implement them in a classes for each version of minecraft. Inside onEnable() method check the bukkit version (OBS) and load the according class with classloader. If not found throw ClassNotFound Exception. Instanciate the class, and voila you have version compatible interface thats handled by each version separately without you needing to create separate jar versions
google it
there's plenty of examples
there's even a youtube video
which is quite good
idk the link tho
private void registerDynamicCommand(String name, Command command) {
String bukkitVersion = getServer().getClass().getPackage().getName();
try {
Class<?> clazzCraftServer = Class.forName("org.bukkit.craftbukkit." + bukkitVersion.substring(bukkitVersion.lastIndexOf('.') + 1) + ".CraftServer");
Object craftServer = clazzCraftServer.cast(getServer());
Object commandMap = craftServer.getClass().getDeclaredMethod("getCommandMap").invoke(craftServer);
Map<String, Command> knownCommands = (Map<String, Command>) commandMap.getClass().getDeclaredMethod("getKnownCommands").invoke(commandMap);
knownCommands.put(name, command);
} catch (ClassNotFoundException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
e.printStackTrace();
}
}
finally got this to work
just be careful
there's bunch of issues with deregistration
of commands
tab completion gets broken
and you need to resend the packet
if you deregister command
Yeah i know, i needed to do it because im doing some crossplatform stuff so my plugin works on multiple platforms and kinda needed to make my own command framework in the process
I actually could not figure out how to get brigadier to work on spigot
bukkit commands are basically wrapped in brigadier
which sucks
it depends on the version
in purpur you can register brigadier commands
by accessing datapack command dispatcher
there's two types of command dispatchers
@Command(
aliases = {"test"},
permission = "discordlink.test"
)
public class CommandTest {
@Default
public void test(CommandSender sender) {
sender.sendMessage("lmao");
}
@Command(aliases = {"subcommand"})
public void sub(CommandSender sender) {
sender.sendMessage("subcommand lmao");
}
}
this is how im doing it, regular spigot will basically just register a normal command and it will look shittier i guess idk. Fabric will convert the annotations/nesting type stuff into brigadier
as far as i saw
Theres also stuff for string arguments like @Choice() which accepts a choice array
but i didnt finish that yet
@bright jasper Any tips for learning annotations
they're pretty cool but can't seem to have courage
to do so
An annotation is basically just a immutable value container
Annotations are easy peasy, nothing to be afraid about
Its not that difficult tbh,
@Retention(RetentionPolicy.RUNTIME)
public @interface Command {
String[] aliases();
String permission() default "";
}
this is all it is
to get an annotation off something just run thatThing.getClass().getAnnotation(Annotation.class)
Well Retention is what tells it to keep that annotation in Runtime
so you can access it using this
its not required
but you should have it there
You could, ive never tried
Its also seversely limited though
Most of what you use an annotation for is marking something with extra information you want to access at runtime
How can I make a Multiversion Plugin with JDK 16, for the versions 1.17/1.16/1.15/1.14/1.13. When I start 1.13 with JDK 16 is there a error.
Code against 1.13 and compile with Java 8
But then 1.17 dont work
Spigot API is not Java 16, minecraft is
Minecraft will run at least version 16, which will run your plugin which would be lower
https://media.discordapp.net/attachments/338267383904993291/873398219567149088/QQ20210807104803.jpg?width=966&height=821
Im trying to let a custom model rotate on an armor stand's head. but i found that the rotate pivot is right below the center of my model. And I cant get the distant between the two point
I dont know if this distance is defined in minecraft
Made this
Its not finished yet and i hope to just do the yes/no true/false thing with booleans later but yeah
Made it in a day I guess
Its for my platform agnostic plugin so I kinda had to reimplement stuff
The only pitfall i can see is that atm commands can have only ONE level of nesting when it comes to subcommands
as in actual subcommands under the main annotated class
what about nested nested commands
Yeah just mentioned that, it does not have that yet
Ideally id want to make it possible by making a nested class
but my plugin does not need it atm so i think its fine
I might also be able to make a CommandGroup system where you can group many commands under one CommandGroup and it will kinda be like categories which have infinite nesting
I use this approach, so this way i can do infinite nesting
Ah i see
Oh yeah the other kinda main thing is that doing argument parsing wont really do well with choices after choices
Like if you want a different context to pop up after the first Choice you cant
It will be the same tree sorta
yo
I guess I could put many arguments together and do @Predicate("yes") for the last choice but meh
id rather keep it simple
is there a plugin/way to make it so that I can enchant playerheads and they work like helmets?
Not like my plugin is super command intuitive lmao
like provide protection
what about TabCompleter?
did you not see tab completer working just now?
its in the video
the subcommands + choices are processed and returned from tab
the issue im describing is ideally when you have a choice with like "green" and red lets say you want to give a different context for green and red depending on argument
this is why something like brigadier is useful but the way im doing it its not really possible
But for my use it works i guess so
in practice servers like lunar, mineman etc. for their arena creation, do they create an entirely new world for each duel and teleport the players there? or do they copy and paste the same arena in the same world and teleport the players to a different arena each time.
It depends
Normally
They have a world schematic that they paste onto a new world
But it depends from server to server
Either new world or they have one world/location and use packets to pretend like there are only two players on the arena to those specific two players.
In cases like hypixel its just one spigot node on bungee with slime for world schems but thats... something else so
Do they really do that with packets
Hypixel doesnt for that scenario but some do
Seems unlikely and prone to breaking
Yeah for sure but its a possibility
In hypixel they have one spigot node and use a custom template world loaded which is all in memory called slime
So their network just finds an available spigot server with not many duels going on at once and puts players in there
By spigot you mean their own custom server
It is a fork of very very old spigot yes
I mean a spigot node, they are bungeecord and spigot but its MANY bungeecords and spigots at the same time
So all bungee proxies connect to all spigot servers
so for my plugin should i do new world
and some servers are dedicated to duels
Sure
Ye
wish this was updated lmao
Thats how they do things like housing
do i have to use that plugin or can i just do like
World newworld = Bukkit.createWorld()
Nah make your own world, just make sure to track that world and delete it after
alright
Considering what you are doing you should override the world generator and make it just paste a schematic when the world is created
That just places it at 0,0
This is the code for the Spigot responder @gleaming grove https://paste.lucko.me/0Zm0NK1pPv
Probably could be cleaner tho but yeh
ok i go to see that, do you want my code? maybe there is something helpful for you
Nahnah no need, just wanted to show how i did it for feedback
I probably could improve the system imo lmao
ok
wait how do i do this
i just wanna make a void world and paste my build
but when i creatworld it makes terrain and all
I actually do not know how to do it but i know there is a ChunkGenerator class somewhere
You are gonna have to do some digging
@bright jasper for now i can only recommand you those things - better make own name, to make import packet less confusing (line 14/15)
- Make implementation for consoleSender, for sure you will need that in future (line 15)
the sender implementation i convert at the top has console within it
and yeah i do need to do that for 14/15
thats why i check if its a player and if not it just passes null which automatically registers as console
can anyone make me a plugin
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
I don't have money
@bright jasper and one more thing, if you want to make your plugin more flexible those methods should return Boolen. To see if operation was successful or not
Yep i need to do that too
i was mainly confused because even if you return false from a command it doesnt show a difference so thats why i didnt do it
yea but in case command is triggered by other plugin like this Boolen result = Bukkit.getServer().dispatchCommand(player, command)
i forgot that was a thing
ooh i found out how its actually really simple in 1.8 spigot
WorldCreator wc = new WorldCreator("Voidworld");
wc.type(WorldType.FLAT);
wc.generatorSettings("2;0;1;"); //This is what makes the world empty (void)
World newworld = wc.createWorld();
hey so i want to define a var in OnEnable and they have my objects access it?
define a list OnEnable and have a listener add to it, and other objects to read it
kinda
I am making a plugin and I added the spigot api file to my project with eclipse. I used the add external jar option but it does not get added. Can anyone pls help.
thats in the same class
class Test : JavaPlugin(){
override fun onEnable() {
val example: MutableList<String> = ArrayList()
...
object IS : CommandExecutor {
override fun onCommand(sender: CommandSender, cmd: Command, lbl: String, args: Array<out String>): Boolean {
example.add("example")
@gleaming grove hopefully this makes my intention more clear
what is that language?
kotlin but its basically the same as java
i can understand java but i have hard time communicating in it
in python you would do something like globals()['example = []']
and then List<String> list = Main.getPlugin(Main.class).example;
use this code in listener
Main.getPLugin?
why the getPlugin?
OOOH GET PLUGIN IS A METHOD FUNCTION MY BRAIN MELTED
sorry idk why i looked at that like "what?"
It’s not a real singleton tho
so another way to do this this
val example : MutableList<String> = Main.example
or well
thats not optimal
you can make example as static varable but this is bad approach
Why is that?
val example : MutableList<String> = Test().example
that way we dont have more duplicates in ram than we need without needing to delete a var
and then Main.example will works
retkid why not just inject your dependencies?
because i dont know what that is and am now googling
You use kotlin right?
yes
https://paste.helpch.at/esogakutod.kt arbitrary example
So I made a particle that follows a player from a location. It's not a straight line, it keeps track and updates when the player moves.
I wanted to step it up a little and make a wavy effect when it follows the player
new BukkitRunnable() {
final Location lastLocation = entity.getLocation();
double theta = 0;
static final double rate = Math.PI / 10;
@Override
public void run() {
lastLocation.add(Math.sin(theta), 0, 0);
Vector direction = player.getLocation().toVector().subtract(lastLocation.toVector()).normalize();
lastLocation.add(direction);
theta += rate;
if (theta > Math.PI) theta = -Math.PI;
player.getWorld().spawnParticle(Particle.FLAME, lastLocation, 1, 0,0,0,0);
}
}.runTaskTimerAsynchronously(plugin, 0L, 2L);
This works when the player moves along the Z and Y axes, but when I move in the X axis it doesn't have the wavy effect. It goes in a straight line and stops time to time (which I'm certain it's because of the sinus curve)
I feel like Java has the expectation for anyone to code in it to be stupid and really wants to hold your hand
like that is the design philosophy
The only thing that bothers me the most is the fact that Java doesn't allow non-final variables inside anonymous classes. It's not even a language limitation, It's straight up just an intentional restriction
But I guess these are offtopic #general
other limitation is that you cant create new object from pure generic type
yes
Yeah cuz type erasure
Idk if it’s possible in kotlin either tho
Maybe with reified
Yeah but that’s because how Java variables work
And ftr easy to solve with an effectively final variable
for what
that was simple solution for simple question
instantiating it directly would be the better way here
- not making it static
how would I check if a block clicked in a gui is equal to java public List<Material> gens = new ArrayList<Material>(); { gens.add(Material.IRON_ORE); gens.add(Material.DIAMOND_ORE); }
I have v if (event.getCurrentItem().equals(gens))
i would have to loop through the array with java for (int i = 0; i < 1; i++) but what do I put in the for loop?
it is enforced by bukkit though
yeah the plugin class loader ensures that, but it doesn't magically make it a real singleton
of course it works just like a singleton
Yes big noobie mistake I was making for years is using lists for everything
lmao
Idk how I didn't stumble upon at least a set or something before college
Lmao
How can I get a free Entity ID when sending a spawn_entity packet?
Is there a way to slow the day to say like an hour? I want to make a holloweenbmap where it's nighttime for like an hour and when a mob dies from the sun then it let's go of a pressures plate which means times up
someone a suggestion for a free spigot hosting that is not my localhost?
Could disable daylight cycle (gamerule) and set the time manually
You'd have to keep track of the current time as a float
Every tick increment it by some reduced amount and set the world time to the floor of that number
So maybe like a command that with a timer that adds to the time every few seconds or so?
Or actually wait your ideas smoother
Or for better compatibility with /time, just store a float that, while it exceeds one, gets 1 subtracted from it and the world time is incremented by 1
And every tick add a small amount to it
You could also make the day faster by adding more than 1 per tick
.