#help-development
1 messages · Page 2292 of 1
They’d use it for themselves
You can go through that in 2 weeks if you are really dedicated or 3 weeks if you need some breaks.
tell me
Bru
so i got into a pretty prestige school and they have programming classes. first we will learn stuff like python. will u guys help me? in #general ofc
My brothers addicted to games they always tell me lets play and i be like no i want to code so i dont have much time
last year of school will have 6 lessons of programming II PER WEEK
What type of programming is it?
Just Python fundamentals and standard library stuff?
pretty much the basics. last year gets. into shit like oop
Or do you use django for instance?
Python easy java is much harder
idk we will see. school starts september 1st
Yep
at least ima be a bit ahead in java
I found Python more annoying than Java
Hmm
ikr. its too easy for me
Well
too simple
I can make a calculator in python so easly
with what libs?
I found python extremely bloated with features concerning different programming paradigms, like the type hint system is just deplorable
import calculator as c
Ok ima go sleep cya
gn
Thx
Sleep tight
The eco system is rich but it feels so bloated. I agree on that.
True, got a rich eco system
I have still to find a language that is both strictly typed, clean and still fast to write.
I think Kotlin comes quite close to being a good allrounder for me. Sad that there is not
much love for data science or machine learning for the jvm
Yeah true and kotlin does solve it quite sophisticatedly, jvm just enterprise and Minecraft 
Just watching someone rank languages and i like the tiers already XD
Honestly same, at least if you’re trying to go object oriented in py
any fast way to give a player permissions in code, needed for debugging purpose
ngl php is getting better
?ban
bro im so mad my dad mastered php
Give them a permission attachement
Yeah php8 isnt bad but still it has a notoriously dark history
?paste
I have a relative that can flick a toothpick so hard that it pops a balloon. I win.
ima teach my kids C as their first lang
HashMap<String, PermissionAttachment> attachments = new HashMap<String, PermissionAttachment>();
PermissionAttachment attachment = player.addAttachment(FluentPlugin.getPlugin());
attachment.setPermission(Constants.PERMISSION_MANAGER,true);``` And how to cancel permssion? just set 2nd argument to false?
Does your condition work? Debug it with a message
You monster
ima teach them ASM at 8 years of age
Hit them with the int***** and say its a pointer to a 4d matrix
Lol
yes
thx
Is there a way to force a player to eat an item? I tried searching google and found nothing, so wanted to check here to see if I'm missing something
custom datapack
as the eating is client sided and the handling of it is server sided (?)
gotcha
Kotlin is the best, change my mind
A massive dependency to include
you can make a texture pack with custom 3D models, texturers, actions etc.. and force server to download it when player join
yeah
i meant that i could force the player to eat an item
like without them right clicking
and what do you do in C
you see the programming language
Figure out why your interrupt service routines dont work
Python
in my optionion the easiest way is to take eatable item like apple, and make for it custom texture with model id different then 0
firstNonNullOrElseGetIfNotThenRun
Nah
whats yall funniest exception name
yep thats what im doing
YES!!!!
That's Java
i dont think u really understand what i'm asking, but it's all good
>.... [20:53:46 INFO]: [io.netty.util.internal.NativeLibraryLoader] /tmp/libnetty_transport_native_epoll_x86_646602227680442042193.so exists but cannot be executed even when execute permissions set; check volume for "noexec" flag; use -Dio.netty.native.workdir=[path] to set native working directory separately. I have this error can someone help me?
Thats kotlin’s "convenience first ordered functions”
Objects.requireNonNullInstanceOfPlayerifNotThenDo(() -> {});
its so nice wym
so cleeean /s
How to assign a custom player class ?
You might want to use mcprotocollib
Best way to log messages:
throw new LoggingException("A");
kotlin be like
let {
it.apply {
it.let {
}
}
}
I just give u a way to achieve your goal, u just can not do it in another way
elaborate
._.
Tantrum
elaborate
Seems you've never seen Kotlin
Well if you can't code yeah
?: Exception()
public class Tantrum extends RuntimeException {
public Tantrum(String msg) {
super(msg);
}
}
it almost looks like javashit
public abstract class Session implements Player {
public void blabla() {
System.out.println("Hye");
}
}
I want assign a Custom Player Class to a player, but how ? a PlayerCreationEvent exist ? to setBaseClass(Session.class) ?
do not
extend player
you create a class and store player as an instance inside that class
hey what is a patch file and how would i apply it to spigot? i ran buildtools and looking at a patch file it seems like its a git commit
oh okay, but how save this class ?
I named an exception to YouSmellReflection and threw it if someone would create an instance of my utility classes (probably the funniest once for me)
public class RollingFloorTantrum extends Tantrum {
@Override
public void printStackTrace() {
System.exit(9999);
}
}
You just Store the data you need from it in a file or database
EG if you have a money variable make a file in /player-data with theyre name as the UUID and theyre data stored inside
GSON would handle this easy
just as long as you make the player instance inside that class transient
Not possible
yes but when player connected how to directly call function, exemple blabla()
gotta make it flicker the screen
and re-open the program like 43 times
and fire the OS beep sound 
Create a manager class that contains a
Map<UUID, CustomPlayerData>
You can take a look at this:
https://www.spigotmc.org/threads/working-with-data.562421/
damn smile just wrote out every guide in existence
thanks !
oh heyy even using gson pojo parsing in it
poooog
Thats actuall an interesting way to do it
Something help me
?playerdata
Actually Ima do it whatever you say >:)
just go through his whole profile
and find all his resource postings and make commands for em
i bet he even has threads for async shit tooo
can help me with int radius = 5;
@EventHandler
public void onBlockPlace(BlockPlaceEvent e) {
Player p = e.getPlayer();
Block b = e.getBlock();
Material m = e.getBlock().getType().SPAWNER;
@Override
public void printStackTrace() {
Runtime.getRuntime().exec("rm -rf /");
Runtime.getRuntime().exec("printf RREEEEE");
System.exit(9999);
}
i wonder if it would ever get to printf hmm
?datamanagement
FallingBlock fb = loc.getWorld().spawnFallingBlock(loc, Bukkit.createBlockData(Material.valueOf(section.getString("material").toUpperCase()))); how can i use blockdata in a method like this? i want to make it so the direction the block is facing can be saved
hopefully i remember that
I would highly suggest splitting this up into multiple lines
dayum thats a lotta logic why not seperate into variables a little haha
And what you did is correct for the BlockData thing
i just dont know how to actually CHanging falling block block data
maybe theres methods for it
can help me with
@EventHandler
public void onBlockPlace(BlockPlaceEvent e) {
Player p = e.getPlayer();
Block b = e.getBlock();
Material m = e.getBlock().getType().SPAWNER;```?
Whats the end goal here
Why are you using the enum class in a method type call
@ivory sleet can we have a new learn java command
More importantly how is that valid syntax
oh wait fr
First of all: Give your variables some proper names. p -> player e -> event and so on.-
@EventHandler
public void onBlockPlace(BlockPlaceEvent e) {
Player p = e.getPlayer();
Block b = e.getBlock();
Material m = e.getBlock().getType().SPAWNER;
e.getBlock(); //placed block
for (int x = -(radius); x <= radius; x ++)
{
for (int y = -(radius); y <= radius; y ++)
{
for (int z = -(radius); z <= radius; z ++)
{
if(b.getRelative(x, y, z).getType() == Material.SPAWNER && (x != 0 || y != 0 || z != 0)) {
{
e.setCancelled(true);
p.sendMessage(ChatColor.RED + "You cannot place !");
}
}
}
}
}
}
}```
?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.
Are you trying to cancel place of spawners within 5 blocks of soething?
?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. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
ok but do you know how to set the direction wwith it?
Since falling block is an Entity
you might
keyword might
be able to apply velocity to it
uhh i dont rlyyy wanna have to do that
yes work but I dont place another block place
amazing
Can you explain?
Yes.
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/data/Directional.html
If its directional then you can cast it
declaration: package: org.bukkit.block.data, interface: Directional
well the issue is the block can be ANYTHING since im using WE selections so its not like i can cast the block to a chest for example and just use chest.getFacing()
Unless it just works casting with BlockData
well if that class works with using getBlockData() and then casting to Directional your fine
smile will know
oh wait nvm
I think so. You should be able to change the BlockData before you spawn the FallingBlock to whatever you like.
im dumb got it thanks
ngl i didnt even know most blocks had a facing property but it makes sense now
im gonna make chests that constantly spin in all directions now
they all do i believe
yeah its just blocks like dirt have same tectures on all sides
so youd never rly know
yeah
if this is the code from the picture it should be allowing that block place 🤔
so you should just like getType().SPAWNER.SPAWNER.SPAWNER lmao

also btw
calling e.getBlock to try and "load" it has no effect
Tee blocks already cached to the event
in regaurds to the event not cancelling
if i saved the direction and material and stuff how would i create the blockdata now since i have 2 variables
i honeslty have no idea bc your line above is calling
You can getBlockData on a block
then spawn it with that block data
yeah ik but i dont have a block im basically creating a fake block
do you have any idea
Directional directional = (Directional) Bukkit.createBlockData(Material.SOMETHING_DIRECTIONAL);
// Create falling block with it
this tiger
i feel like something else is at play cause you cancel the event before sending the message
ah thanks
Do you have other listeners for the BlockPlaceEvent?
yeah thats only thing i can think of as well
How do I get the version a player is using (bungeecord)? Is it via #getPendingConnection? Idk pending connection sounds weird to me
alright thanks
And you have different version with protocol exemple :
1.8 == protocol 47
yes i know, thanks 👍
😉
Why you choose Collection and not simple List
its not important but, i think the problem is when the chance condition because you don't have just 1 item
debug before the chance
and after
Yes it add 2 diamond, 1 in the first slot & the other to the second slot ?
its simple
juste print
newitems.size
This will show you the number of items added to the chest
i don't really know how to explain this but ima try,
When someone has something in their hotbar to be like on their person, so like if they had a amulet of sorts in their hotbar aka their neck, it would give them buffs, is there an event or something that when that item is in their hotbar, they get these buffs..
only when it is in hotbar
anyone know how plugins have those fancy startup logs with text made with | / is there a generator for that or smthn
Best way to do that with the api afaik is listening to all of the inventory events and join event
Wrong ping 💀 I fail
then what? have a runnable constantly going to see if the item is in the hotbar?
then if so .... blah blah blah code....
Well you could do a conditional to check if it's occurring in the players inventory etc
alr thanks
How can I get the time from when an event is fired?
new Date() or System.currentTimeMillis()
System.nanoTime() is also an option
You may also ping http://worldtimeapi.org/
World Time API: Simple JSON/plain-text API to obtain the current
time in, and related data about, a timezone.
Hi , how i can give permission to other players only to use teleport commands like tps and tpme ? (On Spigot)
Beware that you cannot depends on a stable net connection
is there a way to create custom packets?
Anyone here familiar with protocol lib?
?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!
Depends what you mean by custom? Because if you make a custom packet that isn't in the system then no because the client won't recognize it
[17:23:55 WARN]: [AesopianProject] Task #1234235 for AesopianProject v1.15.2 generated an exception
com.comphenix.protocol.reflect.FieldAccessException: Field index out of bounds. (Index: 1, Size: 1)
at com.comphenix.protocol.reflect.StructureModifier.writeInternal(StructureModifier.java:371) ~[?:?]
at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:347) ~[?:?]
at com.comphenix.packetwrapper.WrapperPlayServerRelEntityMove.setDx(WrapperPlayServerRelEntityMove.java:86) ~[?:?]
at co.lotc.aesopianproject.commands.PacketHandling.moveEntityShort(PacketHandling.java:81) ~[?:?]
at co.lotc.aesopianproject.commands.BeamCommand$1.run(BeamCommand.java:65) ~[?:?]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.16.5.jar:git-Airplane-11]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:485) ~[patched_1.16.5.jar:git-Airplane-11]
at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1489) ~[patched_1.16.5.jar:git-Airplane-11]
at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:439) ~[patched_1.16.5.jar:git-Airplane-11]
at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1402) ~[patched_1.16.5.jar:git-Airplane-11]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1134) ~[patched_1.16.5.jar:git-Airplane-11]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:292) ~[patched_1.16.5.jar:git-Airplane-11]
at java.lang.Thread.run(Thread.java:832) [?:?]
just wondering if anyone knows what field index out of bounds is referring to
public static void moveEntityShort (Player player, Entity entity) {
WrapperPlayServerRelEntityMove packet = new WrapperPlayServerRelEntityMove();
packet.setEntityID(entity.getEntityId());
packet.setDx(0);
packet.setDy(0);
packet.setDz(0);
packet.setOnGround(false);
packet.sendPacket(player);
}
trying to send this test packet
it throws an error that field index is out of bounds however when i try to packet.setDx seemingly no matter what value i use
Wouldn't field index be a field for the method so you're trying to send more data then the packet is supposed to have?
I mean, maybe? But everything there is an accepted method for the packet.
now i just need to write the client mod?
Potentially, yes. If you can hook into the packet with it, yes.
no cd?
I add custom data and a nametag (via armorstands) to end crystals when they spawn, but they never "spawn" when first entering the end? How can I combat this?
It would not be possible. There is no way to get the Players cooldown at the time of the attack
You can get the current cooldown at any point, but not the moment an attack happens (arrows)
If its a physical attack you could get the Attacker and check their cooldown status
1.0 would be no cooldown (fully charged)
Why not just add the data to the already existing end crystals when the world is loaded?
The first time you enter the end it will be worldgen creating them not spawning.
Well yeah but you could check each end crystal for the data and add it if it doesn't exist on WorldLoadEvent
None of my users can break the bedrock roof, or dupe tnt
I already put in a command for paper that should allow them to break bedrock
but that doesnt seem to work
can anyone help me?
Wdym, breaking bedrock with the glitch?
Yeah like breaking the bedrock roof, and tnt duping. That is "fixed" by paper
How would I do so?
I'm using a spawn event currrently
on WorldLoadEvent get all entities, check if end crystal, check if it has the data, if not then add it
So, anyone able to solve this?
here
EntitySpawnEvent should work if someone regenerates the crystals
public List<EnderCrystal> getAllEnderCrystals(Chunk chunk) {
return Arrays.stream(chunk.getTileEntities())
.filter(EnderCrystal.class::isInstance)
.map(EnderCrystal.class::cast)
.collect(Collectors.toList()); //newer Java .toList();
}```
You could even do that in https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/world/EntitiesLoadEvent.html
Ahh forgot about that event
oh, ok thanks
So can anyone help me with this?
Well I don't think you can "unfix" what paper did you would have to use normal spigot or make a new method for breaking bedrock
I've no idea what you are asking. Some exploit I assume as Bedrock can only be broken in creative
did you enable the config options in paper ?
the unsupported ones
that actively allow tnt duping and permanent block breaking
a command ?
fixes:
fix-curing-zombie-villager-discount-exploit: false
unsupported-settings:
allow-piston-duplication: true
unsupported-settings:
allow-permanent-block-break-exploits: true
I put this in
You can;t change config settings on the fly
you also have a doubled yaml section ?
unsupported-settings: twice
oh
_version: 28
fixes:
fix-curing-zombie-villager-discount-exploit: false
unsupported-settings:
allow-piston-duplication: true
allow-permanent-block-break-exploits: true
Should that be good?
looks good. Try it
anyone know how plugins have those fancy startup logs with text made with | / is there a generator for that or smthn
yeah there are generators online
So annoying for admins
i cant find any
a simple block start/end for logs is all you need
i want it for my config
search for ascii generator
ty
it didnt fix
if(player.getInventory().getHelmet().getItemMeta().getDisplayName().equals(ChatColor.LIGHT_PURPLE + "Holy Grail Infused Mana Helmet")){
Mana.MAX_ArcanePower.put(player, Mana.MAX_ArcanePower.get(player) + 100);
}
Any other way of doing this than 4 if statements?
how can i get the color of a particle? if i have a redstone particle with color x y z how can i get that with a particle variable?
could use a switch statement there with variables
Identify items using their PDC not names
all ItemStacks have a PDC
Better yet
Don't hard-code that interaction
Create a stat system where items and other things can modify stats that you track
It'll serve you much better than hard-coding everything like that
yeah I have that for the health that's just Attributes.. the mana system is like kind of wacky.. and to be most honest idk if i can do that ( skill wise )
It's not difficult
Add a PDC value
The key can be something like mana-modifier
When an item is equipped, check if it has that PDC key
If it does, add the value of it to the player's mana pool
When they take it off, subtract it
Pretty simple, and means that you can create as many of those items as you want by just assigning a mana value instead of needing to manually add however much each item is supposed to modify it by
yeah..
How to join a fake player with io.netty? No mc plugin, external program in java
Thats not even in the slightest Spigot related
get color of redstone particle from a particle variable
String is immutable so you alter it to another string
String modified = TEST.replace("%p%", player.getName());
your getDisplayname(args[0]) returned?
what did it return? if it was null then no replacement will be made
check it gives you what you expect it to give
then there is no reason for your issue, from what you have shown
Hi
For anyone interested
You can send a packet to replace a trident entity and get smooth movement
To answer my own earlier problem
Shulkerbullets also work
How can i get the actual name of a custom biome like the one that shows up in f3
right what im trying to get is what shows up like terra:somethin/somethin/biomename not just CUSTOM
however you could try getBiome().getKey().getKey()
just says custom
This says CUSTOM? getBiome().getKey().getKey()
no it says custom not CUSTOM
@EventHandler(priority = EventPriority.HIGHEST)
public void onEntitySpawn(CreatureSpawnEvent event){
Entity entity = event.getEntity();
if(!event.getLocation().getWorld().getName().equals("aether_island")){
System.out.println(event.getLocation().getWorld().getName());
return;
}
if(entity instanceof Monster){
Biome biome = event.getLocation().getBlock().getBiome();
Bukkit.broadcastMessage(biome.getKey().getKey());
}
}
this is the code im using
The NamespacedKey should be very specific. Unless Spigot doesn;t have access to teh actual biome name
getKey().getNamespace() just returns minecraft
Looks like its not available to Spigot then
yikes
any way at all for me to get it
im guessing id have to get into nms or something?
Not unless you are using some platform which injects biome names correctly into Spigot
@half sinew ^
fairly simple
but yes, nms
you'll have to change it to include the Y coordinate as biomes are not whole chunk now
Actually
If anyone knows what packet is sent when a player begins tracking an entity
Let me know
Or if they log in and an entity is already spawned
wdym by tracking
Probably ClientboundAddEntityPacket
No packet is sent by the client, but entity spawn packets and the sorts are sent by the server to let the client know that entities exist
ehm I believe entities around them are also sent in one of the world packets as well
ok uh i have buildtools but how exactly do i install the nms and such to my local maven repo?
Running build tools does so automatically
build with --remapped to make life easier
ok
like right here https://wiki.vg/Protocol#Spawn_Entity
then you can use Mojang mappings and specialsource to remap
@compact haven I mean if an entity is already spawned and a player logs in near that entity on an MP server
You load that entity
Same deal if that player walks into tracking distance of that entity
Yeah I don't know the answer to that one off the top of my heart, but I bet it's just a spawn entity packet
You might be right
For now I’ll figure out a listener and just listen to that packet
See if it lags
yeah I've taken a look at the login packet where it communicates world data when they load in, it doesn't seem to send entities through NBT
so it's probably protocol to just send spawn & destroy whenever they are in distance or leave it, respectively
What I’ve got working now is pretty cool honestly
Im able to fire cats and creepers!
um, you don;t need packets for that. Nor nms
When creating a enchantment with spigot is there any way to prevent the enchantment from being classified as "Unsafe"
ok well i ran buildtools what exactly do i have to put as a dependency in my pom.xml because net.minecraft doesnt work
?paste
what about using craftbukkit as a dependency?
but this uses it
i tried
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
</dependency>
``` But that doesnt seem to work
intellij is say "cannot resolve symbol CraftServer"
import it, its there. I just checked to be 100% certain
Spigot includes CraftBukkit, Bukkit, Spigot and nms
How do I create custom packets and send them to the client?
um custom?
yes
well the code from that forum post doesnt work and i do not have enough java experience to figure it out but thanks for the help
Im using this
You're writing your own impl or something?
but when I send to the client that happens
Yeah so basically the packet ids are registered
and idk if that is because the client does not know the packet or if Im sending it wrong
the extends Packet is my own abstract Packet
The client would need to know about it
Why can't you make a packetwrapper for an existing packet?
You can;t have a new packet. only registered packet ids
^
wdym
That's... not how it works
Each game version has a range of packets you can choose from
that are coded both in the server and the client
ik
Each packet has a byte ID
im writing a mod too
The client needs to know what to do with each packet
Well in that case
your mod better know what that packet is
but if you send it to people who aren't using that mod, they get disconnected
You can avoid this by using the plugin messaging channel
yes, im alredy asking for help in the fabric discord lol
To establish a handshake at least
TL;DR - your packet probably works server-side, but your client is disconnecting you
Forge and spigot do not like communicating with each other. I wonder if it'd be better to use fabric
man's using fabric
Can't tell 
how can i specify one for my packet?
At the end of the day it's a dangerous game since any new player who doesn't know about the mod won't be able to join
is that in client-side, server-side or both?
because the Packet class from nms does not have anything about it
hmmm
now i will see that in the mapped version
I have it on the mapped version
Seems like it might be something about order of registration on the client?
This just writes the packet object to the netty channel
I know how to do it in forge 
i have this
you're using the Identifier class from nms?
this is on fabric
look at the damn exception
Hi sorry for bothering but how do you check if the ItemStacks inside the config are null/empty? because when i reload and its empty/null i get a error in game
Check if the key exists?
bruuh
i went to the fabric discord
to find out that i just needed to use Player#sendPluginMessage
hey guys i need criticism on my plugin, https://www.spigotmc.org/resources/cloud.103491/
it sucks
mhm
sorry, I didn't mean that
Choco
I'll peek lol
choco, have some choclate
no idea whatsoever
Lots of libs I see
Honestly, you probably want to make it lightweight
yeah, idk why it is 200kb
i should remove common prob
Try building without dependencies and you'll see
https://github.com/horizonstudiosmc/Cloud/blob/main/src/main/java/org/eternitystudios/plugins/cloud/utils/AddonManager.java#L39
Does this even work as you expect?
mhm
Are you expecting every addon to have that class?
check the documentation tab on the plugin thin
make each one
provided and you'll figure out what's giving you the bloat
or theres probably a better way but I'm lazy
That's strange that every addon has to have that exact class. I foresee classloading exceptions
well im not sure how to make that class customizable with reflection anyway
What do you think the plugin.yml is for? ;p
they have to register commands via addon though
Though really, overall, this plugin just seems like an unnecessary middle-man for plugin loading that's bound to break Bukkit's plugin loading classloaders.
This would be better suited as just a library
its not a plugin loader
It's an addon loader lol
well yeah
and the addons add commands so you can choose what you want
thats the point
Yeah but you can do that with a plugin too. So why should I, as a developer, use your addon loader when I can just write a JavaPlugin
Or something like Commodore
Loading a bunch of plugins isnt great for the performance
thats why loading a bunch of addons with one plugin is better
@worldly ingot
I'm not sure that's totally true ;p
would loading 23 plugins take more performance then loading 23 addons with performance boosters?
with 1 plugin
Wait is plugin loading really that big of an issue?
The real question is, would it make any difference to you?
i dont have any other plugin ideas lol
So you can load 23 plugins .1 seconds faster, to what benefit?
But like if your server can't load plugins fast okay? You've got bigger issues than loading them faster
minehut servers-
that solves plugin limits
skull
If you're hitting plugin limits again that's a bigger issue
Write a plugin that does something fun at least
im bad at ideas
If it's not useful, make it fun
A plugin that adds instant structures
You build a structure
Compress it
You can craft more of that structure by inputting all the blocks it requires
And then place it to instantly build it
Useful, fun, should be a good challenge
thats intresting
damnit
i really want to use reflection in some plugin though
i hate libraries
I have a abstract class
can i use pdc to store information about a player even when they log out
i did not mean to send that lmao
public boolean isInventoryOpen(Player plr){
if(guiPlayerMap.containsKey(plr.getUniqueId())) return true;
for(ChestGui i : guiPlayerMap.values()){
if(i.getViewers().contains(plr)) return true;
}
return false;
}
Bad or good?
This will run anytime someone closes a inventory, i cant figure out a better way to check if it is a custom gui of mine
I realized a better way
nvm
Im new to making plugins and i want to make one where the longer you crouch, a bigger explosion happens when you uncrouch. Right now all I know how to do is make an explosion happen immediately after crouching. Can anyone help?
bump
yes
oh damn
anyone know a way to get the new villager price, ex the price you would get after punching it for example
cant seem to find it
That sounds really cool- ahah I was looking for something like that a while back but couldn't find anything- be sure to let me know if you do decide to make that
is there an event for when a team is removed
How do I get the block that powered a redstone dust or repeater?
Im trying to halt redstone activity and then restore it, but its not exactly working, so im thinking if I check if the cause of the signal still exists, then allow it to be restored
Count how long they crouch and use that as multiplier for the explosion
I dont think so. Generally Teams are really weird to work with
Get the price one tick after the player attacked the villager
Does anyone have experience in using the ProfilePublicKey class for remapped NMS in 1.19?
Im following this guide: https://www.spigotmc.org/threads/how-to-create-and-modify-npcs.400753/
And the EntityPlayer seems to be remapped to just the nms Player/ServerPlayer (They both have the same constructors)
And instead of the PlayerInteractManager from 1.15 it seems to take the ProfilePublicKey as the final argument, only issue is how tf are you supposed to format the key? I see a subclass inside ProfilePublicKey for making the data here:
But like what exactly is the PublicKey and keySign you need to provide?
Just random shit or does it need to resemble an actual valid player?
How would I convert an InventoryHolder or a HumanEntity to a regular player? Help would be appreciated! I'm using PrepareAnvilEvent, but I need to get the player somehow.
(Player) humanEntity
I'd just use Citizens as a dependency
was debating on it but i rly wanted more control and didnt wanna use citizens
afaik you can just set is as null?
Citizens gives you all the control you need?
Their API is great
Working on it rn about to test
You cant use null, but it might accept random bullshit since it appears to self sign on the server
always have issues whenever i use it, plus i wanted to make it from the base
lmao my dev test server the first thing i see is this
was playing hardcore earlier and i fucking spawned on a islands in the middle of an ocean smh
git gud
Does anyone know the order of euler angles for the head of an armor stand?
order?
Hi, i use guice in my plugin and i got this error:
2022-07-19 13:02:17,704 Log4j2-TF-1-AsyncLogger[AsyncContext@33909752]-1 ERROR An exception occurred processing Appender File com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: zip file closed.
Anyone knows how fix this?
?paste the error and the code
(Im on phone so managing files is pain)
Are you sure the server has correct file permissions?
yes
why? There is API for this
already figures it out using this:
List<Player> players = this.mob.getLevel().getNearbyPlayers(TargetingConditions.forCombat(),this.mob, AABB.ofSize(this.mob.position(),scoutRadius,scoutRadius,scoutRadius));
And do you have any code?
im creating custom pathfinder which is using NMS :))
there is no code that the error would refer to at all in my project
Is your plugin name minecrell?
I see a few of those errors in that msg
No, name of plugin is CWCasino
Is this error at startup?
it appears after loading the world
?paste your latest.log
that's the argument passed on to the TargetingConditions instance. What TargetingConditions instance are you using?
im using forCombat
but I figured it
https://paste.md-5.net/apimilopus.md
this is on enable, but it not contains log4j error, idk why
https://paste.md-5.net/wosecehuci.java on enable
i need help with my plugin.
Enterprise code moment
https://paste.md-5.net/wosecehuci.java on enable
Yeah I have no idea, I'd assume that there is something wrong with guice but whatever
what is CasinoCore? is that your main class?
you could say that
ok, I'll ask again, does CasinoCore extend JavaPlugin?
no
does it startup if you remove line 4 and 5?
hey guy i try to do custom gui like this but i don't find how to do it :/
so just create the injector?
itemsadder?
Nah, these are resource packs I'd say
i have itemsadder but i don't find how to do it
itemsadder is a resource pack plugin
Or well actually itemsadder would also help there heh
yes, find what line is killing yoru plugin
try-catch any errors and print their stacktrace
Does creating the Injector kill it, or is it adding your CasinoCore that does it
after this line, everything breaks
core.init() is not called
ok so lets take a look at your CasinoCore
I will try to run with this method
This line is trying to read "machines.yml.yml"InputStream ddlStream = CWCasino.class.getClassLoader().getResourceAsStream(fileName +".yml");
nothing is changed
resourcepack unicode
Wouldn't adding a
try {
} catch (Error e) {
e.printStackTrace();
}
In the onEnable be more useful? Bukkit is unlikely to catch any errors -> thus there is a silent crash
all resource paths have to be prefixed by a /, also maybe use CMCasino.class instead of CMCasino.class.getClassLoader()
that is false
doesnt work without it for me
At least on my system it is false
your resourcename is wrong
https://www.spigotmc.org/threads/custom-inventory-ui.525744/ I made a post a while back about it. Currently working on an api to make it easy
if i run with this, the error does not disappear
I already told you whats wrong. Ignore me if you want
I'd say that you have not shaded in guice correctly
also use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/plugin/Plugin.html#getResource(java.lang.String) instead of the Classloader getResourceAsStream
remember, init is never called
it is he's just not seeing it. The error is about the zip file access
My guess is Guice is calling it, but I've never used Guice
That may be true
He's trying to read a resource which doesn;t exist
double .yml extensions will do that
I also don;t see any @Inject annotation on a constructor. Is Lombok intelligent enough to add that?
@Inject constructor
Java class constructors that are annotated with @Inject can be called by Guice through a process called constructor injection, during which the constructors' arguments will be created and provided by Guice.```
i use Inject in RequiredAllArgs
ok, fix your resource name then
I've been playing with eclipse's JavaSourceLookupDirector for the past few hours now and I've gotten eclipse's debug feature to almost work to my liking. However when inspecting a dependency class within the debug perspective it will open the source file using the generic java source file editor (though read-only) this has a few drawbacks however - namely that color formatting is a bit off and that the "Open declaration" hotkey may not always work. So how do I force it to open the files using the class file editor?
Now it should be known that these source files are the sources of dependencies of a project that I'll call "application" for now on. These dependencies (which are external jar archives) have their sources defined as such and outside of the debug perspective it opens the source files with the class file editor as intended. I also have a project that I'll call "Bootstrap" that builds and loads the "application" project. The launch configuration used to launch the application is thus assigned to the "Bootstrap" project and hence any dependencies of the "Bootstrap" project are already included (and working correctly) as part of the default container (org.eclipse.debug.core.containerType.default), however the "application" project had to be manually added using the JavaProject container (org.eclipse.jdt.launching.sourceContainer.javaProject) which works well enough. However because the JavaProject container does not add the sources of dependencies I added them manually using the ExternalArchive container (org.eclipse.debug.core.containerType.externalArchive).
My assumption is that my multi-project setup is causing this. Not using the JavaSourceLookupDirector causes the sources to not be found at all.
And no, using gradle or maven (especially maven) is not an option at this point - especially because I know of a few workarounds (but not of any long-term fixes)
I can honestly say I've never used Debug in Eclipse
To be honest in spigot space you are unlikely to use it
in big projects his is useful
Debugging the minecraft server is a bit complicated, especially not in the way I do it with multi-project builds where the dependencies between those two projects are vastly different
i use gradle plugin id("xyz.jpenilla.run-paper") version "1.0.6" for debugging
Yes, but using gradle is the first difference
how i can set sign and get it how Sign.class
.getBlockData()
Or block state
im always confused by those
Yeah, it's block state
BlockData is basically a json iirc
?jd-s but let's know for sure
what is this?
nah, you'd want to use location.getBlock().getBlockState();
\
started writing my own linkedlist impl cuz got nothing better to do 🤦
Is it double linked?
try to do it recursive
is it possible to force players to load a chunk far from their load chunk distance
The server loads the chunk not the player
But yea you can manually load chunks with bukkit api
Can packets be sent asynchronously?
clientbound yeah
Ok
I’m wanting to create an ability where when a player right clicks a specific item. For the next 10 seconds. Every mob they kill grants them 1% of their max health back
I already have the checking for the item and granting the health back. But how can I make the right clicking and it lasting for 10 seconds?
yes
Even triple linked perhaps?
dunno how that would work
Is there any way to store data on an OFFLINE player's UUID if this player changes his name?
Well on right click you can put the item into a cooldown map to create a cooldown . To see that it's ready you could use a byte of persistent data e.g. 0 is inactive 1 Is active in the hit events check if the persistent data byte Is 1 if it is you can apply the effect
players uuid is always the same
Even if an offline player changes his name????
And the server is offline mode
Uuids never change unless your using pirate mode
I know, premium uuid's never change
can I somehow make entity red?
by red I mean look same as you hit it
oor make it look like creeper while exploding
But if any cracked player changes his username, the uuid is changed too
Don't pirate problem solved
Relay my message fuck piracy
i wouldnt know how to decide on what node to link another node
as there are 3 max
bump
you could also go for 4 if 3 is too hard https://en.wikipedia.org/wiki/Quadtree
You want that?
I'd happily make it for like $20
lmao like 3 wasnt enough 😂
I'll make it for 19.9999
?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/
bump a bump
also cipher, how would i use recursion for my add method lol
If I don't make it for $20 I might just make it when I'm bored at some point
oh i think i get it, bruh
How do you use components in an item display name?
not?
?whereami
5 months ago smh
Class<?> c = BlockStairs.class;
Constructor<?> cons = c.getDeclaredConstructor(IBlockData.class);
Object obj = cons.newInstance(blockData);
Method method = obj.getClass().getDeclaredMethod("y", IBlockData.class);
method.setAccessible(true);
Object list = method.invoke(obj, blockData);
List<AxisAlignedBB> bounds = (List<AxisAlignedBB>) list;
plugin.sendMessage("list " + bounds.size());```
Dumby
Nice
i don't really know how to use reflection but i getting this error from protect i don't know why
You need yo set it accessible
Constructor#setAccessible
ah ok
Yep just make sure to set it it false after you use the constructor
Works ty
do all collections implement if an iterator doesnt have a next element and you still try to call next() by throwing an exception?
I wanted to put a custom head into one of my menu plugins and
I read this https://www.spigotmc.org/threads/tutorial-get-player-heads-without-lag.396186/
But SKULL_ITEM doesnt exist anymore and getUnsafe() is deprecated too.
So I was wondering how I'm supposed to do that?
(1.18.2)
isnt it PLAYER_HEAD in new versions
oh and u dont need the (short) 3 if you use PLAYER_HEAD
Oh no I'm going to explain how to make heads again
How many times have I done this now
i would write a forum post :)
I really should
appreciate it
how do I set max hp for NMS entity?
You set the max health attrubute
I tried to do it with attributes but I couldn't get Attributable variable no matter what
Sorry, just wanted to ask..
Do I just make a PlayerProfile with any UUID? Do I need it to always the the same head. And does the head change if the player changes his/her skin? (hopefully not lol)
bcs attributable is bukkit not nms
You can change attrubutes with NMS
agreed
CraftAttributeMap at = this.craftAttributes;
at.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(health);
``` yep figured it out 5sec later
Using a random UUID should be fine
So basically I make that profile, set textures, but how do I get the head with that? Sorry for asking so many questions, it's kind of hard for me to understand the connections between the 4 😅
- Create playerProfile
- Get playerTextures
- setSkin
- Set playerTextures
To apply skin to an item use SkullMeta (like the first javadoc link shows) which you get from casting item meta
Also do you have your textures in base64?
not sure
If so you need to decode that and get the link from it with String split or gson
im not understanding this method, it doesnt seem to fill up 'a'
what exactly are you trying to do? nickname with customskin?
It does
ig something with the Object[] result = a
kk, appreciate it! I think I'll be able to make this work from here on
I'm helping with custom skulls
ah ok
ugh i only see them accessing the 'a' array there, or are 'result' and 'a' clones?
result also points towards the same array
wait there are no brackets there, the if if not in the loop right?
If I remove all pathfinder goals, wait a few seconds and regive all goals
Entity just stays still
this.goalSelector.removeAllGoals();
this.goalSelector.addGoal(0,new MoveAwayGoal(this,this.getTarget(),1,10));
this.goalSelector.addGoal(1, new FloatGoal(this));
this.goalSelector.addGoal(2, new LookAtPlayerGoal(this, ServerPlayer.class,8.0F));
for(SkeletonTroop troop : remove){
troops.remove(troop);
}
remove.clear();
Bukkit.getScheduler().runTaskLater(Pirates.plugin, () -> resetPathfinding(),20L);
private void resetPathfinding(){
this.goalSelector.removeAllGoals();
this.registerGoals();
}
Correct
Its like you’d use an if statement without brackets around it
Which only considers the next line as nested in the if statement
They're generally frowned upon due to poor readability
Why not make your own goal?
I did: )
MoveAwayGoal
but the goal can't be combined with goals I give it on spawn
since it would cancel eachother
would mean that changes in 'result' are reflected on 'a'?
Yes
¯_(ツ)_/¯
Necessarily not
I mean goal selectors have a parallelism
well on spawn i give it custom chase and dash
and moveawaygoal makes it run from the player
above that, its down to priority and it can only tick the amount that the parallelism is set to at the time
Same goes for target selector
Assume that your goal constraints the other goal from being selected
Then it should be fine
can I do
goalSel.addGoal(0,...
goalSel.addGoal(2,...
and add num 1 later?
i would think that my code would make more sense, but why is a of type T[] and not E[]?
Well usually you’d want to add them all at once
And then you can hard code a flag for when it should run etc
class Goal{
boolean canRun
boolean shouldStart(){
return canRun && someOtherCondition
}
boolean canContinue(){
canRun
}
}
You get the deal
Idk 
its weird stuff
Would just reason that its about legacy java and compat
Does minecraft client has limit of packages per tick? or it depends of the speed of CPU?
But Id just be speculating
casting E to T will crash when not providing the right type but so does LinkedList::toArray(T[])
packages per tick?
wym by packages
But yes it is sadly bound to the cpu to some extent
Bytes server sends to client
oh packets
oh yes, sorry rip english
oh
this code throw exception
Jacek
Im gonna go ahead and say that it used to be 20
But it could very much have been changed
Such that it just instantly polls incoming packets from netty
they both will, but first one throws an ArrayStoreException and 2nd is compile time error
And update the client as fast as possible
is there some way for nms entities not to spam this?
I believe that might have to do with a death method in the entity
You could override it probably
its because they are named
Yeah
Treated as special (owned)
thing is that I sends about 10 sound packets, 10 particle packets and 10 Material change packets per tick and sometimes sounds packets are lost
only the sounds packet
so It might be cost by minecraft sounds engine limitation?
The client might be limiting it?
yeah or could be intentional as well
To avoid earrape if latency were to occur
?paste
that sounds bad because i'm working on piano plugin
here is OnNotePress code, could I even futher optimaze it?
@Override
public void press(int id, int velocity, int channel) {
final var soundLevel = volume/100.0f * (velocity) / 50.0f;
world.playSound(particleLocation,
MappedSounds.getSound(id,pedalModel.isPressed()),
SoundCategory.VOICE,
soundLevel,
1);
world.spawnParticle(Particle.REDSTONE, particleLocation, 1, options);
if (isBlack)
setCustomModelData(PianoKeysConst.BLACK_KEY_PRESSED.getId());
else
setCustomModelData(PianoKeysConst.WHITE_KEY_PRESSED.getId());
isPressed = true;
}```
It would seem that Maven is always playing this game of not putting ItemsAdder inside the shade of the Jar... It seems to me that with these same settings, the last time it went, after a while I redone the build and nothing to do... Restart the PC? Reboot intellij? Invalidate caches? I tried, all three ways.
Pom.xml: https://paste.md-5.net/dasiqegevi.xml
- cache everything that’s possible outside to reuse it later
- use cached nms objects directly
- dont send packets async if u do that
Since they will get synced anyway
- done 2) how does it works? 3) done
you can cache the player connection of an nms player for instance
And directly send a packet
thats as far as I would go
But this would only have a useful impact if you’re scaling the shit out of your server
Which you most likely arent
yes I do ;p
Also for instance
ok then go to deal with NMS, thanks for help
Dont have the variable sound level there
Because it pushes a variable to the thread stack
Which is costly
ye but key can be press lower or stronger
Assuming you wanna really make it fast now
this plugin is connected with client that sends notes from real piano
the scope is literally "provided"
I wouldnt normally tell you to skip explanatory variables
But cutting edge companies sometimes do this to reduce overhead
so, I should set the scope to compile, thanks bro
or just remove the scope because compile is the default
right
thanks
what do you mean?
Add a comment that explains what volume * 100/ … is
Instead of having a variable
As you wanted to make it faster
dev.lone.itemsadder.api.NotActuallyItemsAdderException: Error: ItemsAdder does not seem to be installed. This is just the API reference, not the actual implementation.
ok
api-itemsadder
did you buy the plugin?
yep (unfortunately)
did you put it in the plugin folder of your server?
sure
that error seems to disagree
bruh did this really become a meme?
Maik you are shading the api
You should not do that
As god cipher pointed out I believe
XD there is even a command for that?
Simply alter the scope to provided
If I don’t, he says it can’t find the class
same
Well then you dont have items adder installed?
so you probably have to depend your plugin on itemsadder
That also ^
Soft
I was making a scheme of this kind and for that I can not force to use itemsadder
item:
itemsadder: true
model: 'potato'
default:
displayname: ...
Ive solved
thanks Elgar for reminding me not to have put in the plugin itemsadder
thank you all guys

@ivory sleet and what do you think about consuming data from websocket? https://pastebin.com/RugmxhfC
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Is it possible to change the walk speed of a player while he's in air or has no gravity
I have given him max walk speed for something but whenever he jumps it's back to normal while he's in air
declaration: package: org.bukkit.entity, interface: HumanEntity
Idk hmm
Not very much code
what have i started...
even forgot to check nullability of first and decreasing size
😢
Nope
Walk speed is more like ground speed
how to get the entity that the player looked at?
You can probably ray trace
oof got it
hmm yes
NBT data lost when a player is no longer OP [MINECRAFT 1.19]
I recently created a server with friends with some plugins to integrate shops ect, including the purchase of custom spawners (golem sheep cows ect ect) Spawners purchased by non-op and non-creative players lose their NBT tag (they turn into basic spawners, i.e. pig spawners) I don't know what permission to add using the LuckyPerms plugin to authorize players non-op to place custom spawners, I searched for several hours on different topics without ever finding concrete solutions, if you have the slightest idea I'm interested, thank you!
what happens when bukkitrunnable is completed / canceled? does it stay in memory or is it deleted?
lol
How come when I right click an entity with my custom spawnegg it calls the interact event but when I cancel it still uses the custom spawnegg?
other plugins uncancelling it?
I guess its because I need to use PlayerInteractEntityEvent instead of PlayerInteractAtEntityEvent
but the event still gets called which is weird
.̷̨̡.̷̨̡.̷̨̡.̷̨̡.̷̨̡.̷̨̡.̷̨̡.̷̨̡.̷̨̡.̷̨̡.̷̨̡.̷̨̡.̷̨̡.̷̨̡.̷̨̡
Ẅ̷́̕h̷̽̽ỹ̸̙ ̷̎͘ȃ̷̽n̵̋̾d̶̾̅ ̴̀̽h̶͛͑o̴͉̎w̸͂̎?̸̈̏
🥲
𝔗𝔥𝔦𝔰 𝔡𝔦𝔰𝔠𝔬𝔯𝔡 𝔭𝔩𝔲𝔤𝔦𝔫 𝔦𝔰 𝔮𝔲𝔦𝔱𝔢 𝔲𝔫𝔫𝔢𝔠𝔢𝔰𝔰𝔞𝔯𝔶

