#help-development
1 messages · Page 1632 of 1
uhhhhhm
The method register(CommandMap) in the type Command is not applicable for the arguments (ListLocations) i tried casting it to commandmap to fix the error at first but now i'm getting this runtime one
oh i know. they said it was
yeah, you gotta have a parent server
I think they were thinking about putting the plugin on the server thats restarting.
What exactly are you trying to do?
yeah that is what wont work
not necessarily but sure
What is the Zombified piglin entity Called in 1.17 I was looking at the docs: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/package-summary.html and only found PigZombie Which is not it.
declaration: package: org.bukkit.entity
PigZombie
i assume
this thing apparently i'm supposed to register it a different way but i'm not used to it so i don't quite understand it yet
Thats great!
i swear ur having a bet lmao
thats a zombie hoglin
hmm
¯_(ツ)_/¯
I don't play enough mc to know this anymore
I tried it already for some reason it doesnt work
i mean never heard of a zoglin so idk lol
not sure then srry
Zoglin is a zombified Hoglin
Pretty sure PigZombie is the right one. What is it if not a Zombified Piglin?
yeah pigzombie i think
took like 2 clicks to find
wdym as in a normal piglin?
PigZombie zompig = (PigZombie) event.getEntity();
ItemStack TerribleHelmet = new ItemStack(Material.LEATHER_HELMET);
TerribleHelmet.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
ItemStack TerribleChestplate = new ItemStack(Material.LEATHER_HELMET);
TerribleChestplate.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
ItemStack TerribleLeggings = new ItemStack(Material.LEATHER_HELMET);
TerribleLeggings.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
ItemStack TerribleBoots = new ItemStack(Material.LEATHER_HELMET);
TerribleBoots.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
ItemStack KbeStick = new ItemStack(Material.STICK);
KbeStick.addEnchantment(Enchantment.KNOCKBACK, 50);
KbeStick.addEnchantment(Enchantment.DAMAGE_ALL, 5);
zompig.getEquipment().setItemInMainHand(KbeStick);
}``` This is also in a creature spawn event listener
oops wrong formatting
use entity instance of will be easier
nande kore wa??!
@tame elbow
im back now
okay will test
who knows ¯_(ツ)_/¯
m- DevCow, would i have to cast the instance of the listlocations class to a commandmap? i have an error with and without is and i'm not sure how to fix it
is it a bug that every time you milk a cow it has a new unique id
what is the error?
Smol now
if i hover over the register which is underlined in
getCommand("listlocations").register(new ListLocations(this));
i get this one annnd i might take a bit to get the other from the terminal
The method register(CommandMap) in the type Command is not applicable for the arguments (ListLocations)
if you use getCommand("CMD").setexecutor(new CMDCLASS());
no
i would use
getCommand("CMD").setexecutor(new CMDCLASS());
only use commandmap if you have a custom coded command map too add
yeah why r u using register
l have a custom command map for all my commands
but you are just trying to register a command
ohp, sry, i was a bit confused
it only cause i have over 230 Commands in my Core
jeez yeah that would make life easier
imagine having to put them all into the plugin.yml id rather not
im under going a recode for 1.17 tho
lmao plugin.yml like 3gb
so its gonna get fun 🙂
yeahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
such fun
ive decided too add a modular System andd add like custom chat and plugins for all gamemodes 🙂
so im looking for too my new project
fancy
Yeah
does not work still... ```if(event.getEntity() instanceof PigZombie) {
PigZombie zompig = (PigZombie) event.getEntity();
ItemStack TerribleHelmet = new ItemStack(Material.LEATHER_HELMET);
TerribleHelmet.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
ItemStack TerribleChestplate = new ItemStack(Material.LEATHER_HELMET);
TerribleChestplate.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
ItemStack TerribleLeggings = new ItemStack(Material.LEATHER_HELMET);
TerribleLeggings.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
ItemStack TerribleBoots = new ItemStack(Material.LEATHER_HELMET);
TerribleBoots.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 10);
ItemStack KbeStick = new ItemStack(Material.STICK);
KbeStick.addEnchantment(Enchantment.KNOCKBACK, 50);
KbeStick.addEnchantment(Enchantment.DAMAGE_ALL, 5);
zompig.getEquipment().setItemInMainHand(KbeStick);
zompig.getEquipment().setHelmet(TerribleHelmet);
zompig.getEquipment().setChestplate(TerribleChestplate);
zompig.getEquipment().setLeggings(TerribleLeggings);
zompig.getEquipment().setBoots(TerribleBoots);
}```
i think the part im most looking forward too is working with PAPI
send me all of the code and ur main class
but use
?paste
whats the problem
oh that will be fun
Yeah
what would be a use of placeholders tho
i use themm for tab and scoreboard
idk what game modes ur working witth lol
oh true
custom tags and stuff
also would probably be useful in configs
idk
as i make a custom score boards 1 for Normal player 1 for Donors and 1 for each staff rank display certain infomation
yeah rank stuff
idk for now im chill with luckperms xd
mostly cause mysql
plus it help cause im use LP to make a grant system through GUI like GrantX but making it so there can be more edits made
ah i see
so perms gui
TBH ive used LP since it came out and im happy with it
same here lol
it just kinda works
also i couldnt live without the web editor
it works for everyone even if your new too development his documentation is amazing
all it's doing now is printing [], i'm back to square one ;-;
easy to understand
rip
Hmm
you want me too take a look at your project and fix it for you Smol
i- i would be grateful if you did
dm me it
ty ill take a look
ill take a look and send too you what i fix ed 🙂
top one is main bottom is listeners
ye i got it lol
whats wrong?
so is it just not giving them the armor
when spawn
well your missing the omport org.bukkit.event.Listener
or is it contracted
must be lol
idk what im on about
its there
oh here is your problem
if(event.getEntityType() == EntityType.ZOMBIFIED_PIGLIN { missing closed bracket
for the if statement
i have that in eclipse i just miss typed it
wdym?
okay
wait why are you using getentitytype
idk if that works
try getEntity().getType()
I know it works for other mobs in the plugin
this works for a regular piglin
and there isnt any console errors?
and its def defined in main class?
and also make sure it has @brave glenHandler
oops
uhh
okay nvm was just a person
well make sure it has @ EventHandler
oh
@quaint mantle show me where they said
start reading from here
Kid
“Change a hologram”
@tame elbow ur missing a closed curly bracket
it’s a placeholder
where?
Its there in eclipse
bro why is ur paste so diff to eclipse
resend it exactly the same
also eclipse would throw me the error if it was missing
copypaste
?paste
the other code works so i wasnt going to send it
why so many missing lines
This honestly looks like a horrible approach ehh
is that just the paste
whats with the semi colons
please format that
after closed curly brackets
lmao
omg
that was auto generated by eclipse i think
then switch to intellij
you wont regret
my original qustion was if there was a different entity identifier for zombie piglin besides pigzombie
but this very useful
I did some research i think that is the zombie pigman identifier
i dont think so
eclipse is ew
agree
i got github dev pack and intellij ultimate is epic
doesnt vsc have the same thing?
?paste
oh okay
The problem I'm facing is that there isn't an error in the console
it just doesn't do anything- I know the ItemStack works because if I don't have anything in my main hand, it will have an error.
yeah you should probably add a null check for that
but doesnt matter
so it doesnt give the attribute ?
it doesn't give it yeah
np
I improved it ```java
@Command(aliases = {"link"})
public class CommandLink {
private final DiscordLink plugin;
public CommandLink(DiscordLink plugin) {
this.plugin = plugin;
}
@Default
private boolean link(CommandSender sender) {
sender.sendMessage(plugin.getLocale().getElement("link.example").set("player", sender.getName()).info());
return true;
}
@Command(
aliases = {"subcommand"},
userOnly = true
)
private boolean subcommand(CommandSender sender, @Choice({"coffee", "tea"}) String drink) {
sender.sendMessage(plugin.getLocale().getElement("link.example").set("player", sender.getName()).success());
sender.sendMessage("You like " + drink);
return true;
}
}
i am proud of this lmao
🤡
lol nice
it works on fabric too
brigadier support soon
@quaint mantle hey nice seeing you here too LMAO
Mi no espanol
currently in a priv vc, in like an hour i prob can
https://i.kawaii.sh/BN~0ut1.png i have too many classes like this lmao
🤡
I write really complex code that works at 2am and need to clean it a day later but keep it working
"Fuck you too, Java!!!"
God tier comments
Have you seen source engine comments?
It gets more hectic as you progress
Honestly if you make debug UI in any game just use dear imgui, do not bother making your own fucking table element
For menu UI thats fine but like bruh moment for debug uis dont bother
you are in java so you kinda have to i think
imgui has no bindings does it?
I just use ImGui and make a terminal tab on the top that rises from the top of the screen
and some draggable windows you can toggle with F keys or menu bar on top
but Imgui did 90% of the work for that so yeah
For my AP Computer Science assignment i had to use java but was burned out for video games and lwjgl was not helping so i did this https://github.com/Riku32/Chippy8. This is how i learned to never do emulation in java
🤡 java has no unsigned 8 bit type
We live in a memory leaking universe
that is why it stretches
I was using Swing but uh when i made it i was using linux and Qt did not mix well with Java
so it looked really fucked
so i made it look the same on all platforms
also was lazy so that code uses lombok, excuse that please
I do not use lombok on anything i will actively maintain in the future
not sure but there is no 8 bit type
a regular char is 16 bytes since its unsigned
so it was difficult to emulate number looping since i was emulating a form of binary and overflow is normal in most ASM
so it something goes to 257 instead of 0 big problem
yeah thats what i did
That is very not ideal
well its the only thing you can do if you are using java for it
Mhm
i had to use java cuz assignment
I wonder why java doesn’t have unsigned types yet
Tfw this is what the add instruction looked like for adding one register to another
// ADD Vx, Vy
private void op_8XY4() {
// VF is set to 1 if the result was greater than 255, otherwise 0
byte sum = (byte) (V[opX()] + V[opY()]);
V[15] = (byte) (((sum & 0xff) < (V[opY()] & 0xff) || (sum & 0xff) < (V[opX()] & 0xff)) ? 1 : 0);
V[opX()] = sum;
pc += 2;
}```
🤡
emulation moment
That’s gonna be a yikes from me
I mean it wont look nicer in C++, maybe a few less horizontal length
Looks like decompiled minecraft code
Thats emulating an instruction that a CPU is supposed to do
basically emulated a chip8
setting opX is the first argument so you are setting the register of the first arg(index) to the sum
and the second thing sets the 15th register to something(i forgot) if the sum was something
but yeah thats how the CPU works
pc += 2 adds 2 to the program counter which is also a register and 2 is the size of a normal instruction so it skips to the next instruction to emulate
but some instructions skip more than 1 or just jump so pc += 2 is not ALWAYS the end of the instruction
how do i do this?
public static Map<World, List<Location>> rtpLocations = new HashMap<>();
...
rtpLocations.forEach(list -> new ArrayList<>());
i dont really understand the for each yet, tho i guess a map is not an iterator, can i achieve that with a oneliner?
i want to replace all list of locations on each entry of the map, with a new empty list
idk what a BiConsumer is
like this? rtpLocations.forEach((key, list) -> new ArrayList<>()); will it keep the same keys?
Wait what are you trying to do
yea i know what a lambda is, but idk if i can use that with maps
The difference however between map and list is that one has two args, and the other has one argument only
because list passes consumer
^
map.forEach((k, v) -> );
put whatever after the arrow
i have a map of worlds, each entry has a list of locations, i want to remove all those locations, and put an empty list in each world
so the keys will be the same?
is my computer autocorrecting
rtpLocations.forEach((world, list) -> rtpLocations.replace(world, new Arraylist<>());
^ this
lambdas itself are fast
it gets compiled to the same result and there isnt much of a difference im pretty sure in hotspot anyway
faster than anonymous classes
cause it uses invokedynamic
and saves computation space/time
so, the return of the lambda will not be stored in the current index of the map?
nerd mode activated
hotspot(best java compiler/runtime) optimizes streams and foreach
it should be the map method, right? if there is one
oracle uses hotspot builtin
The OpenJDK is a project under which an open source implementation of HotSpot (and many other pieces of the JDK e.g. compiler, APIs, tools, etc) is developed.
pogger
tbh the performance decrease anyways regardless of the compiler for forEach is negliglble anyways
it doesnt build up that much tbh
lol
i dont use forEach BUT i do like streams actually. They are useful when you need to filter out/change the results
yep
I don't hyperoptimize i just optimize normally and use common sense when writing code and optimize more heavily later
@NotNull
public static Optional<String> getFirstResultVideo(@NotNull final String query)
throws IOException {
try (final InputStream in = new URL("https://www.youtube.com/results?search_query=%s".formatted(
query.replaceAll(" ", "+"))).openStream()) {
final String content = new String(in.readAllBytes(), StandardCharsets.UTF_8);
final int start = FastStringUtils.fastQuerySearch(content, SEARCH_KEYWORD) + 10;
return Optional.of(content.substring(start, content.indexOf('"', "videoId")));
}
}
Find first video on youtube with search query
without api key
Poggers
for anyone who has no idea what void* is its basically Object
could be anything or could be nothing
Yeah its a pointer
Honestly C++ is just better than Java sometimes lol
its a pointer to data of ANY type
C++ is better than java most of the time
Mhm
Who in their right mind decided to code a game in java omfg
WHIRVIS DID LMAOO
Use microsoft java instead plz
I agree kotlin is nice imo, functional good but i use java anyways just because more people know it
Kotlin is nice, most of my co-workers are frothing over it
Trying to convert our systems from java to kotlin
is there an event for when users hit a hotkey to swap inventory items
The thing about Java vs C++ is that its a bad comparison. You can write code in C++ and Java and if you arent paying attention in C++ your code will perform worse than Java
Just use smartpointers for everything
Java has lots of features like annotations and runtime reflection and all types of cool stuff like easier dynamic loading for mods/plugins. C++ dynamic linking aint got shit on that but it is faster if you do it right
easy peasy
This is a stupid statement
😛
Use regular references on everything and use smart pointers when you NEED them
general would be worse for this lmao
smartpointers are ref counters, you dont need refcounters most of the time
I am aware dw, just being a pea brain
yup seems right, thanks!
Yeah dont worry but like ive seen plenty of code with just random smartptr and uniqueptr and other shit EVERYWHERE they pass data
it just annoys me
Trust me I have seen it too
actually ya
I come from a game development degree background and I had to work in groups of people that did that
I forget the specifics but it's when you hit 1 and swap the item you're holding. somehow a player use that to put items into an inventory we use for UI
I wrote a game for the PS4 Library in C++
Anyway bottom line java and C++ have different uses and you shouldnt use one for everything. (Tfw nodejs is what people use for webservers but the main processing is only handled on one thread and all async is is just a queue that functions get added to when they are called so promises/async are a lie in JS)
🤡
This is why i use Rust/Go for servers
I could use Java but i do not
Nah C++ is good if you use it right but i agree boost is horrible i will never include it
What is boost? I have never touched it
I do replace some of the STL like i use parallel hashmap instead of hashmap
https://github.com/greg7mdp/parallel-hashmap
but i never use a one for all solution
LMAO IT DOES
poor dude
I just use the native libraries
Planning on making a game engine completely done with Data Driven Design in mind.
Use C++ but write it all C style and use C++ purely for data classes and features like vector
or when classes make more sense
if you are going data oriented this advice will help you A LOT
if you follow it that is
I well keep that in mind thank you!
how do i download this
☝️ 😩 ✋
how can i start learning plugins?
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.
Learning java will also save you from looking like an idiot
lol ya
And save you from a lot of frustration that you would face if you just try to monkey your way through it
call me noob idc but someone send me example of how tf to use mongo in my plugin
I mean depends how your data is handled.
https://www.mongodb.com/developer/quickstart/java-mapping-pojos/ I recommend looking into this
Easy data serialization
hey so I have this code
public void JoinMana(PlayerLoginEvent event) {
Player player = event.getPlayer();
boolean hasPlayed = player.hasPlayedBefore();
if (!hasPlayed) {
Mana.setMaxMana(player, 100);
Mana.setMana(player, 50);
ManaRegen.put(player.getUniqueId(), 2);
player.setHealth(10.0);
System.out.println("test");
}
setMana(player, CurrentMana.get(player.getUniqueId()));
}```
and it's applying everytime
so i checked by adding
System.out.println(player.hasPlayedBefore());
and it returned false
any ideas why player.hasPlayedBefore() is always returning false?
Although I am not sure what exactly causes this problem, but I think it is recommended that you use PlayerJoinEvent for this, see if it yields expected results.
Apart from that, it is a convention for method names to be in camelCase
I assume you have deleted all player data files
Well then they have played before
shouldn't affect
What is with that setMana function after the if condition scope?
yeah and even if it did its on online mode
I’ve definitely used it in the PlayerJoinEvent before
weird idea I had before i released it was another thing
I thought i wasn't saving it properly
OH WAIRT
NOP
IT ISNT
when they first join the server I want to set their mana to something
no clue why i said what i said first
oh wait after the scope
yeah i can
but the issue is also that its always saying they havent joined before
when i can see my player data file right there
My guess is that it's not set until after PlayerLoginEvent fires.
So if you use PlayerJoinEvent, it'll probably be true.
he tried using PlayerJoinEvent tho
Why the ?
its not fully doing what i wanted but thats on my end
in which method should I create a scoreboard?
hi can you make me a plugin for free?
good gif
not a bro, sorry, I'm just practicing) I switched from C# to java about 3 days ago
ok np
w
pretty much
can you make me?
bro
this isnt a place to ask for commissions
no one is gonna make you a free plugin
this is help-development
Yes, they are the same, but you still won't learn how to create plugins in one day
go to the spigot website and search for what you need
there is not
mm
can I show in dm
no
why?
tell us here
guys its not worth your effort
ok
https://www.youtube.com/watch?v=7FM-qWtMWk8 here watch this video I want the dragon in this video
no its plugins Ig
tf is a netherite dragon
thats mods lmfao
? please help me) I really don't know yet.
why do you want this anyways
google it lol
its easy
I wanna play it
its a uhc
bro i legit repsonded to a certain person why are you responding to me
I didn't find what I needed.
what makes you think you can play it if you have the plugin?
alr what do you need? ill try help
but the uhc is over
aldready
now I cannot play
regardless of that, nobody's going to make it for free
@slim owl Learn java & forge and make it yourself
- it's a completely different model
meaning probably an animated armor stand u can ride lol
this guy is on another level with ideas
sheesh
its mod
not necessarily
eh
its defo a mod
what time
all throughout
i mean
you know what I mean'
Ik but can anyone make it for free
no
no
you shut up
regardless, all of that is definitely possible with plugins
ur the one asking for free slavery
I will my choice
shit's all plugins
you are noob
L
if you are over 7 i actually give up on humanity
you don't even know how to mine dirt
@slim owl nobody here is going to make that plugin for free as it requires custom models and a custom minigame
and again, this is not the place to ask
so say calmly
@crude charm ur not helping xd
like here
and here
rightyo then
think they are gone, maybe ran out of patients
wawt
wait
patience
i can spell
shh
auto correct, mhm
shhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
anyways
who actually needed help and didnt just want a enderdragon and free labour
so im trying to use the task scheduler inside of an event handler, but it requires an instance of the main class, how to I get the instance of the main class to be passed into the event handler.
getServer().getPluginManager().registerEvents(new BlockBreaker(), this);I have this inside the Main class, so it should be passing itself through via "this", but i don't know how to access it in the blockbreaker class
it says plugin is undefined. and i cant reinitialize the Main class by redefining it so idk what to do.
Bukkit.getScheduler().runTaskLater(plugin, () -> {}, 200L); this is in my blockbreaker class
but plugin is undefined
Pass it though the constructor of the event class
you can do a static getter
Main.getInstance()
I thought static variables didnt work with task schedulers
Dont see why not but if they dont, do this
hey what could I use to uniquely identify a custom item? like some tag called "BUILDERS_WAND" or smth idk
(I also want the identification not to rely on lore/item name)
Persistent data
declaration: package: org.bukkit.persistence, interface: PersistentDataContainer
Ah ty
got it thank you @young knoll @narrow vessel
or nbt tags
is that possible without api?
also how do I check if has persistent data
i almost guarantee im doing this wrong lmao
;-;
yes
your key needs to be lowercase
otherwise that should be fine except for the nullpointerexception youre gonna get if you try getting the persistentdatacontainer off of a item with no meta
yeah ill add a null check just figuring out basics
although it doesnt seem to be working
is the problem here?
i dont think so
huh
idk then
ill do some research
wait nvm im just that intelligent
i forgot to add event to main class
lmao
but youre checking for equals(”BUILDERS_WAND”) but you set builders_wand
use == over equals() btw
nah i updated that all good
for string?
your IDE is literally telling you that
my ide corrected me when i did == first ;-;
anyways it works
oh wait its probably screaming about nullability
Strings should be compared by #equals
yeah
shh
thats what i was thinking🤔
== just checks if both objects have the same adress in heap
and since Strings are immutable it will be false if you are not comparing a String with himself
so it would make sense to use == here right?
yeah. enums should always be compared by ==
this might be a stupid question but how do I prevent "double clicking" when right clicking a block with playerinteractevent
no question is stupid. PlayerInteractEvent is called twice. once for each hand. check for the hand and if its the off_hand return
ah okay thanks
Hi, I've been having trouble with the Chat Component API. I have a TextComponent that looks like this:
TextComponent mainComponent = new TextComponent(String.format(event.getFormat(), player.getDisplayName(), ""));
but its converting all the hex colors in my display name to legacy. Is there an alternative to the TextComponent above to keep the hex in my display name?
is there a way to get a true or false on weather or not a block will drop items based on the tool it is being mined by?
How to show a loading screen to a player if chunks are still not loaded for that player
for eg: If I am connecting to my server, some chunks are still yet to load for me, so I want a loading screen to show for me until chunks are loaded
use vector
?jd
I'm have successfully registered a custom dispenser behaviour, but whenever I try to use some of the nms classes as alternatives within the behaviour https://paste.md-5.net/afaxopufam.cs (line 15), I get the following message on dispense and server crashes, even after remapping: https://paste.md-5.net/veqakezaki.bash. Any idea on why some classes are absent during runtime? Or rather some methods are not remapped correctly?
targetVelo#subtract(zombieVelo)
maybe because you set 'ignoreCanelled' to true, and then try to invoke it?
just try to set @brave glenHandler instead of @brave glenHandler(ignoreCanelled = true)
you should use == instead of = in if statements, in any other place use only one =
but you can also use .equals(object)
since when can you use = in if statements
Not really
the oposite
wha-
He asked about ==
its still gives same error like the picture above, i've deleted the ignoreCancelled
anyway
getNearbyEntities(5,5,5) would return entities in a radius of 5 blocks each direction?
Not exactly radius

