#help-development
1 messages Β· Page 182 of 1
try using getMap
Hi there, I'm running into some weirdness when spawning a Magma cube with NMS (yes, I do have to use NMS):
[21:16:59] [Server thread/WARN]: java.lang.reflect.InvocationTargetException
...
[21:16:59] [Server thread/WARN]: Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.ai.attributes.AttributeProvider.a(java.util.function.Consumer, net.minecraft.world.entity.ai.attributes.AttributeBase)" because "this.d" is null
[21:16:59] [Server thread/WARN]: at net.minecraft.world.entity.ai.attributes.AttributeMapBase.e(SourceFile:48)
...
Using the following to spawn it:
ReflectionUtil.invokeConstructor(
getInnerClass(), // net.minecraft.world.entity.monster.EntityMagmaCube
new Class<?>[] { EntityTypes.getInnerClass(), World.getInnerClass() }, // net.minecraft.world.entity.EntityTypes; net.minecraft.world.level.World
new Object[] { EntityTypes.getMagmaCubeType(), craftWorld.inner() }); // MAGMA_CUBE constant in EntityTypes; instance of the craftworld (obtained via World#getHandle
I'm not sure why or what causes this error, could anyone shed some light on this?
Main problem is that im using configuration serializable
hmmm then loop thorugh the section and checked cast is a good idea so your doing is okay enough
though since your just casting you can just do an unchecked cast to your getMap
it'd be more of an issue if there are multiple diff objects
// @SupressWarnings("unchecked") so its not annoying
Map<String, Crate> crates = (Map<String, Crate>) config.getMap("whatever");
that should work
its has an exception
I mean its put in yellow and its really annoying to see that warning while coding
π
whats the exception
yea supress the warning at the top of the method with the annotation I showed in the comments
it'll get rid of the unchecked warning
@EventHandler
public void openBlock(PlayerInteractEvent e) {
Player p = e.getPlayer();
if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
Block block = e.getClickedBlock();
if (block.getType() == Material.BLAST_FURNACE || block.getType() == Material.STONECUTTER) {
if (!p.hasPermission("group.miner"))
e.setCancelled(true);
}
}``` So i dont know why but the !p.haspermission doesnt work? Because the player doesnt have that permission but it doesnt cancel the event but when i remove that third if statement it does cancel the event if someone could explain it to me?
remove ; after if
sorry my bad it wasnt there
in the actual code
because i just wrote that if statement on disc
there is nothing wrong with the code as it is now.
but why doesn it work?
you can;t be assigning the perms properly
is that an actual permission node or the group they are in?
its a group
so that player only has default perms
then it won;t pass as a permission check
but I put the permission group.role in the group
add some debug to see wht it actually is returning
Any better way to send delayed chat messages without using 20 .scheduleSyncDelayedTask??
EG.
"Warning" after 1 second
"Warning" again, but one second after the previous message
"Knockback 5 stick at middle" but 1 second after the previous warning message
repeating task that counts up/down until its finshed, then cancel()
thats what it looks like but what itrs returning when it checks permission?
add some debug to see what it actually is returning
Fixed it! My bad, the getMagmaCubeType returned the wrong type, didnt't notice that the field had been renamed
can someone expound on what period does I am dumb with english
nvm
i figured it out
if you use "20" for "delay" and "60" for period, then it runs first time after 20 ticks and then every 60 ticks
e.g. 20, 80, 140, 200, 260, ...
hoyl shit
you scared me
its mfnalex
lol yeah I changed my pic lol
I'm not used to you changing your pfp lol its weird how I care when other people do it but I change mine like every week
How do I log the content of a ClientboundSystemChatPacket properly?
All of my attempts so far don't work with the ones sent by the sendMessage method.
It keeps logging null
I'm logging the content value but it seems to be a little different for ones sent by sendMessage
Hey guys im using maven to make a 1.19 spigot project, and in my pom.xml file my dependency code looks like this
21 <dependencies> 22 <dependency> 23 <groupId>org.spigotmc</groupId> 24 <artifactId>spigot-api</artifactId> 25 <version>1.19.2-R0.1-SNAPSHOT</version> 26 <scope>provided</scope> 27 </dependency> 28 </dependencies>
it gives me an error on line 22 that says
Missing artifact org.spigotmc:spigot-api1.19 pom.xml
even th ought i have imported spigot 1.19 in refernedced libraries in my workspace
anyone got an idea to help?
As far as I can tell, it's under a different content value for ones sent using sendMessage() called adventure$content
Yes
<repositories> <!-- This adds the Spigot Maven repository to the build --> <repository> <id>spigot-repo</id> <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url> </repository> </repositories>
respitory code
This is my entire pom btw
`<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.scribble2</groupId>
<artifactId>scribble2</artifactId>
<version>1</version>
<name>scribble2</name>
<description>A very scribbly project</description>
<repositories>
<!-- This adds the Spigot Maven repository to the build -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<!--This adds the Spigot API artifact to the build -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>`
i also have spigot 1.19 in my workspace
or should i remove thaT?
Ok
Ill try
thx
im doin it right now
Just a tip: I recommend using this for sending stuff like that.
```
pom file text here
```
Yeah.
psvm(String...) > psvm(String[])
in 99% of cases, noone uses the args[] string anyway lol
psvm doesnt accept a list though
oh no lol
sure
but tbh, who uses the args[] array directly? probably nobody
A lot of people use it for passing in arguments like database details to applications
Does anyone know how to get packet fields without ProtocolLib?
Causing memory leaks with a GC language isnβt the easiest
What are you checking with
Not sure
Havenβt really tried any
has 1.8.8 been removed from maven releases?
One can only dream
Are you on localhost

π good job
hi illusion
mans scheduled a work meeting for thursday
oh
and insisted on it for the entire fuckin week
loll
then didn't say anything for 2 hours, claimed he was waiting for me
L... I mean F
my ip got leaked on skidsearch lmao... @echo basalt
The worst thing - my ip is static
The best thing - my ip recently changed
wtf
tf is skidsearch
website where mc server database leaks go
aka player info
Someone once had my ip and took my internet off every single time my server was about to release :/
didn't know who it was
RIPP
say goodbye to home hosting!
haha
ez static ip
LMAO
Live's in California
Has bad internet
It all makes sense
old ip go brttt
I wonder how many times someone tried to DDOS me for this
lmao I wonder if the website is just doing backend sql queries
Oof
makes sense then xylight
I feel like you would want to encrypt an IP
Not that encryption is super hard to reverse but yk
sha256!
Actually yeah if you never need to get the ip back out
this looks so bad
Then just hash it
π
Same
30$/mo give you like 250/100
Except I get 10mbps
40$/mo give you 1000/400

15$/mo gives you like 100/100 on some isps
$15 a month here gets you a floppy disk and a carrier pigeon
to not get alex's masterpiece lost in conversation
oh true
does anyone know why maven can't find the following when few weeks ago with the same pom everything was working fine?
https://imgur.com/a/e9sWy43
no we will not help you
server might be offline
or bungeechat 1.8 got removed because it would make logical sense
fairs
sir this is spigot
@floral drum it isn't, i just cloned Paper 1.8.8 from the github repo and built it successfully, and this is it's pom: https://imgur.com/a/e4RCPiz
@floral drum also replying to u
well that release doesn't exist on that repo
i just cloned Paper 1.8.8 from the github repo and built it successfully
it the same as that. makes no sense .-.
What the best way for reading and writting map to/from yaml without using getMap()
for (Stirng s : config.getKeys(false)) {
map.put(s, config.get(s));
}
why?
because i can
map of <String, Object>
Basically
this.config = new Config(this.plugin, "crates");
Object object = this.config.get("crates");
if (object instanceof MemorySection) {
MemorySection section = (MemorySection)object;
for (String id : section.getKeys(false)) {
this.crates.put(id, (Crate)this.config.get(section.getCurrentPath() + '.' + id));
}
}```
Taken it from an old plugin i have done
uhh no
or the sound wont be supported by the speakers
That's way too much work lmao
how?
Because getMap() i need to supress with an antt which takes 1 line more of code
π¬
FileConfiguration config = ...;
Map<String, Object> map = new HashMap<>();
for(String key : config.getKeys(true)) {
map.put(key, config.get(key));
}
btw the sound played is already 50 dB without the volume boost
oh perfect
And for saving the same right?
uh sure you can just loop through the map and set it
the serializable stuff for yml?
yes
hi illusion
setting the object converts it to a map and sets the map with the maplist format
it's odd
it's like calling set(path, ItemStack)
output will be similar
hi purple
i know how it works
but i wasnt saying that
I was asking how does the annot work
Internally?
i mean there 2 ways for registering them
via ConfigurationSerialization or with an annotation
π€
Isnt like that?
Ilussion?
Alex?
Are you loading me?
I mean im being serious
I dont know why people take me as joking
there isnt one
how might i summon a falling sand, or really any entity infront of the player? currently trying to use player.getEyeLocation().getDirection();
and then will add the direction onto the position of spawn, however I dont even know how to spawn something
Is there a method to remove a certain amount of an ItemStack from a player?
how do i launch things with a ton of speed?
10 seems to be the max but its a tiny launch
and repeatedly adding the vector just isn't fast
like i've seen things with velocities much higher, but i never seem to be able to give them the velocity
why not just clear the item stack and then add the amount back on in order for it to be correct?
are you talking about the amount of an item?
ItemStack#setAmount()
no..?
hm, maybe
i might try iterating through the inventory
inventory.removeItem
anyone know why it won't recognize any of the bukkit imports for any of the .java files (not my code, its a plugin I am attempting to modify)
https://imgur.com/a/lXkFXCj
That removes all of the itemstack
player.getWorld().spawnEntity(location, EntityType.ZOMBIE);
nah it doesn't
thanks :)
Documentation says it does and it does exactly that while testing
declaration: package: org.bukkit.inventory, interface: Inventory
show your code tho
if you give it an amount as an argument it will try to remove only that amount
you can do matchingItem.setAmount(10)
and inventory.removeItem(matchingItem);
if you have more then 10 stacks
Is the amount the amount of the itemstack or do I have to pass it in in another way
it will remove 10
and will leave others
You can even place your items in different slots
like 1 item per slot
so you have like 36
if you set the amount of stack which you want to remove to 35
in other words
if you want to play tetris in the inventory you can
Ok, so I'm assuming the amount it removes is the amount of the itemstack I provided
you can clone the itemstack and set amount on the clone
and use the clone as parameter to removeItem()
time to test it out
it worked for me countless times tho
i was removing coins from player's inventory
no matter how player splitted them
containsAtLeast(item, amount) is at your help too in this case
for some reason this isnt working...
public void playerInteractEvent(PlayerInteractEvent event) {
Player player = event.getPlayer();
player.getWorld().spawnEntity(player.getLocation(), ZOMBIE);
}
im testing around with how things actually work in spigot before trying to make something of use, and this is supposed to spawn a zombie whenever I interact
however does nothing
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
ah
forgot the @eventhandler
did that in my main
this was just a snipit
works now :D
might be a bit ambitous but im trying to make an avatar bending plugin (i feel project korra can stand to have some improvements), and trying to start with water bending
FallingBlock b = (FallingBlock) bruh;
currently it just sets the block to water
player.getWorld().spawnFallingBlock(player.getEyeLocation().add(player.getEyeLocation().getDirection()), Material.WATER.createBlockData());
(i tried just Material.WATER but it gave me an error, and me being lazy saw it give me a working fix)
i never worked with falling blocks so can't suggest anything
i was debating setting an invis armorstands head to the block instead
i feel that would feel more fluid, not sure
you'd better work with packet entities tho
explain...?
cuz "real armorstands lag the server" and so on
i guess you can send a falling block packet to the player
if it exists
Basically sending a client-displayed thing to player
spawn or change blocks for one player or several
spawn entity to player
and so on
but requires some knowledge
ok
how hard is it to like convert the code after into packets if it lags that much
cause id rather learn how to do the "fun part" rather than the efficient part
procrastination yk
well i once used this api
basically it simplifies packet sending
you can google some packet or protocollib guides
and there are some guys on the server who can help you
not me
im gonna assume im gonna have to do armorstands instead of falling blocks because fallingblocks spawn like per block
as in on the grid, which i dont want
hmm
how do i continuesly control an entity as in frames after the intial event was called
?scheduling
good luck
How would one do initial file setup, such as if I wasnted the below to be set in the plugisn data folder on first start:
config.yml
messages.yml
shops(file)
default.yml```
and what would be the best way to add all the defaults, could I have a file in my resources folder and it just use that, or would I need to type each option indivudually in the code?
currently, I have it just create the config and messagse file if they dont exisit, but nothing in them to start, and for the shops folder the user can add and remove files to add and remove their shops, so it adds the empty default.yml if the folder is empty
hey, can someone walk me through how BlockPopulator works? I would like this in dms. Thank you.
if you have files in IDE
like config.yml
you can use JavaPlugin#saveResource()
Do you know how to use BlockPopulator?
no
is this pom file correct? Im not getting any errors but in my main class when i try to add extends JavaPlugin it gives me an error there, anyways this is my pom.xml
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>1</version>
<name>test</name>
<description>test</description>
<repositories>
<!-- This adds the Spigot Maven repository to the build -->
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<!--This adds the Spigot API artifact to the build -->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>```
other way you just do
File f = new File(path, file);
if (!f.exists()) {
try {
f.createNewFile();
YamlConfiguration conf = YamlConfiguration.loadConfiguration(f);
conf.set(key, value);
conf.save(f);
} catch (IOException ex) {}
}```
Ah, this works perfectly for me, thank you so much lmao, idk how I didn't find this with how simple it is
next time you go coding
open javadocs on second monitor
or at least on half screen
and second half would be your ide
yeah I got one monitor for IntelliJ, one for testing with the server and files open, and one for half youtube and half docs/googling
yeah I found it on there now, guess I need to refine my searching skills
Thanks for the hlep tho
true
This is in help development as it is a issue I'm having in intellij
I also downloaded buildtools perfectly correctly. But I keep getting these specific errors. I even tried resetting my pc but nope, waste of my time and now I give up.
I need help, I want a good login plugin for version 1.18.2 that allows me to use /premium
?spoon
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
Gross /premium means cracked and cracked is gross
XD
!spacex
A Spacex Falcon 9 is scheduled to launch Galaxy 33 (15R) & 34 (12R) from CCSFS SLC 40 in -5 days -6 hours -35 minutes.
someone please help me with spiral particles
i want to summon spiral particles towards the direction the player is looking
these are not errors, they are warnings. they just warn you that with including spigot you also include libs that are possibly vulnerable
either exclude them or ignore it
I love this
I like how at the end Tuinity just bodyslams into Paper
https://www.youtube.com/watch?v=6okxuiiHx2w this is the song btw
Β« Baby I'm Yours (feat. Irfane) Β» taken from EP "Baby I'm Yours"
available on all platforms: https://BecauseMusic.lnk.to/BreakbotBabyImYoursEP
Subscribe to Breakbot Essentials: https://lnk.to/breakbotessentials
Subscribe to Ed Banger Essentials: https://lnk.to/edbgessentials
Follow Breakbot :
Subscribe to Breakbot's channel: https://EdBan...
slowcord
This meme so good my dad laughed at it
the fact that c# uses var still throws me off
and the fact that java added it
man if it wasn't for the IDE highlighting it I would not use var
I just don't see the point
maybe they want to open the market to people who dont like strongly typed langs
idk lol
but it's not even weakly typed though is it
iirc it decides to type on declaration or smth
oh really?
so you can't even commit the crimes against humanity that js allows you to do
yeah
I just don't see the point of it, if anything it just feels like a dumb idea since you can find yourself digging because you can't remember what type a var was
I got pranked by that a couple of times already
yeah and it allows new devs to abuse it
already seen people in this channel using it unnecessarily
is the java var still strongly typed?
...
someone needs to sell me on why this isn't the stupidest feature in java and c#
SomeVeryChonkyClassName myThing = new SomeVeryChonkyClassName();
instead you can use
var myThing = new SomeVeryChonkyClassName();
A bit better
Also I just got commands hiding after unregistering :pog:
or you could use myThing = new SomeVeryChonkyClassName(); and let the IDE create the local variable for you.
java also has const and some other things
I don't know why, as they are not valid keywords and will error
You could
but then reading it
Imagine you have
wait const is reserved?
a really long generic class name
Yes
interesting
For some reason
are yall punching punchcards by hand to get these class names, because I have not written a full class name perhaps ever
You still have to type it once to instance it. No point in var
and make it harder to read back later, what a great innovation
its less readable
very less
yes but const does nothing
readable on the surface yeah
it crashes if you try to use it
Depends in the context
they added it because others did
as a matter of fact I am going to have to schedule another LASIK surgery because every time I read it I feel my eyes die a little
if you're creating a long class name in line then var is fine
if you're getting from a return then no
as then its less readable
what a sad day to have 20/20 eyesight
var myThing = new AReallyLongClassNameThatMayHaveGenerics(); yes
var myThing = getStuff(); no
I'll never use it, not unless it offered some kind of type casting
how about when it's nested behind 10 different classes
if it had type casting we'd be talking about something entirely different
basically javascript
well no
wait
var sender = myCommandSender;
sender = player; that would be fine, it's a subclass
or
var myInt = 56;
myInt = 'A'; // converts to 65
type casting is for losers anyway, you only use generics and make a util class that quickly gets them in the format you want at any given time like a true gigachad
if I ran a task later using the scheduler, with a delay of 1 / 50, would it run after a tick?
0-1 = attempt 1 tick later
oh okay
Spigotils
.scheduler(this)
.executeEvery(() -> {
Bukkit.getOnlinePlayers().forEach(player -> {
player.getLocation().add(0, -1, 0).getBlock().setType(Material.WHITE_CONCRETE);
});
}, 5, TimeUnit.SECONDS);
```I made time unit based scheduler poggies
const is reserved for the same reason as goto. They might add it in the future and they don't want some idiot naming their variables that thus breaking existing codebases.
fair
I really wish people would stop making unity videos and made more written documentation instead
yes lmfao
it sounds like a you problem
new ScheduleBuilder(this)
.every(10, TimeUnit.SECONDS)
.run(() -> {
...
})
.during(15).minutes()
.async()
.start()
.onCancel(() -> {
...
});
why so complicated lmfao
more like it sounds like a me solution
mine is cleaner, it does the essentials and it does it clearly
new ScheduleBuilder(this)
.every(1).ticks()
.run(() -> {
...
})
.sync()
.start();
cleaner is a subjective form
if the name of a method is "executeEvery" and it's arguments are a Runnable, a long named time, and a timeunit, I'd expect it to be pretty fucking clean
illusion wouldn't know what clean is if the great flood washed away the sewer he lives in
magma you're internationally recognized as the guy that dissed choco, you won't relive your legacy
if he successfully dissed choco without getting banned they got some damn mad skills
why relive that which is eternal
how is choco gonna ban him from soundcloud
man how the hell do c# events work
you have to feed them a method on the constructor?
Ew C#
C# naming conventions go brr
I don't even know half the shit I wrote there (though it works)
make proxies
easy
there are so many ways to avoid having long generics
exactly
i pretty much prefer yours
especially the during part
a nice thing to have
isnt this just like
a scheduler service
pretty sure u can just use that
hi all! I have a question, how to indicate in if() that, like, if the player has been standing on the slime block for the last 15 seconds, then (what is executed in if())
this is twice the same right?
That looks like Unity
I hate Unity 
Is there any method to remove chat colors from the event.getMessage(); in asyncchat event?
ChatColor.stripColor
Does anyone know how to access the adventure content field of a System Chat Packet?
(without ProtocolLib)
reflection
ProtocolLib just does reflection
you get the packet object from the netty pipeline and inject into it
no
protocollib overrides the listener
it does have wrappers but it mostly just does reflection
and injects into the netty pipeline
because it's the proper way to intercept packets
...
I'm not sure how to access the content field added by the Adventure API
maybe there is a reason that @hollow pelican is not using protocollib
Look at the NMS packet
I'm not suggesting plib
I'm just saying what it does internally so you can replicate it
^
I do have a packet listener class.
do you have the packet object?
Yes.
Alright, now look at the NMS packet class you're intercepting
do you know the field name?
But it is there, right?
It's not in the packet class file by the looks of things.
Yeah, I'm using Paper at the moment.
You could use the NMS component and convert it to a kyori component
or use the adventure$message field
Start with the adventure field
It is public so you can access it directly from the packet
if(packet instanceof ClientboundChatPacket packet) {
Component component = packet.adventure$message;
...
}
type deal
I don't have a ClientboundChatPacket file, only a ClientboundSystemChatPacket and ClientboundPlayerChatPacket.
uhhh
yeah that's 1.19 stuff
grr
gotta import 1.19 paper for that
just follow a similar process for either/or
Ah right.
I'm not sure how to read the file since I've never built the Paper file or looked into the sources.
I'll look into it though, Thanks. π
how might i make player variables? as in I want players to have variables dependent on only them
such as states of the player
what is BlockExplodeEvent and EntityExplodeEvent
create a player wrapper class
why does this code not print the arg flags but the command args?
public Map<String, List<String>> parseFlags(CommandSender sender, String[] args) {
Stack<String> commandStack = new Stack<>();
commandStack.addAll(Arrays.asList(args));
List<String> flagArgs = new ArrayList<>();
Map<String, List<String>> accumulatedFlagArgs = new HashMap<>();
while (!commandStack.isEmpty()) {
String element = commandStack.pop();
if (PROCESSORS.containsKey(element)) {
PROCESSORS.get(element)
.andThen((acc, list) -> list.clear())
.andThen((acc, list) -> {
NeoUtils.getInstance().getFancyLogger().info(element+": "+ flagArgs);
accumulatedFlagArgs.put(element, flagArgs);
})
.accept(sender, flagArgs);
} else {
flagArgs.add(element);
}
}
return accumulatedFlagArgs;
}```
the output is [22:29:58 INFO]: YourMom69 issued server command: /np schedule create -test s -cool s -dude s -test s [22:29:58 INFO]: [s] [22:29:58 INFO]: [NeoPerformance] -test: [] [22:29:58 INFO]: [NeoPerformance] hi [22:29:58 INFO]: [NeoPerformance] -dude: [] [22:29:58 INFO]: [NeoPerformance] -cool: [] [22:29:58 INFO]: [s] [22:29:58 INFO]: [NeoPerformance] -test: [] [22:29:58 INFO]: {-dude=[create, schedule], -cool=[create, schedule], -test=[create, schedule]}
Called when a block explodes - Called when an entity explodes
block v creeper
tnt vs creeper
cause tnt is primedtnt entity
not to spigot
declaration: package: org.bukkit.event.entity, class: EntityExplodeEvent
like if tnt calls block explode, how can i get the source with getBlock
no thats not clear
declaration: package: org.bukkit.event.block, class: BlockExplodeEvent
read it
anyways my problem is little more brain fucky if someone wants to give it a go
flag -test returns java addFlag("-test", (sender, args) -> Bukkit.broadcastMessage(args.toString()))
and that works
hence the [s] in output
however adding it to a hashmap doesn't work
say i want an armorstand to only live for 1 second, and then to be killed
how might i do this?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
oh thats a thing
What do you need help?
Have you try google in it?
I mean most of the time a simple google research its better before asking
yeah no, the BukkitRunnable was for him
Hi, does anyone know how I can, every time I create a world, have a roofted forest biome in the middle?
very nice when mouse dies while coding
how can I, every time I create a world, have a roofted forest biome in the middle? Thatβs my question π¬
https://paste.md-5.net/ofejovulop.java does anyone know why the recipe for effectToken doesn't work? It doesn't give an error or anything.
just dont use your mouse for coding
If you use your mouse for coding you're just missing the knowledge on the keyboard shortcut to replace your clicks
Me when I forget a shortcut
me when my code doesn't work
Nah
When the keyboard dies
Then itβs an issue
I donβt use wireless for that reason
Cause u can pretty much use an ide without ever needing to touch the mouse since the tab key and shortcuts exist
its not just the battery
Hey Guys Can I set the screen (like below) for loading bar(spigot) ? version in 1.19.2
whole thing seems to have died
can someone who knows stuff take a look at this?
https://paste.md-5.net/ofejovulop.java does anyone know why the recipe for effectToken doesn't work? It doesn't give an error or anything.
what do you do then? code with your mouse?
U charge ur keyboard?
Or get a wired keyboard
both lame
i code with my voice
osu players are advanced on the onscreen keyboard
copilot thinking about how to create a db table by reflections based on a class
would be funny if it would say "copilot is thinking..." like cleverbot did back in the days
Dam
sup conclure, still grateful for the unban lol
hot
hits different
No
Oh Ok
oh that's hilarious
I actually did a new choco song but as I was about to share it soundcloud deleted it, I think I might be banned from their platform lol
yeah I can't upload it lol
wondering how i would map columns to their datatype
im currently implementing a map<class, string> with the datattype in string format based on the field type
fix it
?
ive seen hibernate doing this so i might use it aswell
its being closed in that event lol
just use that event and open a new inv
might delay it by one tick
First time I actually saw someone get that error lol
Send the whole class
You are opening inventory on join, and then when any inventory is closed
That means player will see your inv 100% of time?
which calls another inv close event
But what does designGUI actually do?
and gets handled
Thats kinda weird
naming conventions
But you are disnging it again for every player
no need for new itemstack actually, just reassign
Itrmstack item = ...
inv.setItem(i, item);
item = ...
inv.setItem(i, item);```
assign it to a field and not recreate it on every event
i'm just having a LazyValue<T>(Supplier<T>) thing
Just call the designGUI func on resource start
Or check if the gui is null and then create it
private final Inventory gui = createGui();```
Recipe not working
Hi, idea why my first event (@EvenHandler) is found and my second no
-> https://pastebin.com/raw/nxnHr5Du
I use this code for check item put in a dispenser
anyone know why this happens when I format a message in asyncplayerchatevent? - https://imgur.com/a/FzkWS35
and anyone know how to get rid of this?
Hey, im tryng to create a world generator
but my code seems to puase the servers generating spawn.
This is for the custom chunk gen class
this is my main
hello!
how can i check if a minecraft day has already passed?
like when a day passes i want to give the players an item for example
?scheduling
There has to be some kind of time getter
Hello, is it possible to change the hardness of a block? (The time it takes to break to be more precise)
There is ways if you use NMS
I would have a repeat task on 10 seconds or so and then check the time
i'm new to making plugins and java in general so i don't quite know how to do that (:
same lmao
something along the lines of
Field field = net.minecraft.server.version.Block.class.getDeclaredField("strength");
// logic
Is it possible to make a world generator based on schematics?
free java lessons
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
not schematics tho
thnx
And then World#getTime
but you can use ChunkGenerator and WorldPopulator
Can you help me with world populator?
other way every ChunkLoadEvent paste schematic instead of chunk
never worked with it
ask somebody else here
Okay I'll take a look, thanks π
I already tried that way, it crashed the server
Anyone know how to use block populator?
isn't there like an event for it like OnDayPasses
Do you knmow how to use block populator
halp me
Trying to generate the backrooms with the changes already made within those chunks
this is what I have for my gen class rn
Please?
idk, I used the tutoral
hm
hello guys
I made a cone effect particle. and I would like it to make it so it would spawn in the direction the player is looking at. how could i do that?
right now it only spawns based only on the player's location
wait so , i use populate instead of generateChunkData
what about that??
{
Location l = p.getEyeLocation().add(p.getEyeLocation().getDirection().multiply(1.5));
double radius = 0.3;
double z = 0;
double deltaRadius = 1.8;
double deltaZ = 7;
for(int a = 0; a < 360; a++)
{
radius += deltaRadius/360;
z += deltaZ/360;
double x = radius * Math.cos(a);
double y = radius * Math.sin(a);
p.spawnParticle(Particle.CLOUD , l.getX() + x, l.getY() + y, l.getZ() + z , 0 );
}
}
i tried that, but it doesnt work since ur suppose to use x, z axis
public ChunkGenerator.ChunkData populate(World world, Random random, int chunkX, int chunkZ, ChunkGenerator.BiomeGrid biome){
ChunkGenerator.ChunkData chunk = populate(world);
com.sk89q.worldedit.world.World adaptedWorld = BukkitAdapter.adapt(world);
world.setSpawnLocation(0, 70, 0);
for(int x = 0; x < 16; x++) {
for(int z = 0; z< 16; z++) {
chunk.setBlock(x, 0, z, Material.AIR);
}
}```
what about this?
there are a quite a few errors
ikr
Hey, you made a skyblock right?
Do you know anything about blockpopulators before?
π
oh π
Does anyone know how to use mcmmo api?
I tried adding it as a dependency like this
<repository>
<id>mcmmo-repo</id>
<url>http://repo.mcmmo.org/</url>
</repository>
<dependency>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.202</version>
</dependency>
do u know how to make particles?
I just started programming π
if it has a plugin add that to your plugins folder i think
oh alright
the jar or?
jar
would that go under /resources /java or as a library?
how can i make this diamond animation?
How can I remove all the trees within a certain radius?
y'all really like copying hypixel don't you
first step is detecting what's a tree
second step is iterating through the radius
third step is breaking all blocks
Yes but I don't know how to detect trees π
Kinda hard if there isnt anything prebuild xd
Hey, I am looking to use block populator, but I am not sure this is correct, can you please look over my code?
https://paste.md-5.net/yeyeniwiju.java
i just like animation
how do i make it?
with armor stands?
or what
That's a vanilla map, no custom generation except Large biomes
idk
Then you can check for it xd
yes
help?
But its still not easy
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
That's why i'm asking for help
damn
You might have a point there ;-;
You could setup entries for every tree model so the blocks with their coresponding relative position and then check for each of them
I get this error when trying to add the dependency
Could not find artifact com.gmail.nossr50.mcMMO:mcMMO:pom:2.1.202 in jitpack.io (https://jitpack.io)
com.gmail.nossr50.mcMMO:mcMMO:pom:2.1.202 failed to transfer from http://0.0.0.0/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of maven-default-http-blocker has elapsed or updates are forced. Original error: Could not transfer artifact com.gmail.nossr50.mcMMO:mcMMO:pom:2.1.202 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [mcmmo-repo (http://repo.mcmmo.org/, default, releases+snapshots)]
Since Maven 3.8.1 http repositories are blocked.
Possible solutions:
- Check that Maven pom files do not contain http repository http://repo.mcmmo.org/
- Add a mirror(s) for http://repo.mcmmo.org/ that allows http url in the Maven settings.xml
- Downgrade Maven to version 3.8.1 or earlier in settings
did u bother reading the error?
a stack of logs with leaves on it
I got this code from looking at auto ranks source code
if thats your actual code then no wonder. repository have to be in repositories and dependency in dependencies
well the repo was under repositories and dependencies under dependencies
Yes
But how did this code work for someone else and not me
then check if the repo still exists, force clean install, invalidate caches, delete m2 folder or do whatever
yup i got that too
then?
why would it work here then if the repo is down
maybe because they already installed it on their local
as a jar?
;-;
?learnjava
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.
its a class
so why u putting a return statement?
and forgetting about the parameters
For the chunk gen
i think u should learn some java maybe
ye but thats not how constructors work
I did, just not that much
I fixed that error
then u should consider learning more. you should fill in the fields of the constructor
and then it will return
bro
The class extends the block populator
wtf
Im so dumb lmao
that's not how constructors work
its giving errors on top because it never reaches below
Ok i fixed it?
hopefully
its a constructor bro
yea im aware
I have no clue on what to do lmao
fill in the fields or learn java
Fill it in with what?
the fields it requires
lookin kinda hot
Don't jump into NMS unless there is no alternative
then go BuildTools as you will need to extend ServerPlayer
You poor soul
N o
Remember how once you got paper remappings working, EntityPlayer was gone?
Basically EntityPlayer is a bukkit remapping name
It's called
Mojang mappings
EntityPlayer also used to be a Spigot mapping. No longer used
It didn't mess everything up, you just didn't have the spigot mappings anymore
EntityPlayer -> ServerPlayer
nms.World -> ServerLevel
etc
mappings shouldn't break hex colors
it probably just prompted you to use adventure
LMFAO
can u help me with vectors?
can i ask why you specifically asked me and i probably cannot
you didn't have to
Anyone know why a plugin would just not load with completely zero console output? I'm trying to fix up the old Envoys plugin; so I removed the DependencyManager (as that did run although the plgugin didn't to make it more direct) and now it seems to do nothing at all
The plugin.yml is valid on yamllint.com as well so I can't see why that would cause it
plugin.yml: https://paste.md-5.net/uzaniziros.css
build.gradle.kts: https://paste.md-5.net/eyogubuhik.makefile
settings.gradle.kts: https://paste.md-5.net/pavisotori.apache
main java class: https://paste.md-5.net/iwopabasem.java
Not if you are using Spigot
bro
By who and what for?
wrong server
well
mans using gradle
only remappings are paperweight
You can use the paperweight remappings and just not use any of the paper API's features
if he's sticking with gradle, yep
isnt maven better?
it isn't
Thats the argument they always make
it just caches more
compile speed totally depends on yoru PC
run buildtools to create Spigot. and see how long it takes
I use maven on a i7-3770k
everything builds just fine
3-4 minutes is good
how i rotate a location in 360 without align the center, like this:
Good boy
Mr c# I am proud
Hold up I got a blog post for nms
Since that's the only time you need build topls
For spigot
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
Random random = new Random();
executor.scheduleAtFixedRate(() -> {
Location location = p.getLocation();
Location Loc = calculateRandomCircularLoc(location, random);
ArmorStand as = (ArmorStand) Loc.getWorld().spawnEntity(Loc, EntityType.ARMOR_STAND);
as.setGravity(false);
as.setCanPickupItems(false);
as.setCustomName("");
as.setCustomNameVisible(true);
as.setVisible(true);
as.setItemInHand(new ItemStack(Material.DIAMOND));
executor.schedule(() -> {
as.remove();
}, 1, TimeUnit.SECONDS);
}, 0, 100, TimeUnit.MILLISECONDS);
}
public Location calculateRandomCircularLoc(Location location, Random random) {
int d = random.nextInt(90);
Location Loc = new Location(location.getWorld(), location.getX(), location.getY(), location.getZ());
Loc.setX(location.getX() + Math.cos(d) * 1);
Loc.setZ(location.getZ() + Math.sin(d) * 1);
return Loc;
}```
Why isn't this working? I mean, it does not spawn armorstands.
nested schedulers?
wdym
executor.scheduleAtFixedRate(() -> {
...
executor.schedule(() -> {
...
}
}```he means this
scheduler inside another scheduler
why not
make it outside
how is it possible in this code?
outside the schedule make a variable ArmorStand and set it to that inside the code and remove ArmorStand after that
no
idk
Ok but it will work different
do whatever u want
anyways
why isnt this spawning armorstand?
ArmorStand as = (ArmorStand) Loc.getWorld().spawnEntity(Loc, EntityType.ARMOR_STAND);
You don't change it
It should just download
Not sure why dumbj is giving you an error
Wait
The plugin goes under your build tags
It's not a dependency
I'll give you an example gimme a minute
https://github.com/Y2Kwastaken/y2kcommons/blob/master/y2kcommons-spigot_1_17_R1/pom.xml @gritty pebble
Already sent that lol
No
Don't use that
Package with the maven tab
"Can we build it? Yes we can!" -Bob the builder
No no ni
diamond block or a helmet, not a diamond
Use life cycle
Package
Not plugins
Package will output 2 or 3 jars take the one without the dash that's just ur project name
it prints no errors
Hell yeah it will
it doesnt even spawns an armorstand
then your loc is bad or your code is not running
how is my loc bad
can anyone help me
your location is bad, you are replacing x and z with a cos/sin value
it was working with particles
it was? ok
no im replacing it with x + cos
don;t create an executor service each tim eyou call the method. create a pool
im calling it once
per command
create a pool outside the method
ScheduledThreadPoolExecutor
?paste
what on other side?
new
im doing it
bro these guys know all the weird links
nope. not working
your code can;t be called then
Why are you using ThreadPoolExecutors instead of BukkitSchedulers
theres no error command in that screenshot, but you return false from your onCommand
shit
so your onCommand is never callled
thx
he's doing animation so need more accurate than a tick, (is my guess)
But he's using 100ms which is just 2 ticks, no?

is the command added to your plugin.yml?
yes
100% certain?
certain?
then register yoru command executor in onEnable
Wheres your command description
im not duing it with executor
You shoudl not need to in main though
im doing it in main class
then your plugin.yml is bad
It looks like the description for the command is missing
why cant i in main