#help-development
1 messages · Page 482 of 1
can anyone help me?
no, you didnt ask any question
.
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
there is no system updates in appearance
just use jetbrains toolbox
oo found it , my bad
Hey,
does anybody happen to know what setDefaultBackground() is supposed to do for org.bukkit.entity.TextDisplay?
I've printed isDefaultBackground() in both true and false scenario.
Am I misinterpreting something?
https://gyazo.com/1c05c9bebc3511612f0841b86ddb3c55
https://gyazo.com/357c484eb3778a2881473c193ee55c90
have you tried to set a background color with .fromARGB(0,0,0,0)?
Hi, im using the click event for a map, but when i left click is not detected but the right is correct
?paste your code
probably there just is no left-click event for the right hand
iirc you can only use the offhand item by right-clicking, not by left clicking
so what action i can use as a substitute shifting?
What I tried to suggest is divide it by 45, then round up or down to the closest 45 degrees. 🤷♂️
E.g 120 degrees
Int startingAngle= Math.ceil(angleFacing/45)*45.
Now I just realised round is better lol
So.it will snap to the closest 45 degrees
With the power of math I just bonked a switch case into one line 😎
oh no , i forgot what was gradle and marven
dm me if anyone can help me
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
there isnt really an unbaised way to say which to use
personal preference
Marven is the best build tool
Ah so he builds a typical plugin api. Most of them are brick walls 😭
Most users are brick walls
Especially worldguard
The help-development try not to be a brick wall when given an answer to your question challenge
Guys why my plugin no load?
Dude just go look up the lands api documentation 😭
You coded it in vba
Okay but why it no load
"That isn't a code steve you literally wrote a wish list of features in a word doc and threw it into intellij"
Update Marvin
Why the fuck should I tell Marvin he will laugh 😭
I want a man named Marvin to do all my compiling for me
I'll legally change my name if u pay me.
I‘d pay 7€ for this
But fr one of yall better make a maven qol plugin for intellij and call it Marvin right now!
9€ if you do it today
Hm, there is something that bothers me in maven.
But I won't do it - for now.
what should that plugin do though?
I don't know... ask marvin
Also u never commented on my 45 degree fix.
WITNESS ME! 😭
well it wasn't me who needed it lol
Don't make that poor man do a giant ass switch case kmao
Guh ?
The bit he was struggling with was getting his snapped 45 degrees
Not the left or right b
Bit
hey , i test my plugin on a online server so is there any way to automatically upload the plugin instead of dragging it on the website after building?
I used gradle tasks and a python script
I'd just sshfs the server, then use the maven-jar-plugin to change the output dir
Hey, i am using version 1.16.5.
I have an error in this code:
PersistentDataContainer test = block.getState().getPersistentDataContainer(); ("Cannot resolve method 'getPersistentDataContainer' in 'BlockState'")
but if i use instead this:
PersistentDataContainer test = block.getState().getChunk().getPersistentDataContainer();
it works. but i dont want to save the whole chunk, only the block.
Any ideas?
You gotta make sure le block
is a TileState
TileEntity
etc.
If not, it does not have a PDC
Im here lol
alright, thats the problem. but are there any other chances i can use PDC on a single door?
Chunks can have PDC?
ye, world too.
If it's within a chunk
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
Bigger
that for specific blocks that dont have a container
thank you
Hey, What is spigot API 1.19 for actionbar please
If ur at 80 ud get 90
Then I have the angle, and gotta make a switch-case vector out of it? Lol
Or u know, a 4 item HashMap<Integer,Vector>
Then get for int(angle)
Yeah that works too
How do I now find out the vectors, find out by doing?
trying out lol
How do you mean what are u trying to do again and what data do you already have?
I just have the player and wanna know what Vector I need to apply to a location to move it left/right relative to the player's direction
And do you already have a method for what direction they are pointing?
Ngl this sounds like a , just to be utterly sure it is what we think it is, a drawing a diagram situation
why decompiled class can be found $ number
Like a class named Test and another in the same directory called Test$1 but totaly different
Nope
But heres a drawing
im guessing its the id of the class, like you cant have multiple classes named the same thing
I just know that $1, $2, ... CAN stand for id of instance
so probably in the jar there are two Test class and java as a protection calls one with $1
So for example 3rd instance of Object TestObject created
But its different for decompiling, its some completely different mechanism
so the class the two class are called test
^
I sadly don't know much about how that works /:
is their a way to store a uuid inside an arraylist permanently
bc after reloading/restarting it just removes it from the arraylist
Well, yea. That's how they work.
You need to write the data to disk and load it back into memory if you want to use it after a restart.
and how to do so?
save them in a file or database like cache.yml and then on load make a system to reload back it
^
hmm
You can use the default config if you want.
gotta try it
When I broadcast playerPlacedBlocks in the onBlockPlace function it sends the right list but if I broadcast it on the Mapclear function it sends an empty list. I think it is a problem with the scoop I will really appreciate any help.
private List<Location> playerPlacedBlocks = new ArrayList<>();
public MapClearTiming(Plugin PluginMain) {
plugin = PluginMain;
}
public void onEnable_MapClear() {
playerPlacedBlocks.add(new Location((Bukkit.getWorld("KeepInvt")), 69, 69, 69));
new BukkitRunnable() {
@Override
public void run() {
new BukkitRunnable() {
@Override
public void run() {
mapClear();
}
}.runTaskLater(plugin, 30 * 20L); // 30 seconds = 30 * 20 ticks
}
}.runTaskTimer(plugin, 8 * 60 * 60 * 20L, 8 * 60 * 60 * 20L); // every 8 hours = 8 * 60 * 60 * 20 ticks
}
public void onDisable_MapClear() {
playerPlacedBlocks.clear();
}
@EventHandler
public void onBlockPlace(BlockPlaceEvent event) {
Player player = event.getPlayer();
if (player.getGameMode().name().equalsIgnoreCase("SURVIVAL")) {
playerPlacedBlocks.add(event.getBlock().getLocation());
Bukkit.broadcastMessage("Place block "+ playerPlacedBlocks);
}
}
public void mapClear() {
Bukkit.broadcastMessage("mapClear "+ playerPlacedBlocks);
for (Location loc : playerPlacedBlocks) {
if (loc.getBlock().getType() != Material.AIR) {
loc.getBlock().setType(Material.AIR);
}
}
playerPlacedBlocks.clear();
}
}```
?paste exists for a reason.
did you register it?
You do know what #clear() does right?
It clears the list. So ofc it would sout nothing.
Everything is working well except the playerPlacedBlocks are different for some reason
But it's after the loop finish
That doesn't matter. Yes, you are setting the blocks to air, but you are clearing the list right after. So the list has 0 elements in it.
I know that was my intention I am saying it clears itself before the loop
Bukkit.broadcastMessage("mapClear "+ playerPlacedBlocks); it broadcast empty list
Hmm
how you call them? like a command or something and if you can provide that please
?paste
Sure
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
public class MapClearCmd implements CommandExecutor {
private Plugin plugin = null;
MapClearTiming mapClearTiming;
public MapClearCmd(Plugin PluginMain) {
plugin = PluginMain;
mapClearTiming = new MapClearTiming(plugin);
}
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (cmd.getName().equalsIgnoreCase("mapclear")) {
if (!(sender instanceof Player) || sender.hasPermission("server.mapclear")) {
Bukkit.broadcastMessage("called mapClear");
mapClearTiming.mapClear();
Bukkit.broadcastMessage("§3Map clear!");
Bukkit.getOnlinePlayers().forEach(player -> {
player.sendTitle(ChatColor.BLUE + "MapClear!!!", "Go to spawn", 5, 40, 5);
});
return true;
} else {
sender.sendMessage("§cYou don't have permission to use this command.");
return true;
}
}
return false;
}
}```
I am using different class for the command
Shouldn't the #onCommand() method be annotated with @Override?
Doesn't matter
^^^
Well, if the map is empty when it shouldn't be, that generally means that something else has removed elements from it or called #clear() from somewhere else.
is the class with implements Events?
What other classes utilize MapClearTiming?
Only my main with very simple code
?paste it.
The MapClearTiming implements Listener and MapClearCmd implements CommandExecutor
ay
is there a event that gets called
like when the player is joining the game
like before the player is even loaded in
can i stop the player from being loaded and do stuff
AsyncPreJoiNEvent
can i stop the player from joining and do stuff? i can right
declaration: package: org.bukkit.event.player, class: AsyncPlayerPreLoginEvent
you can disallow
iirc disallow just stops it there
why would you want to do that
whats your sql statement
INSERT OR REPLACE INTO users (uuid,kills,deaths,gems) VALUES (?,?,?,?);
that should work
help
which folders exist when you create a gradle project
i only know the maven stuff
all 4 basically
it adds a new one every time i join my server
try INSERT OR UPDATE
i would guess the same right
Better way to do
SELECT * FROM foo WHERE faa = x OR faa = y OR faa = z?
i can test it rq
thankz
so no test folder
and no resources
i have this in eclipse
test java
and main java
can you open the project in explorer like me
and look it up
plss
@remote swallow
all of them
sure?
same for maven
no clue
?
maven might only be main resources and src
not 100% sure about that though
forger about it
maven has all 4
src main and src test subfolders
oh ok
A little late, but
SELECT * FROM foo
WHERE faa IN (x, y, z)
I got it, but ty still
o/
why it returns null?
it will return null if the key doesnt exist
the entity doesnt exist then
It's not the config option that's null
You would have gotten an IllegalArgumentException from UUID#fromString() if it were
The entity you're trying to get is likely in an unloaded chunk
Then what should I do?
But how can I apply it in my case?
I need to find the entity from the start, not after the player has loaded it.
theoretically, if the entity is null, then I can schedule a loop that will look for that entity until it is null?
what is a negative potion effect?
a "bad" one?
because which one is good and which is bad also depends on the entity. poison is bad for players but good for "undead" entities (or if it not poison, then it's insta damage or sth like that)
read what he said
Is there a reason why if I cancel PlayerItemDropEvent, and the player is not looking at a block, it triggers PlayerInteractEvent?
well just create a list of it?
private static final List<PotionEffectType> POTION_EFFECT_TYPES = Arrays.asList(
PotionEffectType.ABSORPTION,
PotionEffectType.BLINDNESS,
PotionEffectType.CONFUSION);
I mean yeah but you could also do the smarter thing and listen for the EntitiesLoadEvent which is called when entities are loaded lol
Can anyone please help me upgrade my plugin to 1.19.4 if its possible?
my pom.xml: https://paste.md-5.net/onowesoyar.xml
Should be as simple as finding and replacing 1.19.3 with 1.19.4, danko
oh yeah?
with the --remapped flag
where do i run it
Anywhere that's not a protected folder or onedrive
didnt bro already say that
also stop running stuff like this as admin
you have to open cmd as admin to get it in sys 32
no, when you open cmd it opens it in your home folder
it does not "do this by itself"
you opened it as admin on purpose
I am pretty sure you can't create a subdir in sys32 if you are not admin
ofc not
they just ran everything as admin and then installed buildtools to C:\Windows\System32 o0
So yeah, you defo have admin perms there
How do i get the title of an Inventory?
InventoryView#getTitle()
if I ran BuildTools what now? do i just put 1.19.4 everywhere and reload maven?
interacts with dropping the item
did you run 1.19.4 --remapped
is there a way to disable it?
reload files and maven
listen for playerinteractevent and then cancel it
I'm making a function to clone inventories
does anyone know how bat behaviour works in minecraft
can they go to sleep if you are near them?
yes
when they hang upside down in a cave or smth
I don't think so
Cuz they wake up when you walk near them so it wouldn't make sense for them to fall asleep near you
yeah would it be changeable with nms
you can try enclosing one in a 3x3x3 space, stand still inside and see if it ever chills out
mm nms i have no experience with that much less any knowledge of what it is
ima dip XD
setResting(boolean) on the NMS bat
h ccool
but why use NMS for that
is it in spigot
yes
yup
sometime, yes
I'd just use a repeating task
yeah wonder if it will look buggy tho
like if you had high ping
then it might look weird
or setAI to false
thats a inheriting method or what
although then it also won't have gravity anymore. although idk if bats have gravity in the first place
setAI is from LivingEntity
ok let me tr ysomething
what version was it implemented in
does Ambient extend LivingEntity
how do i insert or ignore in sqlite
woah how'd you do that
alright
how do you get those?
right click any class name, then Diagrams ->
ty lol
I don't see it
then it's probably ultimate version only
oh yeah probs lol
*poor moment*
check if you can find this plugin in the community edition
to get jetbrain products for free
lol fr
my uni doesnt have any contract regarding the supplying the jetbrain products
yet i still have access to them
because I count as a student
same, I have unlimited university email addresses
I didnt even study computer stuff but law
F. but there's a ton of other plugins out there, just enter "uml" into the marketplace
just add it as maven dependency
yea that's working fine
but it's never getting called and im confused how to register it
sorry to bother you guys but how would i send an actionbar using nms in 1.19.4
anyone know any spigot/paper forks that have PotionEffectEvents and EquipmentSetEvent support
did you register the listener?
import com.jeff_media.armorequipevent.ArmorEquipEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
ArmorEquipEvent.registerListener(this);
}
}
so when I do that, where is the event getting called
why, use the spigot method
Player#spigot().sendMessage()
isn't the spigot method deprecated
is it just called in any of the plugin's listeners?
Deprecated in Paper probably
you just listen to it like always
@EventHandler
public void onArmorChange(ArmorEquipEvent event) {
// Do your stuff
on paper yes, on spigot no
why have they done that
and that's just in any of my registered listeners?
yes, sure
in favour of adventures Components
do I call the register function before or after i register the listener with spigot
doesn't matter
anyone know any spigot/paper forks that have PotionEffectEvents and EquipmentSetEvent support
ill look into it i might be doing something wrong here
?paste your code
ill get back to you if its still not working
whats the 2nd one for
i think it might be something with my shading
setting equipment
where
oh alright what about potion effects
public void onEnable() {
ArmorEquipEvent.registerListener(this);
getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onChangeArmor(ArmorEquipEvent event) {
Bukkit.broadcastMessage(event.getPlayer().getName() + " changed their armor.");
}
this should work just fine
no idea, if none exist pr them
I'd have to see your full main class and your pom.xml
meanwhile jitpack is the biggest annoyiance
there's always that issue or two with it
everyone hates shitpack
I tried for like an hour
whenever I see some plugin telling me to use jitpack, I rather compile it from source and install it to my password-protected repo
For some reason there is more items in the destination inventory that items in source inventory, it doesn't scale linearly from what I saw, rangeing from 27 when I input 4 items(2-3 items gives the same amount of items on output and 1 doesn't transfer for some reason) to about 1.5 stacks when I input 1 stack, the amount seems to be consistent, I don't know what could be the issue here, there are no extra plugins and this is only listenner in the plugin, does anybody knows the issue?
Code:
https://paste.md-5.net/mebukadoci.cs (it was too big to post in this message, so here is the link)
Hello, how can I create structures with a structure block and saving it in my plugin to generate it in the world ?
found the problem
plugin just wasn't compiling
and it was using an old version
Oh lol ok
other dev forgot a semicolon
How did you not see that :p
wasn't looking at ci
whagt it jitpack
the shittest thing on earth
A „maven reository“
That tries to compile stuff on the fly from github
The idea is nice
But it only works like 30% of the time, at best
It usually fails when people use gradle‘s shadowJar without changing the classifier
😬
idk why its -all by default
Yeah its weird, idk
Did anyone ever want to depend on the no non-shaded version? Lol
ig
its probably what if you shade and relocate all of adventure
cough papi cough
[pluggyTesty] Failed to register events for class co.tantleffbeef.pluggytesty.ArmorEquipListener because org/bukkit/inventory/meta/trim/TrimPattern does not exist.
is this because I'm using paper
DJ woman
Never saw that message
Is that the full stacktrace?
Show your whole pom pls
?paste
isnt trimpatttern a 1.20 thing
yeah
yes
its in experimental
using experimental datapack on 1.19.4
oh
Oh then thats maybe the issue
the class should still exist wether its on registry or not iirc
choco you gone borked something
Are you on latest paper?
yes
wait
maybe not
i thought i just updated but it may have redownloaded the exact same version
one sec
yea that's what it is
sorry to bother you again but i got this error: Cannot resolve method 'sendMessage(ChatMessageType, String)'
should i just get player's stats in 1 preparedstatement and if they are null make another preparedstatement to insert the player
player.spigot().sendMessage(...)
the full line is
player.sendMessage(ChatMessageType.ACTION_BAR, calculateActionBarMessage(customPlayer));
it says it requires a "BaseComponent"
can you just cast a string into a BaseComponent?
can i do select uuid from users where uuid = ?
so how do i make this work then? the calculateActionBarMessage method returns a string btw
yes it does
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("My name is jeff");
sth like that
np
can someone help me with this ?
so this is my code: https://pastebin.com/ug613zis
this is the error: https://pastebin.com/vRifBqEd
Tldr: Im trying to schedule titles and sounds
?npe
The NullPointerException, (commonly referred to as NPE), is thrown in the following cases, but not sealed to: 1. null is passed into a method or constructor which does not allow it; 2. When trying to access a field on an object pointing to null; 3. Casting null to a primitive. See https://stackoverflow.com/a/3988794/17047120 for information on how to debug NPEs.
look for the Caused by: line
what's line 51 of HeartIncrementHandler?
If you paste the whole file, do NOT remove the imports
this is the line 51
"Bukkit.getScheduler().runTaskLater(pluginlistener(plugin), () -> {"
Looks all wrong
it looks like it
you are trying to cteate a new instance of itself using a plugin field you have not set
Wtf
thergonna be an npe ig you ever use plugin, idfk where the hearts or lifes maps are coming from
well what i can use instead of that
Read this pls, method #2 https://blog.jeff-media.com/getting-your-main-classes-instance-in-another-class/
after this line Bukkit.getPluginManager().registerEvents(this,p); add java this.plugin = p;
You tried to use dependency injection but you used a cursed method name instead of the constructor
public HeartIncrementHandler(MythoniaHearts plugin) {
this.plugin = plugin;
Bukkit.getPluginManager().registerEvents(this, plugin);
}
then in line 51 you can simply use plugin instead of pluginlistener(plugin)
can i ask non spigot relatet questions here?
yeah
i see, ill try that
im really confused rn my gf needed to make a calc in java for class and while i was trying to debug her code, i added a system.out.print msg. Now heres the weird part. When ever i leave it in the code works perfectly fine. But when i remove it it doesnt work at all
the sout is delaying something enough for it to work im guessing
Leave it be #devmoments
not working isn't very descriptive
then the "content" of the sout does logic. does it e.g. do "i++" or sth?
or call a method?
show the code
well you wont understand anything
she needed to use some dumb libary from our school
is the onEnable method not triggered on reload because when i reload i get an error that a value is null, which is set in the onEnable method?
you'd be suprised
Ich spreche deutch
forgor command
thats what alex is here for
or smth
?paste
im making a command /clan kick <playername>
factionManager.removePlayer(args[1], player); this is the method called when the command is ran
args[1] is a String, how do i make it a player
Yes onEnable is run on reload
do you mean /reload, or using reloadConfig() or sth?
/reload
then onEnable gets called
but reload is unsupported and it's known to cause issues
ok i'll check to see if i missed something
Bukkit.getPlayer(args[1]) or preferable Bukkit.getOfflinePlayer(args[1])
dont critic the code btw she started java yesterday..
i thought Bukkit#getOfflinePlayer
but doesnt that need uuid
setzeSichtbar etc is some GUI stuff. you should have all the code synchronized for it to work
It doesn't, it can also take a string, but UUID is preferred.
so yeah epic was right, it's probably the delay caused by sout
yh it just turns a button in invis. Thats how she managed to make "pages"
good thing alex is here, i haven no idea what this code does
what confuses me even more is that the codes works perfectly fine without the print on her computer
try to synchronize those methods, or better, use SwingUtilities.invokeLater(...) to open the whole GUI
what school is encouraging you to write code like this lol
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGui();
}
});
}
this is the proper way to open your GUI
she started learning java yesterday dont worry im already trying to educate her x)
oh i trough its some kind of uni, as you said school
That’s a lot of public variables
yep
Right i have been many hours of morning studying about internally Redis working, and i want to learn even more about it. So far i learnt that when you do some I/O operations like making use of the cache system or pub/sub the connection to redis server is blocked, until the response is done.
Why didnt they already implement a queue system based on some sort of socket or work distribuitor, so the connection get blocked?
thanks for that, it works
yh ig i just dont know why it works on her computer and not mine x) maybe because hers is slower?
like i care less about the issue then the fact that she can use it and i cant
i just dont get it
maybe versioning issues? or OS?
we both use the same shity stuff provided by the school for this
right
same "bluej"(really trash) same jdk and same libary
ok
and both windows 10
Maybe something stupid, but have you try restarting pc and running it again
Tf is bluej
you dont even want to know
Probably a code name
is an IDE for interfaces based¡
Some „education ide“
this is bluej
my eyes
for some reason its half german and half english too and i cant even change it
Is that
Remember we dont see sun light often
Bukkit.getPlayer(args[1])
i got it
Is that like one of those gui based editors
Yes, exactly that
Or is that a fancy UML tool
Arent you from south america lol
Yes, i mean we dont see sun light because we code all time not matering the time 😂
i dont even know what it is. it runs code. barely. thats about it.
i asked my teacher so many times if we can switch to intj or eclipse and he keeps saying yes but never installs it on our school pcs
lmfao
GPT being broken hahah
Must be broken GPT because that doesnt seen related to your issue
yh not really
Wait i will ask to it in a different way
ive never heard or seen it related to bluethooth at all
🤔
everythings blocked. cmd etc man even task manager
Damn, a school that has a competent IT department.
while(true)
consuming all processing power
i crashed bluej ones and i had to restart the whole pc because my teacher didnt understand how to let me acsess task manager
Java API for Bluetooth wireless technology lmfao
well doesnt explain why it runs on weaker pcs does it x)
What could be blocking a redis connection while doing pub/sub and cache updating at "the same", if so far i read redis shouldnt block the connection ¿?
but anyways, the reason it doesnt understand is because it's literally called "BlueJ" not "jBlue"
let me search the doc of this libary i think somewhere therese a pause thingy
so i can slow it down
oh i never realize that tho
btw i had my exam with that teacher yesterday and we had to code, ON PAPER
Okay definitly Jedis implementation totally sucks
can i clean this code up a bit? https://paste.md-5.net/cebikujire.php
like a 150 line code on paper
We studying computer science we code C++ on paper, you cant complain bruh
💀
Yeah C++ bruh most shity lang for me in terms of syntax
pangs, is that something eateable?
balls on plate
Lmao shity redis java implementations
I cant realize there is not shity decent library 😡

