#help-development
1 messages · Page 2289 of 1
can't you build it yourself?
In the beginning of every task
Well i create a new Logger instance inside my task
so Logsl4j should pick up the thread
plus
its bricking the request handler
its not
so if i Thread.sleep() it wont use a new thread
it wants to run it on 115 still
let me try with only availableProcessorCore size
Doing that makes it block on thread 19
Try to print the thread in the beginning
kk
takes time to debug because thats the core lib
so i have to edit compile then import into gradle
T_T
🥲
💀
?paste
current async thread = inside runAsync
server thread is outside of it
which is fine that thread can stay the same bc it needs to
i rly wonder if calling join() on CompletableFuture is messing with it somehow
but without it the threads never completed and hung on non complete status
maybe its broken locally
lemme upload to prod
bumpy pumpy
nms?
Protocollib will suffice
ok
your just sending fake blocks to the player
specifically its a minecraft server. the response determines the status of the server eg. String online = true/false;. should it be safe?
It starts at 115?
When i was running at 96 threads it did
un using Runtime.availableProcessors now
on prod the requests always execute on worker 3
Hmm
Ima write a test
Does calling join() on futures possibly have something to do with it?
No
poor string class
Wouldnt day that
public static void runAsync(Runnable runnable, Executor executor) {
CompletableFuture.runAsync(runnable, executor).join();
}
This is the runAsync code if needed
i just pass the executer code you showed me a bit ago
Wair
This kind of defeats the point
Wouldnt it be better to just run it as is
join blocks
Its like await in javascript
Why do u use a thread pool in the first place
Well its what you suggested
I was just using the normal runAsync() without the pool beforehand
but i would assume it would stop forking new threads after x amount of them
and then start blocking
well no futures queue dont they
Does someone have a second to help me choose between 3 possible designs I made for a message?
throw em at us
^
1, 2 or 3?
hmmm
1
Not really, it's more like a Discord - Log thingy
so now how do I exactly send packets in a way it shows the player that he is standing above void like this vid https://youtu.be/AVVQAU3lWZo?t=338
I Became a literal god on the Lifesteal Minecraft 1.18 SMP by exploiting its plugin...
Keep up with me on social media
★join the community on discord - https://discord.gg/SQqkenRwx4
★stalk me on twitter ➣『 @ashswagin 』
★follow my twitch ➣『 https://www.twitch.tv/ashswagin 』
THANKS TO THE PLUGIN DEVS FOR HELPING ME do this :- Abyss Development ...
The the last one
I kinda also tend to pick the last one cause I like the spacing between all the stuff idk
Yes
ngl not sure
yo eminem pfp guy
So then calling join() is not necesary if you dont need return of the future?
Thanks for your opinion btw guys
hm?
Burchard
Dont join en
That is awaiting
join awaits uninterruptibly
get does not
its just weird bc without wait earlier
i bricked my container
it was weird
the logger logged the threac count in increments of 1
then went to a high number, restarted back to 1
did it a few times then bricked at 60mb ram and 2% cpu
was rly weird....
ill try it again rn with new executor
wtfffff
still on same thread da fuq
It was the TAB plug-in
join is just like awaiting
Rip
oh
i think its time for bed
there we go
works now
need to do more testing if its bricks again tho
Thanks Conclure!
seems to be all good now
Yeah doing a little testing here
weird it broke all of a sudden
yep im doing same thing
im sending a request every 1ms to my test env rn
gonna upload to prod and spam tf out of it
🥲
im honestly suprised no mem leaks in all of this sytem
i was spamming it earlier with 96 threads and it barely hit 80mb ram
on fixed thread pool too
so it opened all 96 on start and i monitored in htop
wait i have netdata tf am i doing
lol lets watch my vps die
sec
clean your goddam monitor
Its my school laptop lol
ok that’s fine then
Been camping in my bag 😅
fuck school property
Lol honestly
you are lucky tho - i got given a school chrome book 
it’s just an internet browser
it runs chromeOS
im dead bored
and can’t do shit

