#help-development
1 messages · Page 45 of 1
The EntityDamageByEntityEvent might still be called in a cancelled state. I could be wrong about that, but sometimes they do still get called
that didnt work either
how can i save a resource to a specific directory
That method pretty much only returns false if the BlockBreakEvent was cancelled
wait i might've figured it out
It will return false if:
- the BlockBreakEvent is cancelled
- the player is in creative mode with a sword in hand
- the block is air
- the player isn't able to break blocks in that area (including spawn chunk protection, spectator mode, adventure mode CanBreak tag violations, etc.)
So if any of those are happening, that's why it's not working for you
for (Entity e : player.getNearbyEntities(blocksDistance, blocksDistance, blocksDistance)) {
if (player.hasLineOfSight(e)) {
EntityDamageByEntityEvent ev = new EntityDamageByEntityEvent(player, e, EntityDamageEvent.DamageCause.CUSTOM, ((percentDamage/100) * effectiveness));
Bukkit.getPluginManager().callEvent(ev);
}
}```
player.hasLineOfSight seems to work no matter where the entity is?
shouldnt it just be true if the entity is infront of me
How would I make it so the entire time an egg is alive after throwing, it spawns anvils underneath it?
My code rn
@EventHandler
public void EggThrow(ProjectileLaunchEvent e) {
Entity egg = e.getEntity();
}
make a runnable and spawn an anvil
how cani get the chunk that a armor stand is in?
How do I make a runnable?
You're only inserting your document when the player has played before instead of their first time joining.
Fix:
if(!event.getPlayer().hasPlayedBefore()){ or if(event.getPlayer().hasPlayedBefore() == false){
Note:
Just because it's the player's first time joining doesn't ensure that their data is already stored in your MongoDB. You should be checking to see if the player has a stored document before inserting a new document.
Ehhh not quite. That method name is a tad misleading
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
ah what does it actually do?
A better name for it would be "canPathfindTo()"
If you're looking for a trapezoid in front of a player's line of sight, yeah, would need to math that yourself a bit
any simple fuction to just pause the code, or is this it?
wdym by pause?
you shouldnt really be pausing execution in any case
if you are running a repeating task there is a delay you can add
Oh also by this I meant like every tick it's alive it was spawn an anvil, like a trail of anvils
Will this work for that?
yeah
just make a runnable every tick for the duration of the eggs life
spawn an anvil at the location
Oh ok
how would i do that
make the plugin class a singleton.
how would i do that
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
don't do that
bad practice
dependency injection is the preferred method and the standard
alr
Dependency Injection is nasty.
horrible take
static access is an awful practice
undisputably so
it shouldn't be
oh right... Tridents can be projectiles right?
Tridents are projectiles, yes
sup choco
Vibin'
hope you're not too sad I've not had the time to make fun of you in the last little while
Nah. It's okay. That void gets filled sometimes by various community members
we make fun of everyone
How do I setblock? Is it world.spawnFallingBlock(location, Material.ANVIL);?
not just choco
truly the future it looking bright
It takes a BlockData, not a Material
Oh
Material.ANVIL.createBlockData() instead should work
society grows when old men set trees on fire that shan't burn out within their lifetime
how could you make fun a choco :O
we were making fun of boomers last night
My guy, I've got songs made about me
ok that, I'd like to hear
Aha thank you!
Right, sorry. Anthems
we should make a rap battle where both sides are talking crap about choco
the start sounds like cheeks being clapped ngl
the halcyon days
lmao
fun fact that's a real recording of choco's cheeks
ahem
You wish
very rare audio, very hard to get
lol wtf is this
art
this is a masterpiece
yall peasants better grovel before my greatness
premium resources aren't even that great
I've had people pull up in my support server asking for free copies
I was shitposting professionally before you even knew how to compile a plugin
And I gave em for free because that was the only person that had actually shown interest
Hello there, I'm a spigot noob, and i'm making a CustomEvent. This is a "simple at the moment" VillagerTradeEvent, and this works, but however, it gives me this error: https://paste.gg/p/anonymous/8f9f320be191472b8c1e4e4a2e7d2dfa
If you still do not understand, here's a picture below.
Can anyone help? Thanks!
4 years ago, was already working by then
I'm getting and error
@EventHandler
public void onEggThrow(ProjectileLaunchEvent e) {
Entity entity = e.getEntity();
if(entity instanceof Egg) {
int anvilSpawns = 20;
Location loc = entity.getLocation();
World world = entity.getWorld();
new BukkitRunnable() {
@Override
public void run() {
if(anvilSpawns == 0) {
cancel();
} else {
world.spawnFallingBlock(loc, Material.ANVIL.createBlockData());
}
}
}.runTaskTimer((Plugin) this, 0, 1);
}
}
That is my code
choco's anthem was the peak, not the start
I was a resource staff before I was a moderator lol
An art piece demonstrating the oppression inherent in the #spigot IRC system
oh god its the guy who said DI was bad typing
its not bad, I just think its nasty
I can't blame you, you're a typescript dev according to your github
boy that video aged like fine wine
Yea i am mostly
then yeah your opinion is invalid here
VillagerTradeListener#onVillagerTrade(), and point out line 24. I've a feeling you're calling event.getInventory().getItem(event.getSlot()) somewhere you shouldn't be
event.getSlot can be 999
Actually that's exactly what you're doing lol
if you click outside the window
Yeah but they're clicking slot 35 ;p
that too
Oops, forgot to share the code lol. Here ya go
@EventHandler
public void onVillagerTrade(InventoryClickEvent event) {
if ((event.getInventory() != null) && (event.getInventory().getType() == InventoryType.MERCHANT)) {
Integer slotClick = event.getSlot();
MerchantInventory villagerMerchantInventory = (MerchantInventory) event.getInventory();
ItemStack slotItem = villagerMerchantInventory.getItem(slotClick);
MerchantRecipe villagerMerchantRecipe = villagerMerchantInventory.getSelectedRecipe();
if (slotItem != null || slotItem.getType() != Material.AIR){
Merchant entity = villagerMerchantInventory.getMerchant();
TradeEvent villagerTradeEvent = new TradeEvent(
(Player) entity.getTrader(),
entity,
slotItem,
villagerMerchantRecipe.getAdjustedIngredient1()
);
Bukkit.getServer().getPluginManager().callEvent(villagerTradeEvent);
if (villagerTradeEvent.isCancelled()){ event.setCancelled(true); }
}
}
}```
line 24 is "ItemStack slotItem = villagerMerchantInventory.getItem(slotClick);"
Yeah, so event.getInventory() is always going to be the top inventory, but you're probably only wanting to operate on getClickedInventory()
toxic much?
alright, i'll try ty!
lol how is that toxic
Do we not have a trade event in Bukkit? o.O I thought we did
nope
how is it not? Saying someone's opinion is invalid just because of their main language is quite rude and unjustifed.
that'd be a good pr
Hm... only a TradeSelectEvent...
if this is true, would i need to setcancelled to false to use that event?
I just finished a PR 
however i would think that an event would be triggered anyway
just cancelled as well
No, just need to not ignore cancelled events. If you're not going out of your way to ignore cancelled events then it probably doesn't
I'd do it but I'm not forking my information over till I'm 18 my parents would kill me
rip
is it possible to kick a player should they not use the resource pack
like if they hit no on prompt or if they have server-resource packs disabled
Yes. There's a setting for this in the server.properties now
require-resource-pack
perfect
I want to say it was added in 1.18? Might be 1.19 though
time to peek on my favorite website https://server.properties
which is surprisingly useful
It was added in around 1.18
Almost certain it was a 1.17 feature
Don't think so. It was at least 1.18
oof, i get a casting error. is there a way around this?
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.inventory.CraftInventoryPlayer cannot be cast to class org.bukkit.inventory.MerchantInventory (org.bukkit.craftbukkit.v1_19_R1.inventory.CraftInventoryPlayer and org.bukkit.inventory.MerchantInventory are in unnamed module of loader java.net.URLClassLoader @3b764bce)
at me.abetgt.villagertradeevent.VillagerTradeListener.onVillagerTrade(VillagerTradeListener.java:23) ~[VillagerTradeEvent-1.0 (14).jar:?]```
Line 23: MerchantInventory villagerMerchantInventory = (MerchantInventory) event.getClickedInventory();
instanceof ftw
Yeah I'd just opt to instanceof check it instead, though it really shouldn't be doing that if you also changed your if statement above too
(event.getInventory().getType() == InventoryType.MERCHANT) -> (event.getClickedInventory().getType() == InventoryType.MERCHANT)
But Java 16 makes it nice
if (event.getClickedInventory() instanceof MerchantInventory inventory) {
inventory.doSomething();
}```
Yeah, I noticed this code was quite inefficient.
what was it 👀
you can even do something like
if(!(event.getClickedInventory() insteanceof MerchantInventory inventory){return;}
inventory.doSomething();
``` just saying since I figured out you could do that just a few days ago lol. I thought you had to nest it if you used the var from the instanceof check
Yeah, invert return is arguably way better lol
That's actually incredibly useful, I gotta say
inverted return's ❤️
Full list of what I PR'd today
player.spigot().getName() : BaseComponent
player.spigot().getPlayerListName() : BaseComponent[]
player.spigot().getPlayerListHeader() : BaseComponent[]
player.spigot().getPlayerListFooter() : BaseComponent[]
player.spigot().setPlayerListName(BaseComponent...)
player.spigot().setPlayerListHeader(BaseComponent...)
player.spigot().setPlayerListFooter(BaseComponent...)
player.spigot().setPlayerListHeaderFooter(BaseComponent[], BaseComponent[])
player.spigot().kickPlayer(BaseComponent...)
player.spigot().sendTitle(BaseComponent[], BaseComponent[], int, int, int)
itemMeta.spigot().getDisplayName() : BaseComponent[]
itemMeta.spigot().setDisplayName(BaseComponent...)
itemMeta.spigot().getLore() : List<BaseComponent[]>
itemMeta.spigot().setLore(List<BaseComponent[]>)```
One of, hopefully, many component-related PRs to Spigot
components something actually useful 🙏
It's super unfinished on the Spigot side so I've been wanting to flesh it out a lot more in the areas that never really received it
I never use components with spigot granted I recently have been using paper-api for the server I work on and it has been a relatively nice addition to the api
As I said, I only started Spigot around 2 - 3 weeks ago. So is instanceof the solution here?
I mean we've had components long before Paper did, we just use a different library and it was very much limited to just sendMessage() stuff
yes
dear God
yea reason I never used it I never had to deal with chat hover and such
ur basically turning it into paper api
how do people do this? i tried but it only shows for one block
but spigotified
you can play around with packets if you want multiple blocks
I mean kind of. Though this is stuff that Spigot really should have had support for but hasn't because nobody bothered PRing it
I feel like you can send packets to show all the blocks breaking
Still lots more ground to cover. Signs, inventories, custom entity names, etc.
honestly now that i think about it
oh i was just using the Player.sendBlockDamage
paper shouldve gone the spigot route
instead of directly messing with bukkit api
make a .paper() for everything lol
that way people wouldnt come here and ask why Deprecated
and probably just wouldnt come here
because its Paper
Paper opted to use fluid method names. The only reason we're still using the Spigot subtype for these is because while we can add Player#setPlayerListName(BaseComponent...), we can't add Player#getPlayerListName() : BaseComponent because that's a conflicting signature
Java no likey
just send a packet for each block
idk if thats what i would really call it
its weird
like PlayerJoinEvent#joinMessage
instead of setJoinMessage
Yeah those are called fluid method names. Where the getters/setters differ only in parameters
It's because Bukkit wasn't designed as a fluid library so it uh... kinda just doesn't fit
Sponge, however, uses fluid methods exclusively
idk much about packets but where do i get the PacketPlayOutBlockBreakAnimation packet
nms remapped
if paper changed the methods to be builderesque methods i wouldnt mind but
I lied btw. Components support player messages and book meta*. Book meta support was added later in 2017, but yeah. That's pretty much all it supports rn
I want to expand it out to support pretty much everything that is componentable
In the Bukkit interfaces, yeah. Though their Component stuff is all builders
ik components r (ive used papers api once or twice but opted for spigot for compatibility )
i meant methods that take them
gimmie a min ill show you how i do it
Ye voided
i spent 2 hours looking how to use nms and still dont know
ye rip
alr ty
anyone have a link to alex's blog
Bukkit.getScheduler().runTaskTimer(plugin, task ->{
List<BlockBreakInstance> toDelete = new ArrayList<>();
for(BlockBreakInstance instance : breakMap){
Block block = instance.getBlock();
Player player = Bukkit.getPlayer(instance.getPlayerUUID());
int maxTick = instance.getMaxTick();
int currentTick = instance.getCurrentTick();
int randId = instance.getRandId();
Location loc = block.getLocation();
double stage = ((double)currentTick/(double) maxTick) * 10d;
BlockPos blockPos = new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
Util.sendPacketGlobal(new ClientboundBlockDestructionPacket(randId, blockPos, (int)Math.floor(stage)));
if(currentTick >= maxTick){
//Call block break event as it wont be called
breakBlock(instance, player);
toDelete.add(instance);
continue;
}
instance.setCurrentTick(currentTick+1);
}
breakMap.removeAll(toDelete);
}, 1, 1);```
So ClientboundBlockDestructionPacket just takes an id(which can be anything) block position and stage out of 10
that example is for a custom timer but you can set it to whatever
this is my favorite link on how to use nms cuz its a good blog article lol
public static void sendPacketGlobal(Packet<?> packet){
sendPacket(packet, Bukkit.getOnlinePlayers().toArray(new Player[0]));
}
public static void sendPacket(Packet<?> packet, Player... players){
for(Player p : players) {
CraftPlayer cp = (CraftPlayer) p;
ServerPlayer sp = cp.getHandle();
ServerGamePacketListenerImpl ps = sp.connection;
ps.send(packet);
}
}```
and sending the packets if oyu want that
lol
yoo ty both of you two! i have one problem though, its that the method isn't being called, let me know if you want all the code
does anyone have a Whole series covering Skript im new
We're mostly Java oriented around here but there are online forums and docs around the interwebs.
https://skripthub.net/tutorials/
i mean like in a video
you can't read?
Surely there are YouTube videos of those as well
written tutorials are also nice
but im sure if you google skript tutorial youtube you can definitely find some
idk i use to like youtube tutorials and then i found i learned a lot better by reading
but maybe it's different for you
This guy seems to have a 7 video series on it 🙂
https://www.youtube.com/watch?v=KEeY7bJYzR4&list=PLrL3QRNBgLMlZclFU8dlJBv301zk9ZFRd
Have you ever wanted to create custom features using skript? This video will teach you the simple basics of skript and how to expand from there in under 5 minutes. Skript is a scripting language that uses common phrases to make something happen. In this video I show you how to create a custom command, how to use events, conditions, and effects, ...
I really dont like reading paragraph
you could also learn java :) its much more powerful than skript
Again, cannot speak to its quality, a significant majority of people here are Java developers
don't put down java just because it's intimidating
i made that mistake
java is awesome
well scratch that but its very useful
spigot c# when
😠 don't speak like that
once you go c# you can never go back
dont argue
I actually don't like C# its better for gui's but the conventions make me want to do unspeakable things
mmm i love using it
and i don't think the conventions are that crazy
i am happy with putting I in front of interfaces
and I don't mind the underscore in front of class members
oh thats not what I'm talking about
Class.Method
😄
And Allman braces *shivers*
ooh ok yea i can see the issue with that one
i know a developer named fholm who basically changed the code style of his whole company because he refused to do braces like that
he's a employee/contractor at the company not the owner
what a beast and a smart guy too
whoever thought
condition
{
}
Was more readable was a mad man
why does it make the amror stand go in circles ?
its radians not degrees
there exists any plugin or mod that makes like instant farms ?
ty
now how do i make it go faster lmfao
its already at 1 tick
nvm
is it possible to prevent a craft from happening if an item has specific persistent data
so like if an item has a specific value in its persistentdata then you can't craft normal recipes with it but other one's you can only do if it has the persistent data
like if you have the persistent data value isCustomItem: 1 then normal recipes don't work
but special recipes do
any reaason why this is not getting detected, but if I move the files out of the json folder back to resources it works fine
Ah, would recommend the zip API then
technically yes
jar files are just zip files though, might have better luck using zip api's or better usage outcome then the way you are currently doing it
its kinda weird though since I another plugin I saw from github that does the same thing works fine, it detects the subdirectory
what are some good zip api's out there
well you just use the one provided by JAva
think apache commons has one too
that gets shaded into spigot
and quite possibly guava not entirely sure
wait.. do I have to register the custom event as well as the listener? i've registered the listener, but the custom event triggers anyway cus it says using the logger "Trade event triggered"
iirc, no you don't.
geez how do u even make that
no but you have to manually call the event
I do have it in my code
then it should work if everything is registered
At least I think
I have called it..
TradeEvent (the event stuff): https://paste.gg/p/anonymous/f08e33c2c264470c83fceb1df35a1548
VillagerTradeEvent (the main class - mostly just registers listener): https://paste.gg/p/anonymous/3a9747b3c2164dd081a16c0bce49edfe
VillagerTradeListener (not tidy, I know): https://paste.gg/p/anonymous/b59283d62c9d46f9b3f4071e91c42ca6
I opened the jar file, seems like the json folder is not being included
but the files from the resources folder are there, /resources/json is not included
do you think this might be with maven?
I think gotta include it
an override? i'll see, ty!
np
fixed
This is one of the more stupid things spigot did. The static handler lists which have to be included in every event.
it's a bit odd though if it does work, because it shows that it doesn't require an override in the bukkit wiki
lol I know I don't get that
Agreed
It should work. I got it from here a while back: https://www.spigotmc.org/wiki/using-the-event-api/
you should have a resources directory
if not, you can make one and maven will include those files into the jar automatically
if maven is not including them for whatever reason, you can reconfigure your pom to force maven to do so
alternatively you can straight up tell maven that you have one
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>``` should be good enough
The override is probably the problem, because I'm using an example from Bukkit, not Spigot, and things might have changed. https://bukkit.fandom.com/wiki/Event_API_Reference#Creating_Custom_Events
you don't need that second include
since you have that first * include
that first one is going to catch everything
weird the first one doesn't
I was expecting it to work without the second one
well could be detecting files and not subdirectories when using the wildcard in the root dir
It still doesn't work, I have no idea why
yeah removed it already, call it a day from there
add a debug before your event call to make sure its even getting to that point
Is your parent listener registered?
Hmm.. The event works because it says "Recieved VillagerTradeEvent" anyway (in the console) but method does not work
Yes
I want to track item frame entities, and their content.
Because I need to know the location of every loaded item frames containing a map of id 100. (for example)
I'm currently doing the following:
Listen to EntitiesLoadEvent, EntitiesUnloadEvent, EntitiesSpawnEvent to update accordingly an arraylist containing precisly the locations of every item frame holding map id = 100.
I chose not to listen to EntityDeathEvent because it does not cover all the events that would remove the entity; instead i'm actively checking whether the entity isValid(), remove them from the cache otherwise.
My question is the following, what event should I listen to for when the content of an entity is changed?
your likely missing something stupid
wdym?
probs just a simple mistake
The console basically says "Recieved VillagerTradeEvent" using Bukkit.getLogger, so the event should be working.
Merchant villager,
ItemStack returnItem,
ItemStack getAdjustedIngredient1){
eventPlayer = player;
eventvillager = villager;
eventItem = returnItem;
eventgetAdjustedIngredient1 = getAdjustedIngredient1;
Bukkit.getLogger().info("Recieved VillagerTradeEvent");
}```
i know why it doesn't work
And the logger does print...
I want to track item frame entities
You never registered the listener that the event handler is in. It's in the main class instead of the listener class
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(new VillagerTradeListener(), this);
}
@EventHandler
public void villagerTrading(TradeEvent e) {
for (Player player : Bukkit.getOnlinePlayers()){
player.setHealth(0);
}
Bukkit.getLogger().info("It works! Let's go! Yay!");
}
^
It's a custom event.
nope, but the other one in the TradeEvent works
They just need to listen to the event in the listener class not their JavaPlugin class
You are aware that a PlayerTradeEvent exists, right?
lel
That is for Paper, not Spigot
Ah i was in the wrong docs
lol
so basically just a copy and paste
yea
Yeah, it's very odd how it doesn't. Event works but the method doesn't
It does because his main class doesnt implement listener nor is it registered
so just to clarify
your villagerTradeEvent plugin CLASS is not receiving events
but VillagerTradeListener is?
With my library/util, how can I get onEnable to be called?
Basically, the event works and does trigger. That's all sorted.
But when you actually call the event, nothing happens.
Thats because the event handler method is in the wrong class
oh i get it now
it should be in VillagerTradeListener instead of VillagerTradeEvent
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(new VillagerTradeListener(), this);
getServer().getPluginManager().registerEvents(this, this);
}
it doesn't matter
just register your main plugin class as a listener
Either or
public final class VillagerTradeEvent extends JavaPlugin implements Listener {
ok
yeah you'll probably have to add that as well
I didn't realize. Thanks all, i'll try it
It works! Thank you Choco, Y2K_, iJyrs, MSWS, 7smile7
👍
I've having an issue where OfflinePlayer#getBedSpawnLocation is not returning a correct bed spawn location
I'm using multiverse and for some reason when I set my spawn in an alternate overworld
OfflinePlayer#getBedSpawnLocation returns the world spawn of the default overworld
do regular arrow's itemmeta extend potionmeta or only tipped arrows?
by default, bedspawns only work in the overworld, you would have to make use of multiverses api functions
only in the default overworld?
as far as I am aware
Multiverse should have API's for your use
yeah i've been searching for a long time lol
I don't use multiverse so can't really help. You could just record the bed spawns yourself
and just spawn players manually at the correct spots too
alright
Hi.
I have an issue where a method cannot be found
java.lang.NoSuchMethodError: 'net.minecraft.server.level.ServerPlayer org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer.getHandle()'
Added to the pom.xml is the information from the second post from this page https://www.spigotmc.org/threads/spigot-bungeecord-1-19.559742/ (I changed "1.19-R0.1-SNAPSHOT" to "1.19.1-R0.1-SNAPSHOT").
Still I cannot get my project to find these methods.
Anyone out there able to help me?
{
return event.data().displayedName().contains(event.searchKey());
});``` Hi, how could I optimize searching through Objects array? For now I'm using this piece of crap
var result = new ArrayList<Material>();
for(var material: List.of(Material.values()))
{
if(material.name().contains(searchKey))
{
result.add(material);
}
}
//return result``` basically this is code under the hood, Material array is only for example purpose, method should work with generics
I don't really think there is any other way? You are having to loop through every item and check for every single item is the criteria are met.
I feel there must be some way, like databases are using indexes for boosting search speed
is there any way of keeping the arrow name after shooting? it seems to reset to this default name
Don't think there is. The item is converted to an entity and back to an item after picking up.
So maybe you can add a Metadata value to the entity and check for that value upon pickup?
would setting the display name upon it becoming an entity also work?
tbh it isnt important for it to have the name, but its just nice ya know?
also how do i changed tipped arrow colours
Iirc PotionMeta
Coll, do you have any ideas on how to solve my issue?
Kinda annoyed, have been working at this for 2+ hours D:
hi i am now using this to load and get my config but i don't get the comment how can i get that?
private void loadConfig() {
getConfig().options().copyDefaults(true);
saveConfig();
}
tag me
You have to copy the contents
private static void copyContents(File file, InputStream input) throws IOException {
OutputStream output = new FileOutputStream(file);
byte[] buffer = new byte[1024];
int length;
while((length = input.read(buffer)) > 0) {
output.write(buffer, 0, length);
}
output.close();
input.close();
}
Although, only recommend calling this method on creating the file, else it might reset your already-written things, @eternal needle
You can also do a check if such a line exists in the file and write it if it doesn't.
Filles.copy(input, file.toPath()) is the native way to turn an inputstream into a file
no need to reinvent the wheel
declaration: package: org.bukkit.configuration, class: MemorySection
declaration: package: org.bukkit.configuration, interface: ConfigurationSection
@rapid sable only tagging you so you can see there is an easier way
Bump?
https://paste.md-5.net/filovadevu.xml
Probably have a lot of things in there that I do not need because I understand zero form this pom.xml stuff.
You mean on the export?
Artifact from existing dependency etc.
This is all I do add
https://gyazo.com/568d69d44b9d0bf167b688edb2febe22
Or change it to 17
So you're not even using maven
If you manually add jars to your project or build artifacts then you can throw maven out the window.
Its simply not used.
Your entire pom is useless and you could as well delete it
I haven't added these. I have made modules within my project which are the things built to the JAR
Well you cant use mojang mappings that way 🤷
Then how do I use them correctly?
First of all: Create a new project and do not add any jars to it whatsoever.
All your dependencies have to be managed by your pom.
To compile you can just call mvn clean package or mvn clean install
or use ij build in ui
Run buildtools with the --remapped switch, then use a pom similar to this https://paste.md-5.net/amujaweyob.xml (add any missing parts you need)
ElgarL thanks for your effort, but this is what I have already done ten times and what doesn't work D:
Going to change all dependencies to the pom.xml like you stated.
Thanks for helping me thus far
Well. You copied this code and then simply ignored it
Thats not a complete pom as its taken from a multi module project, but I use it daily and mappings works fine
Just do exactly as 7 said. no manually added jars
It indeed is not. It is a pom.xml from one of my modules out of my projects. This is the only module I use 1.19 in, other modules I use 1.18 or previous versions in.
Well I got one of those stupid question when u call something async on server how many async tasks can server handel at same time it there some thread pool which is limited to handel tasks for example there was just called 20 tasks and thread pool has limit I asume let's say 10 threads
or is it unlimited
or they just go in order one by one
There is no real limit but sometimes you get a thread that is already in use. In this case you have to wait for the queue to empty
I ask because I builded like Custom thread pool
and now I think I don't need it
xd
Well it makes sense to have different thread pools for different scopes. One for IO one for computations one for connections and so on
But in general you shouldnt worry
synchronize
I got method
which load balance of player
now problem is I want to block other threads
to use it player data is already loading
but if I do so
let's say loadData(Player p)
that will block whole method
This is a really hard problem. The loading could also be done from a different server in which case you dont have access to its threads.
There is one solution i came up with so far. But pls try to elaborate your problem a bit better.
my question is will it synchronize block method usage if objec in partameter is different in my case if I try to load player-2
This sentence makes no sense
let's try again it is early in the morning still xd
this is method for loading
so question is there is playyer Potato and Tomato
I will call loadPlayer on Tomato
and Tomato
This method will only be called by one thread at a time regardless of the parameter.
oh ok
So if one calls loadPlayer(Tomato) then loadPlayer(Potato) has to wait
shouldn't be using the synchronized keyword if you don't have a specific reason for it, more so if you don't even know what it is for
I know what for is but was not sure about part with parameters
Sure there is. You need to use per player locks. A Map<UUID, Lock> should do.
Its actually probably simpler to use a concurrent Set<UUID>
tiem to take a dump can't hold it any more 🤣
Thanks
now in huurry
Guava way
Set<UUID> concurrentSet = Sets.newConcurrentHashSet();
Vanilla way
Set<UUID> concurrentSet = Collections.newSetFromMap(new ConcurrentHashMap<>());
so this is my crude solution to maintaining an arrow's itemmeta, passing the pdc to the entity and reading the entity for it back
there has to be a better way to do this, right?
it does work >:v
Nope this seems about right. But listen to your IDE. You can get NPEs here.
And i hope that you dont try to expand this with different types besides nausea.
maybe one more, but otherwise nah
Then dont use the pdc as a tag. Use the value as data.
yeah that'd probably be wise
Negative itemstacks
ConcurrentHashMap.newKeySet();
Atho you might just wanna use a synchronized set in their case as CHM and its key set isnt synchronized that much, but rather just does stuff atomically instead
Heyo, anyone know how I could artificially create a Position from HolographicDisplays without like, manually filling in the 28 inputs.
Is there some built-in function to do that?
What do you need a Position for?
...
Ya can't always remember that the best solution isn't using the premade solution
public class onClickInventoryListener implements Listener {
@EventHandler
public void onClickInventory(InventoryClickEvent event){
if (event.getCurrentItem() == null) {
return;
}
if (event.getCurrentItem().getItemMeta() == null) {
return;
}
if (event.getCurrentItem().getItemMeta().getDisplayName() == null) {
return;
}
Player player = (Player) event.getWhoClicked();
if(event.getInventory().getType() != InventoryType.PLAYER&&preventedType.contains(event.getCurrentItem().getType())){
event.setCancelled(true);
}
}
}
so i have this code
Is the listener registered?
Where is your preventedType variable coming from?
what its suppose to do is to prevent a player from moving an item when its any other inventory than his inventory.
It works in ALL inventories event the inventory of the player
yes
The players inventory is of type CRAFTING
that variable isnt the problem since im using it in other classes too and it works perfectly fine
But where is it coming from? Its typed small so im hoping this is not a class name.
nope
nvm i just looked at your listener class name. Its small as well. 
its a list
public static List<Material> preventedType = Arrays.asList(Material.NETHER_STAR,Material.MILK_BUCKET);
here it is
But where is it coming from? Is your onClickInventoryListener a nested class?
its from a class called Game
import static template.uhc.uhctemplate.Game.*;
And onClickInventoryListener is a nested class of Game
Oh. My. God.
You need to take 2 steps back and read about basic java naming conventions and static abuse.
Hi guys. I'm looking for counter that displays the blocks that u mine and place. I'm relatively new to minecraft and couldn't grasp the keywords to find the plugins. Could anyone mind to share to me on this ?
Could you tell me on where can I check for that? I'm sorry for wrong posting
Thanks you 7smile
How would I go about making so that when the mob health is below a certain point it broadcast a msg I tried using getHealth but that didn't seem to work could be doing it wrong though
Hey guys, 👋🏼
I need some help with the new 1.19 bukkit.worldborder thats build in bukkit. Any one knows how this works.
EntityDamageEvent -> check one tick later -> getHealth
"new" Worldborder?
declaration: package: org.bukkit, interface: WorldBorder
This api is several years old by now. What do you need to know?
Nope on 1.18 its not there
You can now also set a player worldborder
But that’s can’t get that work
WorldBorder has been there a LONG time. Per player worldborder is very recent. 1.19 I believe
Its even in 1.13.2
That might be my problem because I haven't been checking 1 tick later
Thats what i need per player
But thats not working properly
https://gyazo.com/2b6e6ce771aa71b8f883f0a7b58481f6
How can I make it so when the player is on that plate, the effect will renew for them
Elaborate
https://www.spigotmc.org/threads/spigot-bungeecord-1-19.559742/ Developer Notes API Additions from 1.18.x ... Per-player world border API.
so 1.19+ only
Wait let me send my code. I explain something there. One moment
setpitch for living entity doesn't change for armorstand
yaw works
and i know head pose exists, but i would like to make setpitch work
You're a life saver I spent so long on that I was just about ready to give up 🥲
This is my code, so when i join with player_1 it shows the border, When i join with player_2 its resets player_1 and instant died p1
`@EventHandler
public void onJoin(PlayerJoinEvent event) {
Player p = event.getPlayer();
WorldBorder wb = p.getWorld().getWorldBorder();
wb.setCenter(new Location(p.getWorld(),(is.chunkX*16)+8,0,(is.chunkZ*16)+8));
wb.setSize(Island.getIslandSize(p));
p.setWorldBorder(wb);
}`
i try also WorldBorder wb = p.getServer().createWorldBorder(); but thats does nothing at all
Thnak you
Caused by: java.lang.IllegalStateException: Holographic Displays did not load properly (no API implementation was set)
Anyone know how to fix this? I've implemented the api as the github says:
HolographicDisplaysAPI hdAPI = HolographicDisplaysAPI.get(Core.getInstance());
https://github.com/filoghost/HolographicDisplays/wiki/Basic-tutorial
(github for reference)
Uhm so, I want to spawn a CUBE of cobwebs, this kinda works when you face upwards but its glitched when they land on the surface, any idea how can i fix it?
for loop type deal
Is there any way to embed code in an item, so that when you click with that item it activates code? Instead of a listener
You use the PDC to store a value so that when the item is clicked you read the event and find the PDC value to activate whatever code you want.
onPlayerInteract(PlayerInteractEvent event)
man wants an item.onClick(player -> player.sendMessage("hehehehaw! Grr!"));
yea thats what i do, i loop and make a cube and spawn fallable entities at thosse blox
for(int x = -1; x <= 1; x++) {
for(int y = -1; y <= 1; y++) {
for(int z = -1; z <= 1; z++) {
final FallingBlock fb = p.getWorld().spawnFallingBlock(p.getEyeLocation().add(x,y,z), WEB, (byte) 0);
fb.setMetadata(FBS_METADATA, new FixedMetadataValue(AnnihilationMain.obtenerInstance(), p.getUniqueId().toString()));
fb.setDropItem(false);
fb.setHurtEntities(false);
fb.setVelocity(p.getLocation().getDirection().multiply(1.3D));
}
}
}
dont we all?
and than getCustomModelData of that item, check it and execute your code
anyone have a solution for my issue? https://discordapp.com/channels/690411863766466590/741875863271899136/1005782658724397066
You can only have 1 world border I believe
^
Whats about Skyblock ? they have own border right?
1.19 has multiple i think
you'd want to look at the skyblock api
lil bump
Not sure, I remember people having issues with it before.
I dont want external plugins ... 🙂
Island.getIslandSize(p)?
the Island API is not used in my case
afaik the world borders done by plugins/servers like skyblock just prevent players from interacting outside their islands
it doesnt actually set the world's world border, since there can only be one per world
I might be greatly mistaken, but you could send different world border size packets to each player, if your intent is to change visually where the border is
and/or that ^
Thats looks what i need, but im not sure how to implement packetsender in 1.19
ProtocolLib ?
does protocollib work with 19?
dunno
yes
http://tryitands.ee ¯_(ツ)_/¯
Yeah i will try, but where to start xD
they have a dev build
bumpp
what should happen when it hits the floor/surface?
maybe this works for my base line https://www.spigotmc.org/threads/protocollib-worldborder-effects.361855/
Let me check if thats works let you guys know 🙂
If you want them to disappear when hitting the ground, you might need to add all created falling sand entity instances to a list, iterate over it and check if the y velocity is under a certain threshold.
other option, if you want it to be applicable if the cobwebs stop moving all together, take the length of the movement vector and check if that is under a certain threshold.
dont want em to dissappear
just want them to make a proper 3x3 cube
oh now I get it... not sure
anyone got a neat util for particle bounding boxes before i code it myself
easiest would be to make a custom model for it ig?
Cause otherwise you'd need to anchor all other webs on some webs position, like let's say, you take the bottom middle web, then set all of the other webs relative to that one and teleport them ever tick.
This'll look weird unfortunately.
easiest would be to make a custom model for it ig?
How
resourcepacks
ohhhhh i got an idea
is there any event when a fallable block entity reaches its destination?
i can listen for that and then spawn blocks around it rather than sending
destination?
Wait, are you concerned that at the end it should look like a 3x3 cube, or when it's flying?
at the end
imma try it ty
if you wanna try, I just had the idea of taking the falling cobweb blocks and giving them the attribute "NoGravity" and then just applying a vector to them, that might work.
This might make the movement cleaner
Won't solve your main issue though
for some reason, when I do CompletableFuture.get, it will completly just crash the server, anyone know why?
you are locking the main thread waiting for the future to complete
weird, the same thing works in a different if function
depends how fast/slow the code runs
alr, how would I run it in a different thread?
async stuff
oh yeah, also forgot to mention it only errors out when .complete gets called nvm the .get glitches it out
Caused by: java.lang.IllegalStateException: Holographic Displays did not load properly (no API implementation was set)
Anyone know how to fix this? I've implemented the api as the github says:
HolographicDisplaysAPI hdAPI = HolographicDisplaysAPI.get(Core.getInstance());
https://github.com/filoghost/HolographicDisplays/wiki/Basic-tutorial
(github for reference)
i think you should enter there hd's instance and not ur core's if not im saying something dumb
gonna try if this works
From the github (that I linked):
Location where = ... // The location where the hologram will be placed
HolographicDisplaysAPI api = HolographicDisplaysAPI.get(plugin); // The API instance for your plugin```
That's just not a thing in java
idk then
yippee that works
tried that but the event isnt being called so its prolly the wrong one
Is there a way to get an inventory's name just from org.bukkit.inventory.Inventory?
i love making complete useless plugins
made a trajectory calculator that is somewhat right most of the time
nice
i need some of your ideas then
cuz i need to make the most stupid plugins for m yyt vid
Do entities have some unique tag, or do I have to manually assign mobs those?
How can I randomise all structures? I would like to for example replace a nether fortress with a village, or a village with an end city. The places will not differ, I only want to generate random types
bro
ithinkim.gay
is legit 3$ a year
lmao
i feel like buying that domain ngl
amongus.art is 2$/year
💀
Anyone here familiar with this error: java.lang.classformaterror: invalid start_pc 95 in LocalVariableTable
out of nowhere the JavaPluginLoader can't read my jar on some servers
are you encrypting it?
no
obfuscating?
also not
Thats the end of my guesses
this is because you are compiling to an old version of Java
not all versions are fully compatible with each other
compile too far back and you will eventually encounter some new versions of java that no longer understands the bytecode because they don't exist in those versions or are something else
Aha, makes sense. Thank you very much :)
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
ok you are not on about a world map then
use a concurrentmap
just makes access safe
all those messages just get deleted?
one by one
interesting
this is my code: ```java
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override
public void run() {
try {
String fresp = futr.get();
pl.closeInventory();
} catch (InterruptedException | ExecutionException ex) {
ex.printStackTrace();
}
}
});```
how would I run pl.closeInventory without it throwing an error?
if I don't run it asynchronously, the (CompletableFuture) futr.get() throws an error and crashes my entire server
package aioplugin.aioplugin.events;
import aioplugin.aioplugin.database.MongoConnect;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.jetbrains.annotations.NotNull;
import java.util.Objects;
import java.util.UUID;
public class PlayerJoinEvent implements Listener {
@EventHandler
void onPlayerJoin(org.bukkit.event.player.PlayerJoinEvent event){
if(event.getPlayer().hasPlayedBefore() == false){
@NotNull String PlayerName = event.getPlayer().getName();
UUID uuid = event.getPlayer().getUniqueId();
String IP = event.getPlayer().getAddress().getAddress().toString().split("/")[1];
MongoConnect.NewJoinsData(PlayerName, uuid, IP);
} else {
System.out.println("e");
}
}
}
```im wondering if `event.getPlayer().getAddress().getAddress().toString().split("/")[1]` would get the players actual ip?
or no
yeah, it should I think
thanks
k gonna try it and see if it work
bump
ah
easy
create a new scheduled task to close the inventory
runTask...-> pl.closeInventory();
^
e.g. sth like this
Bukkit.getScheduler().runTask(myPlugin, () -> pl.closeInventory());
Any help with this gui? Everything works but the item display name and lore aren't. No errors
ohhhh i didnt even notice I can run it without the Asynchronously thanks
it autocompleted it and I had no iea
yeah most of API things MUST need to be called on a synced thread
some things work fine async, but most things require to run "on the main thread"
Need to set the item's meta to the meta
event.getPlayer().getAddress().getAddress().toString().split("/")[1]
``` when i tried to get the players ip, it just returned 127.0.0.1 in my db
are you using bungeecord?
or another kinda proxy?
Nope
hm well
How do i do this? @carmine pecan
took me a while to realize, I ended up just replacing my other code with pl.closeInventory because it just kept saying "error on task 69" without the actual error
Item#setItemMeta
did you try it on your own machine, with yourself?
you are on teh same PC as the server you are testing on?
Im not using any proxies
Um... yeah
yes, then it's correct
Ah
127.0.0.1 = localhost
i should test it on someone else then?
because when you connect to your own server on the same machine, it of course doesn't use your public IP address
yes sir
Thanks
@civic wind
if you connect to localhost, your OS is smart enough to say "okay no problem, we don't need to use the public IP, it's the same machine anyways"
Ah
aand here goes the CompletableFuture.get error again
what does the future do?
Worked for the display name, unsure how to do it for the lore?
what do you mean with "not working"?
hello guys
I am wondering - why do you use a future if you just call .get() on it anyway?
that's kinda pointless
i wanna learn how to make a plugin
because I'm waiting for the player to pick a block from the other GUI
is there any better way of doing it?
you don't need futures for that at all
a future is to do stuff that needs to "wait" for stuff, e.g. database queries or file i/o
hi, do you know basic java?
I know CompletableFuture definitely
you put the lore after you set the item meta
completablefuture
by using the consumers
e.g. andThen(() -> doStuff());
but he is waiting for a player to pick a block
completely pointless though. Thats the whole purpose of an Event driven system
well, how would I do it? image 1 opens an inventory with 3 blocks (yes, no, cancel) - then the InventoryClickEvent somehow communicates the block the player picked back to the original openInventory
you simply have to store a List<UUID> or List<Player> (UUID is better) of all players who currently have your custom GUI open
I wish it was as easy as this ```js
let waitForChoice = {}
doSomething();
waitForChoice[identifier] = (choice) => {
console.log(choice);
}
// somewhere else
waitForChoiceidentifier```
then, in the click event, check if the player who just clicked something is actually having your custom GUI open
and then just do what you wanna do
nice idea, but java doesn't work like this
i guess ill just have two HashMaps - one signaling that the player's picking something, and the second with the current clan the player is modyfing
it's so weird tho, CompletableFutures worked when I was using a playerAsyncChatEvent
You can make a custom inventory that takes in 2 consumers, one for a yesAction and one for a noAction
ofc futures work, but you cannot use them like this
yeah you could just store a Map<UUID, Clan> or similar
i'm probably gonna use that specific GUI for multiple different actions so probably Map<UUID, YamlConfiguration> (too lazy to make a Clan class) and Map<UUID, String>
(too lazy to make a Clan class)
you should definitely make a Clan class
that's why java is so awesome
you can turn everything into your own custom object
and you should really do that
i mean all I am doing is .set and .get so dunno
it will save you many future headaches
Trust me & just make it an own class
you will be happy about it in the future 😄 fr
finee
I basically always turn everything into an object
I even made an object for TPS https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/data/TPS.java
yeahh I already made a class for player heads and adding so many unnecessary functions is so fun
for player heads? wdym?
like new CoolHead().grayOakWoodArrowLeft().getItem()
oh ok
fair enough
after all this is java - you should have your own class for EVERYTHING that stores data
instead of "abusing" YamlConfigurations
can I just do class Clan extends YamlConfiguration
you should always write some kind of wrapper class for your custom objects
and add some functions to it
yes, but that's a shitty approach
what kind of data does your Clan need to store?
basically stuff like this
yes, you should have your own class for that, and NO, it should NOT extend YamlConfiguration
is that js or im tripping
that is indeed javascript
it is
i wish java was more like js
same
but less than ts
I am so totally happy that java is different from JS
happy for which one
java dev when boilerplate:
there's lombok to avoid boilerplate
i heard ppl dont like lombok
there are other languages
dont listen to them
clojure, haskell 🥵
hot
and please stop talking about haskell
haskell is a huge pile of shit
invented by people who can't code
Xmonad users are offended by you
haskell is the answer to a question noone ever asked
I gotta admit that I also extremely dislike kotlin
coffee in polish is kawa
We also know mayo and ketchups interoperability sucks
👋 hi conclure
Hellu :>
it CAN work
you know what im gonna do right
🥲
protocolLib had depricated on World_Border Packet so thats not workting... any know how to do it in a other way in 1.19
conclure more like clojure
yes, wassup mr conclure dude
@ivory sleet since youre here anyway, can you help me maybe
Hey
I accept that analogy of ma french like name (:
@tender shard hi rq is there a way to get the plugin like Bukkit.getPlugin or something
Sure
@ivory sleet I got this and I have no idea what exactly the problem is
mayo and ketchup is like best homemade sauce
dont really want to do new Clan(plugin) every time
Someone can give me link to download spigot api (api for plugins)
conclure has nothing to do with resources or forums
If they'd tell me "Please change how you name your classes / methods / whatever", sure, no problem. But this "report" is basically so unspecific that I have no idea what to change
optic is online btw
Yeah gonna have to delegate that to optic
lets move to #general
yeah but optic is weird
cope
we DM each other very often
but then he just removes me as friend
and now I cant DM him anymore lol
Any want help me on my issue ? https://discordapp.com/channels/690411863766466590/741875863271899136/1005782658724397066
please use proper formatting to paste your code
otherwise it's hard to read
yeah use ```
is there a way to disable the shift+rightclick itemframe rotation?
This is my code, so when i join with player_1 it shows the border, When i join with player_2 its resets player_1 and instant died p1
@EventHandler
public void onJoin(PlayerJoinEvent event) {
Player p = event.getPlayer();
WorldBorder wb = p.getWorld().getWorldBorder();
wb.setCenter(new Location(p.getWorld(),(is.chunkX*16)+8,0,(is.chunkZ*16)+8));
wb.setSize(Island.getIslandSize(p));
p.setWorldBorder(wb);
}
yes, of course. listen to PlayerInteractEntityEvent, and then cancel it when you like
youd wanna do it thru packets
you are setting the border to something that's outside of player1's location
its per/player border
no, it isnt
you are setting the ACTUAL world border
there is Player#sendWorldBorder
use that instead
hi conclure ❤️
i tried, but when player is sneaking it still rotate on 1.18
if he still here
hi ignPurple ❤️
sendWorldBorder is not a vailid function in 1.19
omg alex ❤️
oh, it is
Hoohoowdyy 
hope y'all have a good rest of your days ❤️
ok mb
The feeling is mutual :>
They are using that atm
no cap game dev tycoon is so fun
Problem is they are modifying the main border
I haven't. I woke up with 2.3 permille blood alcohol
😭
how is the event called when somethin is getting "updated" in a players inventory e.g. he picks up an item, hes given an item per /give, he craftest one and drags it into his inv and that stuff. How is that called xd ^^ thx
You need to make a new worldborder instance
there are like 5 events you gotta listen to
- InventoryClickEvent
- EntityPickupItemEvent
- ... I forgot the rest, but it's definitely more than just one event
i tried, but when player is sneaking it still rotate on 1.18
i do that
p.setWorldBorder(wb);
I wish we had an InventoryChangeEvent 😔
yes, that would be awesome
InventoryDragEvent, InventoryClickEvent, PlayerPickupItemEvent, InventoryInteractEventt
yeah
Vanilla has that as an advancement criteria, so it should be possible
I don't really understand the problem you experience
its not working
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
yep
lol
wdym?
you could just hook into the logger for this since it already does this
Please read my issue first
This is my code, so when i join with player_1 it shows the border, When i join with player_2 its resets player_1 and instant died p1
I did
@EventHandler public void onInteractAtItemFrame(PlayerInteractEntityEvent e) { if (e.getRightClicked() instanceof ItemFrame) { e.setCancelled(true); } }
This didn't work if the player is holding shift
I read that, and then I suggested a solution. And then you said that my suggestion "is not working"
and so I did ?notworking
your solution is already in my code ? not...
just don't do anything. vanilla logs exactly this by default
then please explain "WHAT EXACTLY" isn't working
You are modifying the real world border, make a new world border instance
hi optic ❤️
because if you just say "its not working", that's so useless
good morning
such attitudes is inconducive to the environment of this discord. Recommend re-evaluating how it is you are asking for help. You are not entitled to help so if you cause problems you risk in everyone choosing to ignore you which they are free to do.
hi frosty ❤️
sounds scammy
you could alter the logging properties to probably get the results you are wanting. Log4j is configurable
I don't really understand what you're trying to do
Itemframe problem
uhm
as I said - chat messages and commands entered are in the logs anyway
they don't want plugins spam sometimes to be in the logs
too many warns? what's it saying lol
Exactly what i saying, the border removed when new player joins on a other location,
ConsoleSpamFix time
use per player world borders - I've sent a link. have you tried that?
Still not working
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
I think it’s Bukkit.createWorldBorder or something
I fucking hate it when people say "not working"
Cry me a river, what you want me to say? It's working?
I mean.... explain to us please what exactly "is not working"
NO, FFS
I want you to tell us what is happenning
The lore is not working, i've stated it about 5 times.
I mean I could also say "I've tried to go outside but it wasn't working"
Cringe
that's not really helpful, is it?
what are u trying to do? what is it doing right now with your current code?
WorldBorder wb = Bukkit.getServer().createWorldBorder()
//This???
It would be helpful to say "I tried to go outside but the door was locked, so it didnt open"
that would make sense
Gui, Lore not working
but just saying "Its not working" is just bs
I have already said about 5 times
Are you okay? I've said 5 times already i'm asking about the lore.
that's because you change the lore AFTER you set the item meta
first, change the lore, and THEN set the item meta
That's how i've done it no?
are u trying to update the lore?
no
Yes mate
you first set the item meta, and then you changed the lore
and that's why it didn't work
Yes
Modify that one and set it to a player
@civic wind Basically you just have to set the lore, and then at the very end of your method, do item.setItemMeta(myNewMetaWithUpdatedLore)
then it should work 🙂
make a class for the item you're making, having the necessary attributes (lore, etc)
inside that class make an update method, updating the item's meta and call that everytime you want to update the item's lore
it also helps to show some code, applies to others as well. Sometimes you need to show more code. Also need to learn to better rephrase your problems if others who are wanting to help are not quite understanding.
this doesn't just apply to you, but others as well
im now uploading, i remember i have try that before. but i try again
I have shown code, read up.
