#help-development
1 messages · Page 1613 of 1
okay, now i am ask. How to unnamed entity before he die
Can you code
If not don't ask here
this is my code
https://paste.md-5.net/edobacoqaf.cs
👆
https://www.youtube.com/watch?v=AD85qcXmKyA
does anyone know what sound this is?
Relaxing sounds to fall asleep to
Subscribe if you want to see more content :)
Join my discord! https://discord.gg/hY2DXNHkNW
this isnt spigot
nvm it is
just very weird
can u just
@Eventhandler
public void onEntityDeath(EntityDeathEvent event) {
event.getEntity.setCustomName("");
}
prob the easiest way @indigo crypt
out of curiosity, what does the # actually mean
and why do people use it instead of .
its a replacement for .
just to make it easier to read
also its used on the docs
also often times people use it to indicate it's pseudocode and as such not every method may be named exactly the way it shows up
still need this :(
OH YEA
How do i properly get Particle from string?
Particle.valueOf(string);
Spigot API particle names differs from minecraft ones
ENTITY_WITHER_BLOCK_BREAK
...yes
Nope its the door one
But can i turn the volume down somehow?
ITS SO LOUUD
Minecraft - HAPPY_VILLAGER, Spigot - VILLAGER_HAPPY
just lower the volume when you play that sound
How?
cant u just make a command and make the tabcompletor have Particle.values()
its on 1
the lowest
it says it gotta be an int
I need it in the config, not in the command
man I was feeling like I was tired of working
turns out, it's been 11 hours already
I still cannot understand whats the purpose of changing HAPPY_VILLAGER to VILLAGER_HAPPY
Sounds like trolling
probably a historical reason
I know for a bunch of mismatched enums it's because mojang changed their own nomenclature as they went but spigot stayed backwards compatible
How do redstone paritcles work
HEY BRO, i know that and i was try it. but entity still have a name
First of all dont call me bro, second why do u even wanna reset the name?
@stone sinew, sorry for tagging but update from the previous conversation. I try to send head rotation packet and get the yaw of the armor stand, it says the yaw is 0, so you're right it doesn't change. I'm using EntityArmorStand#getBukkitYaw
[16:06:35 INFO]: [-29.603943] - [0.0]
[16:06:35 INFO]: [-28.85382] - [0.0]
[16:06:35 INFO]: [-16.403442] - [0.0]
[16:06:36 INFO]: [-358.8537] - [0.0]
third another fix:
@EventHandler
public void onEntityTakeDamage(EntityDamageEvent e) {
if(!e.getEntity().isDead()) {
LivingEntity let = (LivingEntity) e.getEntity();
if(let.getHealth() - e.getDamage() <= 0) {
let.setCustomName("");
let.setCustomNameVisible(false);
}
}
}
Ñ
Set custom name to null not ""
first, I am sorry :D. second, I want clear death named entity log. if the entity has a name, when an entity dies. log showing entity dies. if the entity does not have a name, I think, this is can clear log
before u start coding maybe learn correct english? no offense @indigo crypt
i am sorry about that, i forget install gramarly again
okay, i will try it
Use null instead of ""
oh yea
okay
it work, Thanks. and sorry about my english
np!
Hi, I need help with a plugin.
Can Spigot spawn an alter ego of the player who executed the command?
You mean like a copy of the player?
If that's the case, plugins like Citizens can
I'd recommend hooking in to that rather than reinventing it
https://paste.md-5.net/ihisedoyas.bash
target.teleport(jail_loc);
line 48
help pls
Jail loc is null
surprised how many people can’t read stacktraces
They were literally here for the same thing last night and I gave the same response
But no, they must ask again
you have “.” after both jails and x y z
wait
Then why are you getting a player from it?
Myeah
Can i get recipe from furnace in FurnaceSmelt/BurnEvent?
if someone has a permission like simple, is that part of a permission named simple.complex?
simple is the root perm
So like
you can grant simple.complex
Or simple.*
Which is all children nodes
but it does not contain it?
when its like that?
eh whatever im just going to put everyting in a separate perm
Hi, i'm blocked to make table initialisation, and i don't know why
public static playerball[] tabplayerball = new playerball[16];
public class playerball {
public String playername;
public int timerleft;
}
public static void Tabini()
{
for(int i = 0; i <= tabplayerball.length; i++)
{
tabplayerball[i].playername = "";
tabplayerball[i].timerleft = -1;
}
}
with error
at fr.kokokaz.plugintest.task.TimerBall.Tabini(TimerBall.java:44) ~[?:?]```
please follow java naming conventions
my eyes are burning
and it's a great way to improve ur code aswell :)
also have u tried using a list?
u can't add new items into an array afaik
All elements in the array are null by default
okay, so how can i change this ?
when i try to create new object
like this tabplayerball[i] = new playerball();
i've again error
is it a null pointer exception?
No enclosing instance of type TimerBall is accessible. Must qualify the allocation with an enclosing instance of type TimerBall (e.g. x.new A() where x is an instance of TimerBall).
if I spawn a livingentity using world#spawn() and that gets cancelled by something how can I detect it was cancelled without hooking to the spawn event?
because isValid also triggers if it's in an unloaded chunk
#isDead?
maybe try getting the entity by uuid?
How can I check if a class implements Listener?
java.lang.NullPointerException: null
at fr.kokokaz.plugintest.task.TimerBall.Tabini(TimerBall.java:44) ~[?:?]
at fr.kokokaz.plugintest.MainPlugin.onEnable(MainPlugin.java:13) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:351) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:494) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:408) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.reload(CraftServer.java:881) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.Bukkit.reload(Bukkit.java:651) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:763) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchServerCommand(CraftServer.java:748) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at net.minecraft.server.v1_16_R3.DedicatedServer.handleCommandQueue(DedicatedServer.java:387) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:356) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1008) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:847) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot.jar:2991-Spigot-018b9a0-f3f3094]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_301]
Class TimerBall
public static playerball[] tabplayerball = new playerball[16];
public class playerball {
public String playername;
public int timerleft;
}
40- public static void Tabini()
41- {
42- for(int i = 0; i < tabplayerball.length; i++)
43- {
44- tabplayerball[i].playername = "";
45- tabplayerball[i].timerleft = -1;
46- }
47- }
Class MainPlugin
11- @Override
12- public void onEnable() {
13- TimerBall.Tabini();
14- getCommand("pstart").setExecutor(new Commands());
15- getCommand("pstop").setExecutor(new Commands());
16- getServer().getPluginManager().registerEvents(new PluginListeners(), this);
17- }
Quelqu'un serait m'aider ? c:
connection ?
What's the fastest way to find and manipulate the first empty slot of an inventory
fair but i got a different issue now...
Is there a simpler way to check if there's a shulker box in an inventory than this
for(ItemStack itemStack : shulkIV){
if(itemStack == null)
continue;
if(Tag.SHULKER_BOXES.isTagged(itemStack.getType())){
return true;
}
}```
im just gonna assume no
inventory.contains
and there is a method with returns the first empty slot as well
at this point I'm just checking by checking if the return of addItem is empty
also issie with contains
cant check for the 17 materials that make up shulker boxes
Anyone knows how to teleport player while having a passenger? I've been trying to use client side entity, but it's still doesn't work, right now the issue is you can't teleport between worlds.
i mean you can check with contains for all 17 materials but at that point you may as well just use your own loop since i imagine contains does the exact same thing you do
ok
I can't, the teleport event doesn't got called.
why do you need the teleport event
there is a different event for switching worlds
The player doesn't got teleported anywhere.
Is there any way to make a custom item, that is a player head, and add metadata which gives me a custom head item with a custom texture?
Check this and you'll know what I mean.
yea
well not custom texture
skin textures yes
Is it possible to remove or deactivate the recipe book in an furnace inventory without removing the permission for it?
if u want custom textures ull have to make a skin for it add it to yourself and use this: https://minecraft-heads.com/custom-heads/heads-generator to get the texture value @quaint mantle
On Minecraft-Heads.com you can find more than 30.000 custom heads, which can be used to decorate your world! The collection is seperated into two databases: the first contains custom heads, which never change their texture, using the Give-Codes from Minecraft 1.8+, the second one includes player heads which can be used in all Minecraft versions.
Ok, but I meant like the custom type of textures that https://minecraft-heads.com/ uses. But I want to make it a custom item aswell so i can add lore and stuff to it, it's for my plugin
Can you elaborate on what you are trying to achieve?
My guess: u want custom items that are heads that have textures, lore, displaynames etc?
Yea
This is my code that I tried
private static void createSuicideWand() {
ItemStack skull = new ItemStack(Material.PLAYER_HEAD, 1);
SkullMeta skullMeta = (SkullMeta) skull.getItemMeta();
skullMeta.setOwningPlayer(Bukkit.getOfflinePlayer());
skull.setItemMeta(skullMeta);
suicideWand = skull;
}
nope not how it works
ull have to use a head value on minecraft-heads
u can find there
skullmeta part is right
but u gotta add this
GameProfile profile = new GameProfile(UUID.randomUUID(), null);
profile.getProperties().put("textures", new Property("textures", "whatever the value is"));
try {
Field profileField = skullMeta.getClass().getDeclaredField("profile");
profileField.setAccessible(true);
profileField.set(skullMeta, profile);
} catch (IllegalArgumentException | NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
}
this is what i use
Oh ok
if u want textures from skins
you go to the site
uhm i am kind of new to java and plugins so not sure how i would apply it to the skull meta
enter the name
thats just it
just put the value in
here
and u have it
Oh wait i see it now
alright so if i put the texture value in, what would i do to this code i made?
replace sthe setOwningplayer line with everything i sent
oh ok
if u wanna get the value of ur own skin go to the site then the heads generator, enter ur name
copy the command into notepad or smthing
and ull see the Value:"hgsdhsghsugsgus something="
@torn shuttle daily reminder that i'm disappointed
and copy everything inbetween that
Uhm i am getting a few errors when i use your code
tell me
show me*
Ye import gameprofile first
Uhm it says that GameProfile cannot be resolved, what version did you code yours in? Mine is in 1.17
gameprofile isn't included in the spigot api
OH YEA
i think paper api might have an api class for it
xD
actually im using both spigot AND paper
ah ok
Yo batman, you know how to fix this thing? I'm trying to teleport player while having a passenger.
well then i have to just add the paper api?
idk
might work
actually no
ull need to having a paper server then :/
oh no i do have a paper server, my plugin is just only spigot
depend on spigot rather than spigot-api
for nms classes and mojang authlib classes
you'll have to build spigot locally
simply just SkullUtils.applySkin(skullMeta, value)
no need to use paper api, and long ass code
hmm lemme check
even tho the entity is client side?
you can't even dismount, teleport, and remount immediately
need to wait a few ticks in between or the client shits bricks
mhm, been having this issue for like 1 week
batmans mask has slipped?
so like, there is no way to do that?
there's not a way that isn't cancer or bulky that i know of
oh damn, my head hurts a lot
uhm do i need to replace "value" with the value? if so can you give me an example of what the value might look like?
the base64
ok
Ah ok
there's also this nice skullcreator library
Did i do it right? Sorry im a noob
private static void createSuicideWand() {
ItemStack skull = new ItemStack(Material.PLAYER_HEAD, 1); // Create a new ItemStack of the Player Head type.
SkullMeta skullMeta = (SkullMeta) skull.getItemMeta(); // Get the created item's ItemMeta and cast it to SkullMeta so we can access the skull properties
skull.setItemMeta(skullMeta); // Apply the modified meta to the initial created item
SkullUtils.applySkin(skullMeta, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjYyNjUxODc5ZDg3MDQ5OWRhNTBlMzQwMzY4MDBkZGZmZDUyZjNlNGUxOTkzYzVmYzBmYzgyNWQwMzQ0NmQ4YiJ9fX0==");
suicideWand = skull;
}
use the applySkin method before the setItemMeta
ok
so i saw one server that can teleport entity with passenger, is it possible that they have modified custom server jar?
it's not about the server
the client gets desynchronized and shit
maybe if you try to resynchronize the client somehow by throwing the right packets at it afterwards it can be achieved
are you sure they weren't just using entity destroy/create packets instead of actually teleporting it
im not really sure about that part
you mean teleporting the armor stand each tick?
i mean instead of teleporting it, destroying it and spawning it back in the new location
applySkin should return the skull meta or the item stack.
skull.setItemMeta(SkullUtils.applySkin(skullMeta, "Base64"))
i would do that tho, but how can you do that?
the teleportation is not come from my plugin
so i can't destroy the entity, teleport the player, and spawn the entity again
you could maybe rig up a listener on the protocol layer that catches teleport packets for mounted entities and instead replaces the teleport packet with a pair of destroy/create packets
wait that makes sense
so listen to a teleport packet?
something along those lines
I don't remember if the server properly supports it either, but I remember the bigger issue being on the client
hmm still doesnt work, i just get a plain player head
pretty sure you can teleport entities as long as a player isn't mounting them or they aren't mounted on the player
I don't remember the details, it was something player related
Can I change the way built-in commands (/gamemode, /kill etc.) work?
no but you can override them with a new command of the same name
NNya back>?>>
we'll see
What if I want to stop /gamemode from sending "Your gamemode has been changed" message?
How could I do it?
you'd reimplement and override the gamemode command with your own and not send it
sounds like i need to use protocol lib
your disappointment brings me immense satisfaction, as the only way you wouldn't be disappointed in my code is if I had made nothing at all
i am very disappointed in that despite doing java since 2016 or whatever you still haven't learned oop 101
it's a bit baffling, really
didn't think such a thing possible
I'm glad that I could broaden your horizons
== "Im sorry im shit"
I will strive to find new and interesting ways to make you see the world
do you understand why your original question was dumb or should I broaden your anal prolapse with some 101
the main issue really is that I assumed there was only one object for the getLocation method when I should've checked
but see, this is where the OOP side of things comes into play
even if there were only one object, your question would still be dumb
let me see if I can dig up your original question
location = livingEntity.getLocation();
livingEntity.remove();
30 minutes later
location == null ?
you can do a repeat of the earlier discussion but I understood it just fine
do you? it really doesn't look like it
Ty
hey skull head
yeah I know you are basing this on very well established data with the fact you have implanted a mind reading chip in my brain and all but I guarantee you that I understand the difference between a field and an object
then why did you ask that question
a blind man can see it with their forehead that location would never become null if they know the difference between an object and a field
because sometimes you've been working on something without being able to test it for over 100h and you just want external validation that you are not going insane
smells like an excuse
if you didn't want a reason you shouldn't ask for one
it was a rhetorical question
smells like an excuse
but at least we've got you to admit that it was dumb
admitting things is the first step towards improvement
next I expect you to improve
yeah you got me to admit it was dumb even earlier today when I realized getLocation was getting generated every time
getLocation being cloned each time is completely irrelevant to why your question was dumb
in an item pickup event, how do you check the amount of picked up items?
get the itemstack from the item and get its amount
event.getItem().getItemStack().getAmount()
thanks
I should just make a macro on my keyboard that automatically adds a debug line
have you considered using the debugging feature that comes with IDEs
yeah you have to like open a port and change one or two settings in your ide
digging through megabytes of sysouts in some logfile is obviously easier
I'm too lazy to locally replicate my remote setup you think I'm going to open ports?
what is this, 2008 magmaguy trying to host warcraft 3 games?
my IDE errors that this will always be false, why?
e.getItem().getType().equals(Material.RAW_GOLD)
yo nny, you know how to use protocol lib?
and an EntityType will never be equal to a Material
this is so confusing
not with that attitude
its not that bad
my attitude is very anti equality
u just have to write directly
i dont even know where to start
hold on let me go find two identically named enums
so i want to listen to a entity teleport packet, and i want to get the entity from that packet
go to the wiki and then find the fields
register a packet listener or whatever it's called and then override onPacketReceiving or Sending depending on what you're doing
and from there it's just like working with events
its a packet adapter
how the hell is CHICKEN a material name
yeah thats what i do right now
chicken meat
COOKED_CHICKEN is the cooked meat and CHICKEN is the raw one
ask mojang why they didn't call it RAW_CHICKEN or whatever
EntityType.fromName(Material.CHICKEN) there
I brought a chicken back to life
or at least it will be once it spawns
at least chicken is halal
how do i remove something from a players inventory?
Inventory#removeItem
you kindly ask them to drop the item
so about the teleporting with passenger thing, is this the packet should i listen to? https://wiki.vg/Protocol#Player_Position_And_Look_.28clientbound.29
smh
damn nnya I didn't know you were physically unable to make people drop items
must suck
I did a really cool magic trick where I managed to make a living entity disappear
it's so magical even I am stumped as to how the trick is done
was it the chicken
we all know how the chicken disappearing act really works, deep down
have you worked with mythicmobs
that really depends on your definition of worked with
do you know if the MythicMobSpawnEvent is fired only when the mob spawns for the first time, or if it's also fired when its spawned into the world as it loads with a chunk
no clue
great
I know how my code does it
I just changed the logic for it lol
you'd hate it too
so you know it's quality
i hate many things
you'd find it in your heart to especially hate this one
is it a minority
you're really testing the mods today huh
do you already have the next account lined up?
several
regardless, I haven't said anything wrong
any implications you may have derived from anything are purely results of your inner corruption
he's finally allowed to be back on here
i guess I'll test it when I have the effort and plug in an entity add to world event if it doesn't cut it alone
welcome back NNY mainish account
he gets paid by the banned account
That’s a new account or no?
prob?
no he just renamed
this account was originally the batman one
ah
he's been on here for at least 3 days
actually probably more, I think I slept for 20h
time is relative
Ah did imaginedev tell you?
maybe? he did tell me something
I presume it was about that then
you making him a mod instead of handing out a ban?
brilliant
👏
make him a mod and have him ban himself on loop
I'll be waiting for my nobel prize for good thinking
i'd be too corrupt to ban anyone but 1.8 people
I'd give it about .3 seconds before you go power crazy
@ivory sleet is it about the gay shit
eh i’d argue that’s a good thing
Hmm maybe is it?
i don't know
Maybe I should ask him instead
i'm told a lot of things all of the time
Is there any way to make arrows not slow down in water?
Got a point, well anyways it’s decided you’re allowed to be here legally if you don’t break any rules. And yes the admin is involved in this decision (;
you said that there was optimising to do?
so that's going to last all of 3 more days
makes me wonder why you're not unbanning my original account
🥲
lol
I mean
initially I assumed it was because nobody wanted to overturn the orange cube's ban
Tbf I don’t remember the name nor I’d
#help-development message we have a strong start for day -1 of your unban
I look forward to seeing what it is that gets you banned this time
@NNYaKNpGms0eUVpiSdHx#5618
599731521922007066
we can ban trade I guess
alright, you can take, uh, @past pawn
you really should've pinged a staff member there nnya, your comedic timing is horrible
I was thinking of yeeting the one you’re on now and pardoning your original one
i don't really see the point but sure i guess
it'll blacklist this ip so I need to cycle out the vpn again though
so you should unban the original before banning this one
Syntax: ?unban <user_id> [reason]
Requires specifying the target user's ID. To find this, you may either:
- Copy it from the mod log case (if one was created), or
- enable developer mode, go to Bans in this server's settings, right-
click the user and select 'Copy ID'.
looks like u can
?unban 599731521922007066
Unbanned that user from this server.
?ban 871395117074907156
User with ID 871395117074907156 not found
NNya can u help wit the path finding pls. u said there was some shit to optimise
Done. That felt good.
Ok
conclure
wasnt that the original?
you banned the wrong one
bruh
lmao

alright place your bets, how long before the next main account ban
String temp = String.join(" ", args);
How do I make this string ignore the args[0]?
🤨
I`m using long defaultTime = System.currentTimeMillis() + 86400000L; to set one day cooling.
i'll ask someone else to do it later i guess
Sure
looks like thats a time in ms
consider using Instants or dates or whatever
show me what you have @opal juniper
okk
ill do a paste of both classes
Is calling this method every 1 second for each player is a bad idea? I want to check if the player is near a portal, so i can remove the passenger. https://paste.md-5.net/huweducoyu.cs looking for alternatives that is faster of course
right so
String temp = String.join(" ", args);
How do I make this string ignore the args[0]?
the path can be made a bit more optimal if instead of backtracking through a chain of parents, you backtrack through the nodes nearest to the starting point
well
for that to happen you need each node to actually cache their adjacent nodes
instead of constructing new ones each time
Nooo don't loop to get the remainder. Look into modulo
Also your time is so long as you add the current time since jan 1st 1970 to the duration
you could maybe replace the Set<Node> with a Map<Node,Node>
right - so its like a trade off between memory and efficient path essentially?
and i guess you are talking about processed
well, since Set is just a Map anyway, the difference in memory is negligible
and yeah, processed
@opal juniper which algorithm are you using for pathfinding
A* ish
the actual cost is that it takes a bit more cpu time
since each backtracking step involves looking at all of the adjacent nodes and selecting the one nearest to the origin
rather than just grabbing the parent
Then A* should have built-in backtracing right
we're using a depth-first approach with heuristics so the parent chain isn't always optimal
Ah true
What do the key and value node represent? surely it should be a Node -> Multiple Nodes
it still won't be optimal after this but it'll be a little bit better
as if it is pointing to all neighbours
the processed set right now contains all of the nodes that we've processed
So..
String temp = String.join("args[1:] ", args);
like this?
in a Map<Node, Object> map
Set::contains is just map.get() != null
and what we want to do here is ensure that no two Node's are created for the same location
or if they are created, they aren't retained
whenever we want at a certain location, we want the same Node instance to be returned
and since the equals method of Node is based on the location, a Map<Node, Node> will achieve just that
consider it a Map<Location, Node>
myeah that makes sense
but since the Node is a sort of a Location, we substitute the Location with Node
a fancy term for this is a 'canonical instance' map
Use Block rather than Location. Location is too precise
Apparently if your heuristic function doesn't over-estimate the remaining distance then A* should be guaranteed to backtrace optimally
which is why we're using Node instead of Location or Block
because Node may not be defined in terms of either
but Node is always in terms of Node
bumpp
bedLocation.getBlock().setType(type);
Bed bed1 = ((Bed) bedLocation.getBlock().getBlockData());
bed1.setPart(Bed.Part.FOOT);
bed1.setFacing(direction);
bedLocation2.getBlock().setType(type);
Bed bed2 = ((Bed) bedLocation2.getBlock().getBlockData());
bed2.setPart(Bed.Part.HEAD);
bed2.setFacing(direction);
Why?
yep. that path is not the optimal
to alleviate the issue what we're going to do is kind of doing a second A* path search in the reverse direction
yep, the one I did was a tree search, depth first. Then I prune for shortest path. The code I gave you was bugged
I gave fixed code to jeff
but limit its node set only to the closed set of the original call
myeah i did try it elgarl but it didn't work in all instances
so it's exponentially faster
Is your heuristic just the distance?
pretty much yes
Then the path should be optimal no
Yep, the issue with mine is speed, however it "shoudl" find its way around any obstacle, given enough time
not quite
give it more time. It will get there
instead of selecting the deepest or an arbitrary node from the open set, we always select the one closest to the target
which results in what the gif shows
when it hits a wall, it starts branching perpendicular to the direction to the target
all you have to do is prune after with the one you showed me
which results in a suboptimal path
you would plot a line straight to the corner then
because the shortest path would usually be diagonal
Is that more efficient than normal A*?
rather than perpendicular
myeah fair nuff
well, normal A* with looks like this
it finds the optimal path but has to process exponentially more nodes than a search for a slightly suboptimal path
If you prune, you test rayTrace from first to last, loop over all, then increment the first node, you eliminate all superfluous nodes between.
Okay makes sense
the current way it happens is 'fine' but can be made slightly better with just a slight increase in required cpu time
Find the fastest route, then prune it for most direct
But mentally that doesn't seem like the A* we were taught...
When it hits the wall why would it go back to the beginning
oh elgarl the reason i didn't want to use the raytracing is cause i wanted to try and keep it more universal to older versions for once. i am working with godcipher on this and he is trying to keep it 1.8 safe
That's like normal DFS
it goes back to the beginning because that's the only way to make the parent chain result in the optimal path
The closest available nodes are the ones near the wall
the parent of any node must have a shorter distance to the origin than the node itself
if we branch perpendicularly like in the first gif, that is not the case
now granted the algorithm I wrote is far from the actual proper impl for what results in the first gif, but it's close enough most of the time
almost
we'd want to restrict the path to the processed set
which means we'd only pass through the colored circles
oke
run pathing on your pathing
pretty much yes
did you want me to set all the "processed" to glass for a test?
to see what it contains
sounds fine
When you hit the wall shouldn't normal A* just crawl along the wall, since those are the available nodes with the lowest weight? Then their parent nodes would be whatever cloud node is closest to them
Green = processed, Yellow = Path
don't run a* algorithms at 3 am gone sexual
Why is PlayerPickupItemEvent deprecated?
Just being curious, what are you trying to do ? A sort of pathfinding thing ?
Javadoc tells you why
Ah EntityPickupItemEvent
src is the first yellow glass, target is the last yellow glass
i can't see shit
it runs off the screen
yeah that path looks fine
ye
try putting some large obstacles in between
okk
put the target in a house with a door on the opposite side to the origin
I've actually never tried to mess with the pathfinding, how are entities fed the next target location? sort of similar to raycasting to a specific point?
i'm not sure how it works under the hood tbh
i'm pretty sure entities use like some sort of a precomputed navmesh pulled from like a heightmap or something
I'd be surprised, since that would need to be updated on every block place
and iirc navmeshes aren't the ligthest thing to compute
for MC I'm fairly certain its just pick a target and head towards avoiding specific blocks
its another video
yeah i'm not sure about the navmesh part
The target is a few blocks off the floor
would probably be easier to just feed it breadcrumbs based on a*
the entire path is definitely computed on the spot
and iirc the pathfinding puts different weights on different blocks that mobs walk over
though that might be bedrock only
the pathfinding changed in like 1.8 or something, previously it was like what elgar said
just move in the direction of the target until you hit something
something like that
now the whole path is computed at once and zombies can run 300 block long paths inside mazes
they have gotten smarter from previous versions that's for sure
they have ledge detection now
imagine that
which is why mobs sometimes spin around stupidly on slabs or block corners and shit
something about velocity and collisions prevents them from reaching the next point in the path
and then they just spin around it
which has made the mobs' movement look pretty stupid and artificial in more recent versions
the old dumb ai was more organic imo
can you make the processed set glass clear
you know I think you're wrong actually, I am pretty sure they spin because they're listening to you spin me right round
ok
it's kind of hard to tell yellow from green in this puke clusterfuck
lmao
somehow the worst pathfinding in minecraft right now is for flying creatures
now make code to generate a maze then have it compete against your maze solver
there are definitely a lot of the "processed" nodes
How can I run a task which will auto put all players on a list if they are afk?
On PlayerMoveEvent I remove them from the list
starting from the end of the stone wall that is closes to the camera
extend it to the left
to make an L shape
or put a big inwards ledge
yeah that's a fucked parent chain right there
right
it first hits the wall
then hunts the target to the right
then hits the second wall
then crawls the first wall upwards until it's the closest it can get
and then starts spreading radially outwards
creating a circle
and all of this is captured in the parent chain
mhm
you'll want to change the processed set to a node node map
so magic coding hitler
and pass it to the node constructor
oh ok
and in the getNeighbours method, check the map for an existing node at that location and if it exists, return it
wait so you want the map passed in the constructor? why?
because the Node needs it to shit out the correct neighbors
you don't want two different nodes giving out two different node instances for the same location
but getNeighbours is a method in the pathfinder
so we could just make it a field no?
probably?
just thought it would save passing it aroung thats all
doesn't matter
on line 77 you'd check the map for an existing node at that location
Node existing = computed.get(neighbourNode);
I've managed to create a situation where one entity has two spawn locations and I am too spent to fix it, it's high time I call it a day for today
or more concisely, you'd replace line 78 to neighbours.add(computed.getOrDefault(node, node))
going to need a second spawn field, very ugly
latter node = neighbour right?
i forget which way the default is
mmmm both should be neighbourNode
oh ok
what it does is it looks in the map for a node that is equal to the created neighbourNode
if it exists, it returns the equal neighbourNode
the "canonical" node for that location
if it doesn't exist, it returns the newly created neighbour node
containsKey
okee
and drop the !
i will!
then, in retracePath
instead of getting the parent
get all of the neighbors of the node
and pick the one that is closest to the origin
actually, that's probably not going to work
you'll need to pick it based on the shortest path distance, not just raw distance
which is a bit more difficult
myeah
you could do a second iteration of a*, breadth first, on the computed set i guess
hello all, how to call event in another class
call or listen
by learning oop
ohh, i am sorry. i mean listen
oh, you must register the class as an event listener
so it must implement Listener
and then just annotate the methods with @EventHandler
nah, i am getting error when i register multiple event
code?
error?
wait
hmm this seems like it may be a fair bit more expensive to get a "better" route
if you restrict the improvements to the processed set of the first iteration, it won't be very much more expensive
idk why now i dont got an error. but event not work.
i am register it with
this.pm = this.getServer().getPluginManager();
pm.registerEvents(this, this);
pm.registerEvents(new Gui(this), this);
i have implement listener and annotate methods with EventHandler
and, if code on main class, all work correctly
i have an idea
throw some randoms at the compareTo function
let's see what happens
it's probably going to give a really shit path but it'd look natural
return (int) Math.signum(this.target.distance(this.location) - this.target.distance(otherNode.getLocation()) + (ThreadLocalRandom.current().nextInt(6) - 3));
yeah
they won't fly
try the one where it was being stupid before
brilliant
but i feel like the "randomness" should be lowered a bit
try playing with the numbers in the nextInt call
maybe change it to a nextDouble if you need more control
this is a really retarded way of 'fixing' the issue but you can always call it a feature
Fuck. Me.
lmao
??
oh i remember when 1.8 servers used to start in like 2 seconds
use plugman you plebian
i thought it was kinda shit
well
it was for one plugin i used
so i stopped
bit hard to see but here are a few example paths
it's just the wind
welcome back
ello imagine
is it against the rules to be racist
is that a surprise?
ok place your bets. how long do we reckon an 11k pathfind will be. eg how long will it take
I'd expect it to be against the rules to act in a racist way or discriminate
🧍🏿♂️
hey guys??
but what about being racist
why u racist
he is not white, he is simply tone1


Very interesting conversation
what if being a farmer was against the rules
me farming my crops has nothing to do with what I do here
lmaoooo
would you now, with the information that I am indeed a farmer, ban me
yeah
yeah
just dont be racist 😉
simple for you to say
fuck my pc just bluescreened doing an 11k A*
🧍🏿♂️
computers still bsod
I repeat again, how to listen event on another class
not main
lol
the same way you'd do it in any other class?
:v
Difficult concept for people who started their coding journey with Spigot
main class is very full, I want to make it structured
spigot is indeed the leading cause of mental damage in the bukkit ecosystem
https://prnt.sc/1i2ft7k Can anyone explain to me why displays this error?
it takes a parameter type other than a world
Like?
check
it should say in problems
bottom of screen
Yes
it takes no parameters
learn2read
whats the difference between event.getInventory and event.getClickedInventory in the invclick event?
player inv?
could be none, kind of like BlockPlaceEvent::getBlock and getBlockPlaced
found it
Hi ! Is there a way to unregister vanilla commands such as /gamemode ?
The command map contains only bukkit related commands...
i take all solutions including nms 🙂
need help with loading player balances from mysql
that need some time
problem is galistenere for example or some other plugins runs command to add/ remove tokens from player
that will make server throw error because getBalance method will return null because balance is not loaded yet in hashmap
load the balances before the player has logged in
can I make my add or remove method to wait until balance loading finishes
the player isn't supposed to be let in until their data is loaded and proper
make it not delayed
must be
must not be
so?
so if player switches server
server A will not save in time and server B will load
old amount
big time problem
have server B wait until server A is done saving
how would I do that
by facilitating communication between the two
I have from that reason 1 sec delay
via for example bungee's plugin messages
it won't, because the player isn't online yet
and balance will not be loaded
because the player won't be allowed to join before it is loaded
and it won't be allowed to be loaded before it is saved
how would I load and block them to join
wait in the player async prelogin event
you don't necessarily need cross server communication either, just a table on the sql database with a [player, server handling player's data] columns will do, but is less optimal
server B won't attempt to load any data or let the player in until the database reports that the player is not connected to any server
server A will mark the player as not connected to any server only once all data is saved
server B loads the player's data and marks the player as connected to server B
well that sound like good idea
throwing arbitrary delays at things has never solved anything
but there could make many problems think of server crashing and not saving player data
that player now is marked as not saved
they can't join any server anymore
big time problems
you'd need timestamps or shit to get around that
that is why the actual cross server communication is better
I think I will just make one more hashmap which will store amount
sure, whatever
which need to be added and when player loads then just add it
your idea will need a lot of rewriting
and not doing the rewriting and just jerryrigging shit together is just kicking the can down the road
you'll have to rewrite it eventually
because throwing delays at and storing everything in a dozen temporary hashmaps is not maintainable
How should I handle errors (such as SQL Exceptions) in a custom vault economy?
because things such as accountExists exist which don't have a proper way to error out
Print an exception and return false or throw a RuntimeException.
Is there a way to manually update the light of a block ?
thanks ^^
like block.updateLight() ?
?paste
^
no one ?
how would you get the version from plugin.yml in a commandexecutor class
be patient, if nobody answers then nobody knows
Plugin#getDescription().getVersion()
yeah but you cant do that in a commandexecutorclass
yeah you can
any guide to use spigot mappings on gradle (nms 1.17)
you cant

you cna only use it in a extends javaplugin class
imaginedev don't bully me
?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.
i need help here
i know how to use java...
im trying special-gradle but it's not working for some reason
then you would know how to use dependency injection
you didnt tell me before you told me Plugin#getDescription().getVersion()
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
plugins {
id "xyz.jpenilla.special-gradle" version "1.0.0-SNAPSHOT"
}
group 'com.willfp'
version rootProject.version
dependencies {
compileOnly 'org.spigotmc:spigot:1.17-R0.1-SNAPSHOT'
}
specialGradle {
minecraftVersion.set("1.17")
specialSourceVersion.set("1.10.0")
}
tasks {
build.dependsOn productionMappedJar
}
here's my build.gradle for my 1.17 module
i'm not sure why it doesn't work
why doesnt it work to remove the bossbar? i vanished three times and i got three bars
Store the bossbar instance instead of creating a new one each time
correction: fixed by replacing version with 'org.spigotmc:spigot:1.17-R0.1-SNAPSHOT:remapped-mojang'
but i can't find playerInteractionManager anymore
Where did you get that name?
*playerInteractManager
Spigot now uses Mojmaps so old Spigot mapping names won't work
Hm
Yeah idk and I can't really check for another week
how works the minecraft projectile velocity ? with your losing velocity etc
the velocity decreases over time
like real life
but and the projectile increase velocity ?
Any suggestions ? 🙂
not only does PlayerInteractManager not exist
but the packets don't either?
but i'm not missing all classes
most are there
it seems to just be the classes i care about
and MinecrafKey?
what the fuck
JavaFX running on Java 11 show this error on startup
Error: JavaFX runtime components are missing, and are required to run this application
javafx {
version = "15.0.1"
modules("javafx.base", "javafx.controls", "javafx.fxml");
}
runtimeOnly("org.openjfx:javafx-base:$javafx.version:win");
runtimeOnly("org.openjfx:javafx-controls:$javafx.version:win");
runtimeOnly("org.openjfx:javafx-fxml:$javafx.version:win");
runtimeOnly("org.openjfx:javafx-graphics:$javafx.version:win");
runtimeOnly are shaded in with shadow plugin
anyone know how can I fix that?
so i tried this, but it doesnt work, can someone help me?
Location location = e.getBlock().getLocation();
location.getBlock().setType(Material.WHEAT_SEEDS);
inventories start with 0 right?
maybe try crops
wheat i guess
yeah
alternative to codemc nms repo? the mapped mojang seems to be missing a bunch of classes
Yarn
i can't use buildtools for the jar because it needs to be built by jitpack
but the actual spigot jar is also missing the classes
what
Lol
it's also missing ServerPlayer
does serverplayer even exist? what the fuck is happening
How do i deal with Vault on a UUID database? It works with player names instead of UUID's for some reason?
PlayerInteractManager does exist on the spigot jar
but not on the mojang mapped jar
what the fuck?
no
didnt work
This errors with a null
@EventHandler
public void onBlockBreak(BlockBreakEvent e){
Player player = (Player) e.getPlayer();
if (e.getBlock().getType().equals(Material.WHEAT)) {
player.sendMessage(ChatColor.GRAY + "You broke wheat! - " + ChatColor.RED + "Admin Tools");
Location location = e.getBlock().getLocation();
location.getBlock().setType(Material.WHEAT_SEEDS);
}
}
All classes still exist in the Mojang Mapped jar, they're just under different names
Just depend on the normal Spigot jar
but then it's obfuscated
The one the server uses
why isn't there just deobfuscated spigot mappings
because if i use mojang mappings my 1.17+ nms is different to my 1.16 nms
Hi guys,
does anyone of you have experience with Agents, in particular I mean injectable Agents to JVM. I am trying to unterstand it, but am having a hard time.
I am trying to inject some code into existing 1.17 NMS classes.
I figured it out with static Agents but am currently trying to figure it out with dynamic ones.
Send the error
The error is on breakBlock line 347
Well that's the method name
Class is PlayerInteractManager I think? Hard to read that on mobile lmao
java.lang.IllegalArgumentException: Cannot get data for not block WHEAT_SEEDS
There you go, need to place Wheat not seeds
For (int I = 1; i++; i<args.length) { string = string + " " + args[I] }
Does someone know whats wrong with this line? For method cannot be resolved
For shouldn't be capitalized
mobile shit
sad
i placed wheat aswell
didnt work either
are there any mojang mapped 1.17 plugins that are open-source?
How do i deal with Vault on a UUID database? It works with player names instead of UUID's for some reason?
I'm sure if you just started looking at random resources updated to 1.17 you could find one, but I don't know of any off the top of my head
didnt throw an error tho
Lookup how to place Wheat, I think you have to do some stuff with BlockData
wdym error
[19:05:05] [Server thread/INFO]: FourteenBrush issued server command: /debug spawnitems
[19:05:05] [Server thread/WARN]: java.lang.IllegalArgumentException: items.length must be < 1
[19:05:05] [Server thread/WARN]: at com.google.common.base.Preconditions.checkArgument(Preconditions.java:168)
[19:05:05] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventoryPlayer.setSlots(CraftInventoryPlayer.java:217)
anyone got the mojang -> spigot mappings txt file? i can't find it
can i spawn in a item with a count of -1? As in, create a 'infinite' block?
Do you want to withdraw or deposit money to/from a player? Vault's Economy should have methods that accepts OfflinePlayers.
it's just blank though
and i need the server mappings which show a 'doesn't exist' thing