They use to be like tablets then chrome os updated :(
oh yeah i defo am
To avoid dos
my server will never even handle that many requests even just on a normal game 💀
ide be amazed if it did
🥲
client will probably get about 120-240 rqp
Ah yeah
also not sure how much more stress testy i can do other than a fore loop
WAIT
i literally have a websocket stress tester
lmfao
oh
rest
nvm

watch

5000 chrome tabs in a seconds
Lol
and froze my pc lmfaao
there we go
not bad 12%
i assumed it would take more thats a shitloads of threads
Shesh
:0
oh yeah im just doing thise for testing
oh wtf
Its just the amount of active threads the pool should try to maintain
thought it was limited to the long provided
is there an option to set max?
well
eh
i assume it would start blocking at that point
Yeah
not really performance difference *8 and *64 tbf
Yeah
just slightly more ram
Because
i expected like 500mb usage
The tasks you do seem to be cpu bound
Then you dont even need to multiple the parallelism with anything
what is this
Processor amount*
💀
What tasks are you doing? Because a big part is just efficient partitioning so that the threads dont have to wait for each other
But wouldnt the Futures stop opening new threads once they hit the 2 open?
Threads never needs to wait for one another currently
I meanr available processors times 2
socket server for mah game
But exactly this
You can use sth like the blocking coefficient if you wanna be precise
Currently each request doesnt really need to interfere with one another and i dont beileve they will
Each socket action executes as its own task
only interaction is the player data between threads
which ill have handled thanks to you :))
i remember making the socket extremely simple
just for transfering data like bungeemode for a gamemode
what kind of game u makin
a thread made for each server connecting to the lobby
sends string
i split the string
read the message
but realised its a mess
Itll be a hacking game, you can create your own botnet, destroy other peoples machines, break into them etc
I have a list of features written but the base of it is basically a botnet simulator
android
would love to give it a try when its done
sounds difficult to make too 😂
i did it as a discord bot once
was really cool
i lost the code to it tho :((
plus it uh
99% sure not allowed as a bot haha
discord rly picky about those things
not worse than microsoft
Yeah i just cant put it on IOS unless i redo front end
ide have to do hybrid but god damn
i suck balls at html
im not even sure tbh
but ios support would be nice but at same time i dont wanna put that work into something thats a maybe rn
cause i heard swift is AIDS
this reader not complaining to be not closed and the other one does?
[14:24:02 ERROR]: Thread Craft Scheduler Thread - 4 - BungeeHandler failed main thread check: player kick
java.lang.Throwable: null
at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:15) ~[paper-1.19.jar:git-Paper-59]
at org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer.kickPlayer(CraftPlayer.java:517) ~[paper-1.19.jar:git-Paper-59]
at com.rewskaia.bungeehandler.BungeeHandler$1.run(BungeeHandler.java:65) ~[BungeeHandler-1.0-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.19.jar:git-Paper-59]
at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.19.jar:git-Paper-59]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.19.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
looked thro the code and this doesnt
Myeah well IntelliJ doesnt know
Any more info?
tried to have PlayerJoinEvent as a parameter.
But also
FileReader 
BufferedReader 
idk lol i have never really been busy with file based io stuff
does that close itself??
Idk
i just realized i had a reader in there lmao
Check the method lol
public static void async_run(JavaPlugin instance, PlayerJoinEvent event) {
new BukkitRunnable() {
@Override
public void run() {
Player player = event.getPlayer();
String ip = "ip";
int port = 11111;
try {
Socket sock = new Socket();
sock.connect(new InetSocketAddress(ip, port), 400);
DataOutputStream out = new DataOutputStream(sock.getOutputStream());
DataInputStream in = new DataInputStream(sock.getInputStream());
out.write(0xFE);
StringBuffer str = new StringBuffer();
int b;
while ((b = in.read()) != -1) {
if (b != 0 && b > 16 && b != 255 && b != 23 && b != 24) {
str.append((char) b);
}
}
String[] data = str.toString().split("§");
int onlinePlayers = Integer.parseInt(data[1]);
System.out.println(onlinePlayers);
player.chat("SERVER IS ONLINE. TEST1");
} catch (Exception e) {
System.out.println("Under maintenance");
player.kickPlayer("server offline");
}
}
}.runTaskAsynchronously(instance);
}
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
System.out.println("Player joined. Will run async now.");
async_run(this, event);
}
this is my code
spigot. dont mind the plugin name
You need to kick players on the main thread
not async
you should be able to synchronize and object to lock and then call that method sync, or just remove that runnable all together
and handle socket connections in a diff runnable
how do i pass a boolean var from there to the main thread?
apologies. im not very good with java
Not sure if you can do this in Bukkit but IIRC you can pass a sync task inside the async one and it will run back to main thread
But typically you use synchronized to shove onto the main thread providing a object lock (Hopefullly explained that right)
Store the boolean as AtomicBoolean on the main thread not a standard boolean
or just a CF and accept the boolean
runTaskAsync(() -> runtask(())); works?
Ye
@round eagle ^
Might introduce a callback hell
indeed but should be fine if only doing it once
could you explain in brief. thanks
this code
Your running an async task with BukkitRunable
You can call a sync task insde of that current async task
sec
This code block here (And any code that interacts with bukkit/bungeecord) needs to be run in sync
how do i do that
lemme close the reader in a try with resources :'(
so you can just do the same thing you did with the async task, but use runTask
instead of runTaskAsynchronusly
i get it. uh could you show an example code?
please dont make a new bukkitrunnable :(((
You quite literally have a runnable in your code haha
use the scheduler method
schedular method do be nicer
im confused people keep instantiating bukkitrunnables when theres no need for it
Bukkit.getSchedular().runTask(() -> {}, plugin);
And you kick the player inside the lambda @round eagle
gawh damn i started learning java two days ago. this is too complicated 💀
two days ago and your doing async stuff?
:(
well i have experience with python
snek
it wasnt a problem until i got in a mess with the syntax
async in java is a different world of hell
i thought nodejs async was hell
until i saw javas
await, promise :(((
i promise :((
sad
reject(true)
resolve(false)
chaotic neutral
ngl i hate the reject/resolve system for promises
like take a return value like a normal person
im working on my own future engine rn
For JS or Java?
rewriting CompletableFuture from the ground up
and im only accessing java methods via reflection to remake it

:/
i wanna see someone do that with spigot
instead of using spigot api you use reflection upon spigot api
would be total cancer but funny asf
guys how can I know which plugin is sending msg in the chat at the current moment

like plugin messaging?
or logging
or chat
like in-game chat
dont think theres a way to unless to listen for stdout Logger's and find the packages of the plugin you want to find
Not even sure if thats a thing tbh
might be
sounds like it would
wait
im
fucking stupid idk why i said logger
im going to bed im sorry
gnight guys
Gn
What's the time in your country?
Same
Yeah well Im in germany rn
I thought that
I'm in Czech Republic
Very nice city ngl (:
Hello ! i'm a little sad that i need to ask but i need help, i need to add potion effects to player when they equip armor and remove the potion effects when they remove it. BUT when the player doesn't have anything equiped and we throw potion on it the effect is removed, so idk what to do
what kind of effect?
strength
Put Attribute modifiers on the Armor piece
For speed too ?
i'll try it out !
it is now freezing the whole server for some reason
until the code is fully executed
?paste code
event first
Ok I have a class like this
And in the constructor of GameMap I'd like for it to take a GameType which takes that GameMap as a generic
can I do this?
Idk can you
I'm asking if it's possible within java
You'd need to do it a bit like the enum class does it
So GameMap<..., M extends GameMap<..., M>
And for the constructor you'd have GameMap(String, GameType<M, ?>) then
is ... the same as ?
What are the golden I; numbers? If anyone happens to know
UUID
Oh just in number format instead?
a uuid are some longs right?
yep
Ah fab, cheers 👍
bruh ive been on this for hours now
deaths:
'1':
- effect: speed
multiplier: 12
- effect: haste
multiplier: 10```
assuming i dont know how many items are inside deaths.1
how do i parse through each of them and return each value as a PotionEffect
i just gave up on that ngl
deaths.1 is a List, each element of that list is an Object which is a Map<?,?>
hmm good
heres the thing im dumb as shit
lemme show you the code im using
potionEffectList = new ArrayList<>();
this.config.getList("deaths." + deathNumero).forEach(__effectList -> {
LinkedHashMap effectList = (LinkedHashMap) __effectList;
for (Object o : effectList.keySet()){
potionEffectList.add(
new PotionEffect(
PotionEffectType.getByName((String) effectList.get(o + "effect")),
Integer.MAX_VALUE,
(Integer) effectList.get(o + "multiplier")
)
);
}
});
return potionEffectList;```
tf
tf does ? mean
is it like an undefined datatype
for (String deathNumberOrSmth : config.getSection("deaths")) {
List<?> list = config.getList("deaths." + deathNumberOrSmth);
String effect = ...
}```i lost it at the list part lol
its a method
deathnumero is a value given when calling the method
public List<PotionEffect> getEffectsFor(int deathNumero){
then dont iterate
idk what type the list is cuz its some weird structure i have to agree
some guy here gave me that format
this bit os wrong new PotionEffect( PotionEffectType.getByName((String) effectList.get(o + "effect")), Integer.MAX_VALUE, (Integer) effectList.get(o + "multiplier")
o is your KeySet element, so its either effect or multiplier
which is not how you want to do it
effectList is is actually a Map not a list. Carefull with naming
so effectList.get("effect") will get you the effect
and best to drop the __ on variables. Its not normal for java
How would you modify a entity’s pathfinding so it doesn’t go into certain regions? Is it possible with pathfinding goals?
Elgar i was thinking a thing, can you change Id or Name of potion effect ? Like that we can remove then better later
Sorry you are going to have to use better English for me to understand
Can you change the ID or the Name of a PotionEffect ?
yes
cpot is not a command on this server
I've not played with custom potion effect. I believe you can but its not easy as registration is locked once the server is running
@dapper ether how
Hey! Does anybody know how to generate an empty room with 2 locations, so I have 2 locations, there are 2 corners. And I want to generate a room thats empty. Thanks for every help!
Man that's generic asf. If you want to generate a box that's easy just create a box. If by a room you mean a server then that's a little difficult but if you search here there's plenty of people who've done that before.
good answer thanks helped me so much
👍
too much python
itemMeta.setUnbreakable(true);
That ?
itemMeta.addEnchant(Enchantment.DURABILITY, levels, true);
Then that ?
This is probably simple but I can't think right now, how would I make this per player instead of it being global for everyone?
public static double MAX_ArcanePower = 100;
The max level is 99, after 99 there's a 0% that an item loses durability on use I think. I suggest reading this: https://minecraft.fandom.com/wiki/Unbreaking it has the math for how Unbreaking actually works.
Remove static and track it for each Player using a Map or something
ah yes
hashmap
are hashmaps not kept upon restart?
obviously not no
mhm...
how do i change the build directory of my maven project
edit the configuration
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<finalName>YourFinalName</finalName>
<outputDirectory>${project.basedir}/../out/</outputDirectory>
</configuration>
</plugin>
i do it like this
you have to edit your pom.xml if you are using maven
and include any libraries, dependencies you need in there
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dev.yada</groupId>
<artifactId>SuperVaults</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>18</maven.compiler.source>
<maven.compiler.target>18</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
</dependency>
</dependencies>
</project>
what do i need to add
well idk what ur tryna do right now
ye thats not how that works when you use maven
double click left ctrl
and run mvn package
this is how i used to do it
and it worked fine before
im coming back to development after a couple months idk what im doing wrong
exactly
now you can use this to change that
do i replace the ids with my own project when i add this
what ids
group and artifact
plugins are added like this
<build>
<plugins>
//your plugins
</plugins>
</build>
got it thanks
just to verify: This does return entries in a single string, each value separated by a linebreak, right?
ArrayList<String> entries;
//init entries
String.join("\n",entries);
yep
k thx
any one can help how would I do this
in 1.18.2
with mojang mapings
this is code from 1.16
my try with 1.18
what is 16 in 1.16
no, what is the id 16 for the synced data
not sure
doing update
to 1.18
anyone know how to copy default text from a resource to yaml file
how can i do that?
https://sourceb.in/N4bbyiumad
what is a method?
?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.
nvm
where can I find more about EntityDataAccessor
do you maybe know xd
https://github.com/Multiverse/Multiverse-Core Doesn't seem to be maintained much anymore? Anyone aware of any active alternatives? 😛
How would you modify a entity’s pathfinding so it doesn’t go into certain regions? Is it possible with pathfinding goals?
no
Is there a way to do it?
slimeworldmanager
Theres one from incendo
Idr the name
This stupid plugin set the cancelled to false
And i cant cancel the command preprocess in my own plugin
I tried lowest priority and ignoreCancel
The code is from the plugin setting cancelled to false
I dont want to edit that
what event is triggered when a tree grows, BlockGrowEvent?
My recipes are being shown in the recipe book, but when I go to craft them I don't get the result. What could be causing this?
you have to set it to highest not lowest
Lmfao other people's code sucks. For example there is a plugin called Thirst where I told the owner he did a fuckup he said thanks then never fixed it. Bugs still there 
lowest means after all the event
Could you depend on their plugin then do lowest and get below theirs?
Idk
Or byte code edit theirs?
No not javassist
or just fork the plugin if you really have to
Highest will run later and let you uncancel it
yea
hey guys, whats the best method to deploy my plugin for testing purposes
I have a server, but dunno if theres a tool that could auto deploy for me to the server everytime i build
Yup intellij has multiple tools to deploy
EventPriority.LOWEST = first in line to be called
EventPriority.HIGHEST = last in line to be called
kind of confusing
Or you can setup your own Jenkins pipeline 
can you elaborate
What tab is that
tools
Ty
Hello guys i'm back again 🙂 i need help to add and remove attribute modifier when entering water the event i did (and it doesn't give attribute to my boots ) :
@EventHandler
public void inWater(PlayerMoveEvent e){
ItemStack waterBoots = new ItemStack(WaterArmor.waterBoots());
Player p = e.getPlayer();
Location loc = p.getLocation().subtract(0.0,1.0,0.0);
if(p.getLocation(loc).getBlock().getType() == Material.WATER){
ItemMeta changeMetaWB = waterBoots.getItemMeta();
changeMetaWB.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier("SpeedEffect", 1, AttributeModifier.Operation.ADD_NUMBER));
waterBoots.setItemMeta(changeMetaWB);
}
}
Do you set the boots to the player? I don't see that here just creating a pair of boots and setting it's attribute?
i have the boots on me
is there a library or API to customize mobs easy?
Customizing like NMS can do
How do you have the boots on you?
Crafting it
?paste
Okay? But how are they going to get the meta from your method here?
You create a new itemstack and set it's attribute and then that's it

tell me if i'm wrong but, i need to check if the player have the boots and then if it have the boots get the player inventory and boots slot to add attribute to the boots
Bingo
Thx !
Anyone know if i can find some old mappings? Im not sure what this is from 1.16.4 to 1.18.2
However, you might want to be careful cause if it gets the attribute and then they leave the water with them off they keep the effect. Make sure to add a remove as well.
Yes ! I'm not forgetting about that !
https://paste.md-5.net/oquyujujij.java
I have a flyingFeather here for when player right click it they can fly, but it also drains their mana, there is a problem I am having where if they disable their flying, and re-enable it, the runnable runs twice, and drains double the amount then what it should be. this goes the same for the combat log when they turn flying on again.
any ideas on how to make the runnable only go once if they decide to fly again?
didnt realise, i'll check that out thank yoi
i have the mapped mojang, i just wanna know what it is as that variable doesnt exist in 1.18
but i need to give the attribute 1 time, it is giving me 1000000 times the attribute, how to lock that ?
Check if it has it to begin with. Use PDC or something.
i did that :
if(p.getLocation(loc).getBlock().getType() == Material.WATER && !(p.getInventory().getBoots().getItemMeta().hasAttributeModifiers())){
ItemMeta changeMetaWB = p.getInventory().getBoots().getItemMeta();
changeMetaWB.addAttributeModifier(Attribute.GENERIC_MOVEMENT_SPEED, new AttributeModifier("SpeedEffect", 0.2, AttributeModifier.Operation.ADD_NUMBER));
p.getInventory().getBoots().setItemMeta(changeMetaWB);
}
but now i have another problem it give the attribute 6 times
i have a plugin simulating walking by setting the npc's velocity every tick, but i noticed that its interfering with the npc's knockback
how would i go about fixing this problem while still being able to make the npc walk
this is my code atm (sorry its kotlin)
private var motionX: Double
get() = player.velocity.x
set(value) {
player.velocity = player.velocity.setX(value)
}
private var motionY: Double
get() = player.velocity.y
set(value) {
player.velocity = player.velocity.setY(value)
}
private var motionZ: Double
get() = player.velocity.z
set(value) {
player.velocity = player.velocity.setZ(value)
}
fun move(strafe: Float, forward: Float); // move method (run every tick)
?paste
is Playerpoints still a good api
I think you should use path finder instead of hacky velocity set every tick, that should work i think, although i never touched that
question how do i make my server allow bedrock players and will allowing bedrock players break any plugin on the server?
and MONITOR is the LAST LAST
in line
yeah
use with caution kids
dont go to the very extreme if u dont need to
to still allow plugins to get infront andbehind you easily
Whats the method to get entity slices in 1.18.2? I can see it in 1.16.4
cant find it here though https://nms.screamingsandals.org/1.18.2/net/minecraft/world/level/chunk/LevelChunk.html
perhaps it doesnt exist lol
is there not an alternative
i was thinking about that, but the pathfinder that citizens implements makes the npc walk to a location
but im trying to just make it walk in a direction based off some external input
it works fine atm except for it negating knockback
as i already said, i dont have experience with that, but it's obvious, that since u set velocity every tick, then the velocity recieved from knockback is discarded, im not sure whether u can fix it without using path finding api. if u want npc to just walk straight u can as well make it to walk to the location of the block in front of him every n ticks ig
get the current velocity
decay it
apply gravity velocity
apply path finding velocity
Anyone know why it give me attribute 6 times ?
attributes are cumulative. if you add it more than once it will add up
you didn;t set a slot on teh attribute
you can ??
addAttributeModifier(@NotNull Attribute attribute, @NotNull AttributeModifier modifier)
oh
i was using the first one
ty
Elgar ?
public AttributeModifier(@NotNull
UUID uuid,
@NotNull
String name,
double amount,
@NotNull
AttributeModifier.Operation operation,
@Nullable
EquipmentSlot slot)
"Double amount" when i put 0.2 it give me A LOT of speed, do you know why ? i need to be like the effect of speed 1
Add
0.2 is quite a lot to add. Its a quater block per tick
How to get the speed of speed 1 potion ?
if you use MULTIPLY_SCALAR_1 and set 0.1 it will increase your speed by 10%
so to match a potion use MULTIPLY_SCALAR_1 and 0.2
yes, add is a fixed speed increase
scalar is a percentage increase
you don;t sort them, you add them as scores
So to do it with strength it's GENERIC_ATTACK_DAMAGE ?
yes
how do you stop a runnable? I have an event and when it triggers twice the runnable triggers twice
?paste
Hello, Could you send me a link where I can download bungeecord 1.16.5? Please
hay fellas so i got a question here. i have worked with holograms multiple times and each time it has just been such a humongous pain in my ass. they were always either despawning, not spawning at all, duplicating like crazy?. can any1 here tell me what a good approach would be to have a hologram in the game that is easily editable?, thanks in advance
yea kinda noticed that
armorstands?
but there like has to be an acceptable way of doing it thats not bugging like shit
well yea
i got that far
For holograms you might just cave and use HolographicDisplay's API, it's really easy to use.
armorstand as packets
ya did that before. but i kinda dont wanna rely on on that plugin being installed
never did that before. tbh never rlly messed with packets at all before
how would that work
you want to if you are doing something like holograms
right so probably just need to sent a packet to every online player to show the fake armorstand then right?
that would be a good start
is there not a way to only show if the players are in certain range
though that would probably require checking if players are near on a certain interval
do you happen to know if getNearbyEntities is an expensive operation?
it shouldnt be
well, it isn't
solved.....
Hello i was wondering if there is any good and clean way to make alot of itemstacks with itemmeta or if I just have to make a void for each one
probably my best bet to just sent that packet to players in range then
can do an Array? I'm not 100% tho I could be wrong.
yes and iirc getNearbyEntities is asyncable
hmm yh good point
but that shouldnt be needed
is there a limit on the amount of recipes i can add?
technically yes
but indeed pretty much no
-.-
;0
^
mhm... well I can't get one[4] of my recipes to craft
the recipe shows but the result doesn't come out...
so i thought there would've been a limit... guess not tho.
show some code
ItemStack or the Recipe?
show the recipe
public class HolyBootsMythicRecipe {
public static void HolyBootsManaRecipe() {
ShapedRecipe HolyBoots = new ShapedRecipe(new NamespacedKey(Wired.getPlugin(), "HolyBootsMana"), new ItemStack(HolyGrailBootsMana.createHolyGrailManaBoots()));
HolyBoots.shape("BBB", "BDB", "BBB");
HolyBoots.setIngredient('D', new RecipeChoice.ExactChoice(HolyGrailBoots.createHolyGrailBoots()));
HolyBoots.setIngredient('B', new RecipeChoice.ExactChoice(ManaFragments.createManaFragments()));
Bukkit.addRecipe(HolyBoots);
}
}
They are a lovely problem managing them they always cause issues
and what does HolyGrailBootsMana.createHolyGrailManaBoots() do
that's the itemStack for the item
show that too
How can I detect a change in the ender dragon phase?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/EnderDragon.html
declaration: package: org.bukkit.entity, interface: EnderDragon
?paste
declaration: package: org.bukkit.event.entity, class: EnderDragonChangePhaseEvent
huh, looked for something like this and couldnt find it, thanks
i think your asset meta != null might be failing
never had any
since its a new item it has no item meta
oh shoot forgot to change that to an if statement
been meaning to stop doing that as well..
only air has no itemmeta
will getItemMeta not return null on new items?
nope
well this can't be because i don't have it on the chest plate and it neither gives me the recipe
getItemMeta only returns null for air
yep im wrong abt that one
ah alrighty... back to the drawing board..
everything is done the exact same as all my other recipes I copied and pasted changed everything that needed to be.. the NameSpacedKey and the recipe+result. so like idk what could be going wrong
alright i'm a bit late to the party but i've just worked on a few recipes, what's the prob here?
lemme read up for a bit
👍
u did change the namespaced key from ur other recipes tho right?
yes it is
these boots are a copy, they just have more health, armor, and give more mana
so if i'm understanding correctly, you put the items in the crafting grid and it just does nothing?
so i added Mana at the end of the namespae
correct
are you sure ur imputting the exact correct items then?
can you click the recipe and do the items go in?
recipe book isnt so most reliable afaik
nope...
at least for me i have some issues
the recipe book showss that the recipe exists...
but if you have the "real" materials the book will fail
like, your recipe will prefer to grab vanilla boots for the recipe instead of the actual "modded" ones
also
try removing the "new ItemStack(holy grail)" to just holy grail in the shaped recipe creation
alright im restarted and trying it
did nothing
would you be willing to get in a vc ? might end up being faster than messages back and forth
yeah give me 1 min
Hi ! I need to check if player equipped or not a custom armor, how can i do that the better way (without 1000 if else)
by checking if the equiped itemstack has a certain pdc tag
Pdc ?
?pdc
PersistentDataContainer
Wow how can i use that ?
read the guide ?
Did read it i'll try if it doesn't work i'll come back, thanks
good luck 🙂
For the ```java
NamespacedKey key = new NamespacedKey(pluginInstance, "our-custom-key");
Hmm, basically you might wanna do stuff like
NamespacedKey itemIdentifier = new NamespacedKey(pluginInstance, "customItemIdentifier");
or smth
if you can about identifying different items down the line
that way a) each item can have a unique string id under that key and b) if an item has anything under that key you know it is a custom item
Ye but for each piece should i use different key or same key ?
Well in the case of a key like customItemIdentifier
you'd reuse the key
and change the value
you need to know the key to lookup the value in the end
so a unique key for each item doesn't make much sense
but same key with different value make sense, right ?
Yea
Wait when you said (pluginInstance, "customItemIdentifier"), pluginInstance refer to what ?
your plugins instance
*JavaPlugin that is
The main ?
Hello, I got an encoding error -> in console, "é" are "├", any idea please?
my start.bat -> java -Dfile.encoding=UTF-8 -jar paper-1.8.8-445.jar
i have also compileJava.options.encoding('UTF-8') in my build.gradle
?1.8
Too old! (Click the link to get the exact time)
Search in old forum posts from half a decade ago
no
And make sure you have utf-8 file encoding
yes the instance of your main plugin
?paste
can someone help me with custom inventory
i cant set itemstack to inventory slot
provide code
CAn someone help ne whit nexengine i cant find it for 1.19
what ? xD
@mellow pebble ?paste
Is there nexenngine for 1.19
.
Tha fk is nexengine?
Hello !
I have a little question about Maven
Can I use it to write things in a YAML file by himself ?
Something like plugin's name and plugin's version 🤷♂️
Example:
# Configuration file for ${plugin.name} ${plugin.version}
some plugin 🤷♀️
no
maven is used to add dependencies and repositories to your project
for example if you are making minecraft plugin
🤷♂️ ask the developer lol
you use maven or gradle to add some plugin as dependency
I know what is Maven, but I was just wondering if it was possible
like LuckPerms or Vault or something like that
nope
lol
You can write your own maven plugin that does this
yes it is
Oh alright
aaaaaaaaaah
With a custom plugin or with Maven himself ?
well, "maven himself" wont give you much
A hacky way would be using the surefire plugin
why would you write things to YAML file when you have already plugin name and version in "written" in POM with maven
f.e.
name: AntiAC
author: Luziferium
version: ${project.version}
Thank you
@quaint mantle did you find what is wrong
What's your problem exactly ?
Your code is a bit hard to read
take a look pls
i cant set slot index to that custom inventory
i made custom inventory and itemstacks and added meta and lore and everything
repost your problem
.
Which item exactly ?
Do you have any console error ?
no console errors kitmap hcf and practice item stacks
or as item in minecraft diamond chestplate sword and potion
you already set them and now are overriding them with #setContents
For this i think
so i should remove set contents ?
yep
👍
What is the name for the packet that is send when a block is moved by a piston? Basically I want a group of blocks to be pushed by a non-existent piston.
Block action
well sorting can be done like this where map is your hashmap
List<Map.Entry<UUID, Integer>> list = new LinkedList<>(map.entrySet());
list.sort(Map.Entry.comparingByValue());
HashMap<UUID, Integer> temp = new LinkedHashMap<>();
for (Map.Entry<UUID, Integer> entry : list) {
temp.put(entry.getKey(), entry.getValue());
}
//temp is now sorted
danke
You will probably have to replicate this movement by using FallingBlocks to be honest
is it possible to register a custom enchant so that it can be used in an enchantment table?
Yes. But you can also use events for that.
alright, Im gonna try to look more into it
So I got an issue, I made a merchant.
And I spawn a villager with custom trades, the trades work,
but for some reason when I open the village it immediately closes the menu.
Merchant villager = (Merchant) p.getWorld().spawnEntity(loc, EntityType.VILLAGER);
List<MerchantRecipe> recipes = new ArrayList<>();
MerchantRecipe bread = new MerchantRecipe(new ItemStack(Material.BREAD, 3), 10);
bread.addIngredient(new ItemStack(Material.EMERALD, 10));
recipes.add(bread);
MerchantRecipe tntStick = new MerchantRecipe(ItemManager.CreeperGun, 10);
tntStick.addIngredient(ItemManager.Wand1);
recipes.add(tntStick);
villager.setRecipes(recipes);
}```
Any exceptions?
nope
what type is the villager
like what is his profession
I believe villagers need a profession to have trades
WHo tagged me?
wel non its a non profesion village but if i click him like i wanna trade i see te gui with the custom item but it closes automaticly 0,1 sec later.
Try giving the villager a trait
in survival mode u cant even get a menu
no clue u need to look at docs
when i give it a proffesion it gets the normal trades
first add the profession then add the trades
or u mean like it has ur trades AND normal ones?
no so wait let me show u my event
@EventHandler
public void onClick(PlayerInteractEntityEvent e) {
Player p = e.getPlayer();
if (e.getRightClicked() instanceof Creeper) {
if (p.getInventory().getItemInMainHand().getType() == Material.STICK) {
Location loc = e.getRightClicked().getLocation();
((Creeper) e.getRightClicked()).remove();
Merchant villager = (Merchant) p.getWorld().spawnEntity(loc, EntityType.VILLAGER);
List<MerchantRecipe> recipes = new ArrayList<>();
MerchantRecipe bread = new MerchantRecipe(new ItemStack(Material.BREAD, 3), 10);
bread.addIngredient(new ItemStack(Material.EMERALD, 10));
recipes.add(bread);
MerchantRecipe tntStick = new MerchantRecipe(ItemManager.CreeperGun, 10);
tntStick.addIngredient(ItemManager.Wand1);
recipes.add(tntStick);
villager.setRecipes(recipes);
p.spawnParticle(Particle.END_ROD, e.getRightClicked().getLocation(), 30, 0, 1, 0, 0.2);
}
}
what i want to do when a player clicks a creeper with a stick it summons a villager with custom trades
where do u set the profession
it does
theres a method
called literally setProfession
I recommend looking at the docs for a villager entity
declaration: package: org.bukkit.entity, interface: Villager
u should cast to a villager btw
not a merchant
heyoo
Didn't find a solution, the problem was identified though
RecipeChoice.ExactChoice with custom armor pieces never seems to be able to match
Seems kind of odd. Are you sure the durability matched?
items are both brand new
we tried to also give the item straight out of the recipe choice and manually call the Predicate's test method, and although it returned true, it still wouldn' tcraft it
the recipe shows up correctly in the recipe book
and storing the armor piece in an inventory and retrieving it makes it now fail the predicate's test
Did you tag me bro?
negative good sir
@sterile token
Allright thanks man also sorry for pinging you ❤️


and ComplerableFuture is basically async in JS