I tryed Jedis but is so beatiful that when you tell to do 2 different I/O operations get blocked the connection, and doesnt process any of them 💀
jedis pool ???
?english
Yes exactly, both of them get blocked
?learnenglish
found it
are you properly multithreading em
Isnt already mutli threaded? 💀
Shity library that why it get blocked
I didnt realize its not multi threaded, or atleast able to process many responses from redis server "at the same time"
okay so it works now
for the future i learned
bad pcs are better at java then good pcs


Well some things are better optimized for different OS
That why many developers prefers Unix based OS for programming
its the same os x)
how do i suppress warnings for experimental
my hypothesis is that there was so much lag it worked somehow
thats sounds stupid
well thw hole problem is anways
no? Windows is not based on Unix
how does async world edit place blocks asynchronously
it doesn't
?workdistro
it has a queue Async and places x blocks per tick sync
nvm
You cant place async blocks, because the server is not (designed) multi threaded
I don't think you can
yes
i feel like i remember someone mentioning it the other day
appreciate it
Its an api, but its based on spigot api 🤔
If im not wrong you cant place blocks async on minecraft
a Structure Block is just a type of Block, Structure is the template
that's what it sounds like
yea structures is what I need
use Bukkit.getStructureManager()
go slower
alright
a structure is multiple blocks
players won't be looking at it
I hope they are small structures.
if you do find a way, lemme know pls
u can
Upgrading from 1.19.3 to 1.19.4 spigot, entity.playEffect(EntityEffect.HURT); no longer works on mobsd and sometimes doesn't work on players. Could there be a reason why?
randomly generating a dungeon
but like not with spigot api in principle
and teleporting the player to it once its built
That what i mean
Sadly the structure API does not provide a way to place the structure over time
i really don't need to though
you could do it manually yourself using the pallete
Ha
no one's going to have it loaded
You wish it was that easy
i mean both pcs run the same os
im really more worried about client lag than server lag
but ill just delay it by more if its a problem
The main shortcoming is that the pallete is made up of virtual block states
play a little animation for the player while it builds
Spigot does not have any support for virtual block states
a BlockState you can retrieve teh BlockData
I see that my question will probably not be answered so here's a diffrent one that may give me an alternative approach at this:
Why neither Inventory.setItem() nor Inventory.removeItem() affect the source inventory from InventoryMoveItemEvent?
um true
could something like this come later as they are trying to make spigot support more customish items
and stuff
There is a WIP PR for being able to clone block states
Use the right inventory. InventoryMoveItemEvent#getDestination() & InventoryMoveItemEvent#getSource()
I used event.getSource() to get the inventory in the listenner
Virtual entities in structures also suck to work with
For the states you can get them into the world but not change their position
For entities you can change their position but not get them into the world
🙃
Could be because of this.
try to change the inventory a tick later
1 item is left in the source inventory
but at least it removes items from source inventory and doesn't give more items than were inputed
can pdc store a list of stuff?
You can create custom persistent data types on your own, or use one of the many libraries available which have implemented those which match your needs. Learn about more persistent data types here: https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/
how would i implement that myself tho
check the source code, it's on github
real
that's for all kinds of collections
how big is it shaded tho
What's up with the last PFP?
last pfp?
Yea
which one do you mean
That pink hair guy
i went back to this because someone on my server demanded to get rid of the rainbow flag in the server's pfp
so I am using a rainbow flag here too again
It's not something to show to anybody in my opinion, like I'm gay too but i don't want to promote it too much
nvm, anyway
I don't care what others think though
what's the best way to load schematics?
You have nitro don't you? You can do per server profiles.
fawe api?
WP, you changed it lol
Okey 
I need some suggestion for implementing async into a library. Its mainly need async because will work sending/receiving remote server data
Use executors and thread pools, completable futures, and locks if necessary.
For example in the case of Netty it makes usage of a custom class called Future if im not wrongly
Im planning to make some sort of it, the problem is that im not so sure if it will 100 necessary
Use Java's completable futures
Netty is very handy-written
Like they literally implemented Linux epoll natively
Right well can i get some recommendations based on what specific i will create, i will just describe it detailed
So you i can get a better help
how can i make a custom item unusable on vanilla recipes?
Rate the code, tell me what can be changed or optimized, thanks
https://github.com/Xemii16/eBedWars/blob/develop/src/main/java/com/yecraft/listeners/GameStatusEvents.java
add a PDC tag
Uh, see rainbow background 🔥
progress flag
right, well im mainly doing a Redis api over a redis client. So i wondering if it will necessary or not to implement an async way. Because so far the library has problems related to I/O operations. So if you try using the cache and pub/sub at "the same time". The redis client internally get blocked and doesnt process any of the responses
such as a NamespacedKey?
Do you really have coloured hair tho?
Well I tried half 9.3 blonde, it's not bad I like it
9,3 if not wrong
9.3 blonde
is that some kind of dye color or sth?
yes
I have no clue about it, I just let my best friend do it, she's dying her hair for 20 years now
and mine for 2 years or sth, idk
every once in a while she comes home with a new color and throws it into my hair and I'm usually like "ok, nice"
You are the test subject
naah she always uses the same color for herself
Before or after she uses it for you?
Not sure if that makes it better or worse
I'm fabulous in every color
public static void playerPetDoge(LivingEntity doge, Player player) {
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
Particle smoke = Particle.CLOUD;
Sound howl = Sound.ENTITY_WOLF_HOWL;
Sound poof = Sound.ENTITY_WITHER_SHOOT;
// push doge up slowly and make its exit
for (int i = 0; i < 7; i++) {
doge.setVelocity(doge.getLocation().getDirection().multiply(0).setY(1));
doge.getWorld().spawnParticle(smoke, doge.getLocation(), 10, 0.5, 0.5, 0.5, 0.1);
doge.getWorld().playSound(doge.getLocation(), poof, 0.75F, 1);
if (i == 6) {
doge.getWorld().playSound(doge.getLocation(), howl, 0.6F, 0.8F);
Bukkit.getScheduler().runTask(plugin, () -> {
doge.remove();
dogeRewardPlayer(player, doge);
});
}
try {
Thread.sleep(100);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
});
}
dogeRewardPlayer is somehow running twice (playerPetDoge is not being run twice)
mine too, we bleached it 3 times before dying it
add syntax highlighting pls
What’s with all the async
#playSound and #spawnParticle are fine to be ran async
dogeRewardPlayer(player, doge); is started inside the for loop
I don;t see hwo it could run twice as it only runs if (i == 6) {
If it runs twice you are running the outer task twice
is playerPetDoge called in the interct event?
the outer task is NOT being run twice (im pretty sure)
yes
?interactevent
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
ok ima do dat
The bot should just listen to the word „twice“ and then spam ?interactevent (… twice)
also is there a way for the player's "next death" to have a custom death message
Just mark the player with some custom data and use that during your death check.
or just remove it on said death
What if they do not die
i have a few questions
- is there any way i can sort this into different files?
- i cant manage to fix bugs such a:s custom items getting consumed in bulks of 5 instead of one, the items being usable on vanilla recipes, "meth" item not usable
https://paste.md-5.net/axahoxaran.cs
if you can help i'd gladly appreciate it
Hi, i want to add Protection to the helmet but with this code the helmet still the same
https://paste.md-5.net/ranepesego.java
Som1 know why ?
I want to add armour protection
1st of all, move the listener stuff into its own class
wdym...?
Add enchantments on the ItemStack directly and do it after you set the item meta. Setting enchants on itemmeta is bugged.
?
that's not how you do tasks
Or at the very least never really worked correctly in the first place.
Wdym by after the item meta ?
I mean, set your item meta using ItemStack#setItemMeta(), then directly after that call itemStack#addEnchantment()
"methsmp" 💀
I am almost certain that just clones the item meta again and then sets it there
So... yeah
I want to add armor protection not the enchantement, the attribute
well its done now
edit attribute then ig
ik, its an smp with friends and they decided that would be the name, so i just went with it and made custom items (but since im new to all this its very glitchy)
That is what im doing
Then use ItemAttributes not enchantments.
Oh, well you never apply it to anything. You just created the variable and left it sitting.
yes
ItemMeta#setAttributeModifiers()
ItemMeta#addAttributeModifier
ok thanks
hey guys could someone explain wtf is this happening?
i have this method here:
@Nullable
public Player getOwner() {
String uuid = pdc.get(ClaimKeys.claimOwner, PersistentDataType.STRING);
if (uuid == null) return null;
return Bukkit.getPlayer(uuid);
}
so this method:
public boolean isClaimed() {
return getOwner() != null;
}
should return true if getOwner doesnt return null right?
However no matter if owner is null or not it returns false 😐
hover on th error
The first one is just Attribute.WHATEVER
?
Material?
even with the #isDead(), if the hit killed the entity, it still goes ahead with the code
check if health = 0 maybe?
damage is not applied until the event finishes
get players health - event.getFinalDamage()
its remplacing the part of the armor so
Material = diamond helmet by example
that method has nothgin to do with Materials
the entity s not a player, its a wolf
Read the parameters.
it doesnt have #getHealth()
The javadocs tell you exactly what to use
Cast to Damageable
Or just LivingEntity
So what im supposed to put
meta.addAttributeModifier(modifier, "generic.armor");
?
?jd-s
Read
alr
I already posted the method from the javadocs. I highly encourage to look at that one first.
anyway to add a component to lore, for a keybind
any way to stop this console spam?
Is that not an sout?
What's a more efficient way to set a custom block texture using ItemAdder
Than creating a new block and using .place
And no, asking in itemadder discord is not a alternative...
I just want to update the texture
Is replacing the block the only way to update the texture live?
mc sends death messages of named mobs to console
Iirc there is a setting for that in one of the configs
"There is a log-named-deaths option in the very latest version"
its spigot.yml
how can i get the keybind of a player as a string that could be used anywere, to stringing a base component doesnt work
The server has no access to client key bindings
Keyboard? AFAIK you have no rights to get player keybindings
You can use the Keybind components
i have one but cant add it to item lore
frick
Go bug choco about his PR :p
i need it 1.18
Wtf Is keybind component
It translates to whatever key the user has bound to that option
does something exist that does the nms or shows me the nms
Oh that's neat
For example key.jump will be Space most of the time
Like this
?
Im going to try
anyone got modding tutorials that arent from the 18th century
débilos
Is it meant to not work?
no i just wanted to try and send you the result 😉
croc and balls moment
Can we add durability to item ?
This one ?
There is no attribute for durability
yep but is there a way to add durability ?
You would need to make a custom durability system using the Item damage and item mend events
GENERIC_ARMOR_TOUGHNESS Armor durability bonus of an Entity.
?paste
That does not effect how much durability the armor has
Armor toughness reduce damage of "big" attack if i remember good
My nms is relocated, and working correctly, except for this
um I guess not. it's only the entity durability
"Armor can further protect the player through a second attribute, generic.armor_toughness. Normally, armor nullifies a lesser portion of damage from attacks that deal greater damage.[1] Armor toughness resists this effect, mitigating the power of strong attacks."
so which are you after? Durability of the entity or the armor piece to take more damage?
whats up,
minecart.getPersistentDataContainer().set(key_id, PersistentDataType.STRING, playerVehicleData.getUuid());
System.out.println(minecart.getPersistentDataContainer().get(key_uuid, PersistentDataType.STRING));```
thats my code. but the sout prints null
wow
hahahahaha
i think thats the problem
the code is to long, so i havent seen it
SynchedEntityData dataWatcher = new SynchedEntityData(null);
Does reloading possibly mess with this?
If it's NMS, probably.
Restarting to test
I'm using nms in 100s of other things, it's weird that it happens so randomly
https://paste.md-5.net/odemopanos.cs
Why is this code not giving me the item I click?
BottomInventory returns the player inventory, while having opened a chest or ender_chest
TopInventory returns the chest or ender_chest
That in case of talking about custom inventory working
So what its exactly your expectation to do? Would you work with player inventory click or custom inventory click?
@remote swallow
I'm using minimessages/adventure api for holograms, same thing applies
im at all costs trying to avoid nms
as you shud
if i have to use nms im just gonna add it to my lib

Because spigot will never support components
not true components are in the work actually
i could even use bungee components
choco is just taking a while
They have been
Choco said
He stopped working on it
lol
It's not happening, so I just implemented it myself into my lib
I actually implemented adventure into 1.19.4 holograms too
So now using minimessages/components in holograms is super simple
I'd be more apt to use adventure if it wasn't so massive