(5,5,5)-cube
Ok thx
How to get strings from paper.yml
Nothin is round in minecraft
Just searched, nope
k
?paste
by using spigots IO api?
@tacit dagger and you should make your code shorter ``` @EventHandler
public void onPlayerManipulationArmorStand(PlayerArmorStandManipulateEvent event) {
ArmorStand armorStand = event.getRightClicked();
if (armorStand == null)
return;
if (armorStand.isValid() && Stream.of("purifux", "dahlia", "spiritfux")
.anyMatch(n -> n.equalsIgnoreCase(armorStand.getCustomName())))
{
event.setCancelled(true);
}
}
what is line 17?
its disabling right clicking on armor stand
this code is working not showing the error, but its not prevent player from taking the item from that named armor stand
maybe i misspeled the name of armorstands
ohhh i got it
lemme try that
to make sure your armor stand has name, run code Bukkit.getConsoleSender().sendMessage(armorStand.getCustomName());
its fixed now, tysm
the problem is, i registered the player names who placed that armorstand, so its not detected on that code
TYSM
ah so this is the point
so your idea is that, players who placed armorstand will not allowed intereact with it?
its an custom orb, so player can place an orb and then it will spawn armor stand which is gives the player buffs, but there is a bug, player can take the item from that custom armor stand
its already fixed now, thank you so much for helping me😄
@tacit dagger I guess this is ultimate solution
thank you for the another solution, i'll try that too 😄
the armorstand cant be null
also by refering to null you are not creating an armorstand
your method name is misleading
make your hashmap final
this method is pseudoCode
sure my bad
is there a way to make sure world.spawnEntity(location, EntityType.ZOMBIE) doesnt spawn a chicken jockey or a zombie with armor or tools?
what JDK should i use if i want to build plugin from 1.13 to 1.17?
Should i just use the 1.8?
it will never. The spawn entity method does not take random zombie configurations into account. This doesn't mimic vanilla zombie spawning, rather just creates a normal zombie without any modifications
?paste
https://paste.md-5.net/gesokofoxu.cs
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.getKeys(boolean)" because "section" is null
Why is section null?
is your config empty?
so there you have the issue
is there any way to not have the plugin fail if there are no locations?
null check the section ?
exceptionhandling?
ok
the section shouldn't be null
huh ? Yes it should
if your config is completely empty, you cannot get a section for something that doesn't exist
What is this error?
I null checked it, my locations aren't getting saved however
Invalid ArtifactId. Spaces in name
I've done some testing and this doesnt seem to be the case
it's spawned several zombies with shovels and swords and a chicken jokey for me
- there should prob be more than 1 of these channels but
- i have this command that sets a players .setDisplayName(); but im working on a way to reset to the original username but idk how to
how do i get the original username of a player entity
player#getName()
oh its that simple? thx lol
dc bot?
i just saw it lol
Welp you are right
let me check if this is a 1.17 issue
Welp, seems like you don't have much of a choice o.O
actually surprised this is called in the first plce
tbh pretty useless to randomize spawned entities by default
so i have to mess with nbt then
awesome
and check for passenger
the passengers doesn't exist on spawn
What is the best way to save data? Letting server owner know, to gracefully shut down the server, and listen for the onDisable event, to save all data to files? Or have a seperate command, for just saving my plugin data, and make it run that, both as a command and onDisable so it can be ran manually.
Also maybe even automatic saving every couple minutes to not loose too much progress?
so how do i know it's a jockey o_o
whats a jockey
baby zombie on a chicken
oh. delay it.
there is no best way. i personally prefer saving data at leave, disable and in an interval
Isn’t a skeleton on a spider?
those are spider jockeys
legenden what type of data?
so at leave, is that saving the specific player data for who left? and disable and interval is just a save all data?
Hm fair
the others are technically called chicken jockey xD
still trash that the API spawns them
makes no sense whatsoever

oh and did you check if it's a 1.17 thing
The code to cause this is there on 1.16
I am currently creating a test plugin to validate
after that I'll open an issue on spigot for it
yeah
alr ty
thx
Usually you save cached data on shutdown, you could load data on enable. But if it’s player data then just load on the prelogin period and cache it and on disconnect unload from cache and save. Yeah a sync task to sync data might not be a bad idea.
It's actually not much player data, it's just storing some identifieres for completed and ongoing tasks.
What version? You could probably use the persistent data container api if it’s spigot to avoid handling the data management yourself.
1.16.5
Oh dang, maybe I can actually, to save the need of creating a json file, just for storing player data. And only keep the quest files
Hey, is there any event related to bonemeal?
Hmm, so incase I want to store a list of strings under one namespace, is taht doable?
Not sure how the Tag container works, or if possible to store an array of Strings
I think the author of the post actually provides an example implementation for a PersistentDataType<byte[],String[]>
lol
"the author"
tbh pdc are rly easy
Yes, structure grow event
Yes xD let me be 😅
I think that's the case, but you can use Conclure suggestion as well
don't get me wrong. ur tutorial is extremely useful
i learnt pdc from it
and now i use pdc in almost every plugin i make, until ppl started telling me not to lmao
oh sweet xD Yea the biggest issue with PDC is getting your namespaced keys around 😭
Well, if you are storing database things in the PDC you are doing something wrong
How can I copy defaults to the config using BungeeCord?
My class: https://pastebin.com/P3555uKz
This can be performed with a dispenser
But what if there is no plants when the bonemeal is used?
BlockFormEvent maybe
BlockFertilizeEvent also exists
Also BlockDispenseEvent (:
Check jd
?jd-s
Can you guide me to setup Eclipse IDE (PHP) with Pocketmine?
pocketmine is not spigot
Hello! Is it possible to send a boolean from the onDisable to a js file? I'm trying to make a addon for the plugin spicord, and it uses js to send messages and run commands
yes it is but you also could just https://tryitands.ee/
Anyone knows some library or API for auto config updating?
People just usually use config versions
Or some opensourced project with that feature so i can learn something
Then, on every update, they update it
You can have a github repo with the latest config version but it will always just reset stuff
I could just take resource file with the same result
this didnt work btw
getName is the same as getDisplayName
no its not
Has anyone on paper ever used the component system? https://jd.adventure.kyori.net/api/4.7.0/net/kyori/adventure/text/Component.html
declaration: package: net.kyori.adventure.text, interface: Component
getName returns the base players name without any modification
Looks a lot like the bungeecord chat api component system
adventure = paper, not spigot
Yes but there is a lot of stuff that differs, there' only interfaces
yes
You are looking for help on a paper only item. You need to ask in the paper discord.
it's not wrong
but that's true
How do I import a public method in js? i cannot find anything related on stackoverflow
is the normal protection enchantment called protection environmental?
@eternal oxide the plugin does not work, and there are no errors in console or IDE lol
what?
I think he's trying to make plugins in js
how do I get a string
or boolean
from java to js
or a public class
from java to js
Doubt anyone here knows
?paste
I'm getting a warning "Malformed recipe for cow" which i dont know why
none of the stuff in my code are null
so..why?
the config is
recipes:
cow:
itemStack: COW_SPAWN_EGG
matrix:
- DDD
- SSS
- DDD
order: DS
items:
- DIAMOND_SWORD
- STICK
do you want to translate your code or to have java AND js code?
or do you want to have java & js to communicate with each other?
Ah you're making a Discord bot, why not use one of the Java implementations available?
its an addon
to a plugin already made
so either you have to jump to java
or you will have to let them communicate with each other
communicate
How can I copy defaults to the config using BungeeCord?
My class: https://pastebin.com/P3555uKz
so you will have to work with sockets, redis, restful or any other communication/connection tool
is that the only way?
and send them JSON objects
most likely
i have got functions linked
the onstop one is just broken
onstop is the one that should be transmitting the boolean
the eventlistener file
^
h e l p
Try using get list instead of reading arrays
How can I make the no permission message in the plugin.yml configurable in another file?
Do I have to check for the permission in the command itself?
will that really matter
why did you change from arrays to lists?
Well the config is a list not an array so try it
what
hm?
change it back to an array as you need it as an array in teh end anyway
yes you did
in your yml you changed it to a List
server doesn;t change the yml unless you tell it to
[]
not in the yaml you posted you don;t
uh ok 1s
bro
it changed it again
do i record a video to show you
it legit changed itself wtf
then you are telling it to save
you should only saveDefaultConfig() in onEnable
mhm ok
sender.sendMessage(messages_prefix + config.getString("messages.xget.must-be-player").replace("&", "§"));
Why can that statement not access the message under xget?
It's so weird, it works fine with every other command
that up there is a config
and im trying to access it
but it doesnt work with the xget
OOOH
theres a " missing
brackets doesnt show that lmao
Is there a way to stop items from stacking rather than adding random UUID to their persistent data container?
Then check what is null
on all recipes?
show the recipe
1s
recipes:
cow:
itemStack: COW_SPAWN_EGG
matrix: [DDD, SSS, DDD]
order: "DS"
items: [DIAMOND_SWORD, STICK]```
now paste teh actual code you ended up with
change the malformed message so you know what one its coming from
o
not with any precision
you can limit the onMove to only trigger your test when teh player moves to another block
Nothing ig?
use getBlockX/Z from getFrom and getTo to compare
packets
Just as heavy as PlayerMoveEvent
I have a command that requires 2 people and my PC doesn't have enough ram to have a server and 2 minecraft instances open
how do i...test this stuff
yea but then they'll be connecting, i'll send it, it'll say "an error occured", i'll reprogram, comeback an hour later n be like
"Heyyyy can you rejoin"
lmao same
?paste
.bash???
i also added a check for every variable
and im developing a firewall on my fork of bungeecord, its impossible to say "hey could u pls attack my server"
its an error
Use Mineflayer it's more lightweight
looks like its failing to read the arrays
mhm
I was looking for a more lightweight client
maybe thats it
btw
t: [eg, eg, eg] is same as
t:
- eg
- eg
-eg
same thing
anyway
shouldnt we use getStringList
or smth
seeking for a lightweight server
its not, the way I showed is an array, the other is a String List