#development
1 messages · Page 56 of 1
i would suggest to use diffferent keyword
this one is a part of java its like calling a interface Double lol (not sure if IDE will allow it tho)
The current thing does actually work
here is the most advanced one ```java
public class MageClass implements ClassCommand.Class {
public static final NamespacedKey WAND_KEY = NamespacedKey.fromString("wand", VampirismMCPlugin.INSTANCE);
@Override
public void createInventory(PlayerInventory inventory) {
inventory.clear();
ClassUtils.goldArmor(inventory);
ItemStack mageWand = new ItemStack(Material.STICK);
ItemMeta meta = mageWand.getItemMeta();
if (meta != null) {
meta.addEnchant(Enchantment.KNOCKBACK, 2, true);
AttributeModifier modifier = new AttributeModifier(UUID.randomUUID(), "generic.attack_damage", 5, AttributeModifier.Operation.ADD_NUMBER);
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, modifier);
meta.getPersistentDataContainer().set(WAND_KEY, PersistentDataType.STRING, "fire");
meta.displayName(MiniMessage.miniMessage().deserialize(WandUtils.WandType.valueOf(meta.getPersistentDataContainer().get(WAND_KEY, PersistentDataType.STRING).toUpperCase(Locale.ROOT)).getName()));
meta.lore(List.of(Component.text("A mystical wand with ancient magic")));
mageWand.setItemMeta(meta);
}
inventory.setItem(0, mageWand);
}
}```
and the event used for the wand ```java
@EventHandler
public void onPlayerUse(PlayerInteractEvent event){
Player p = event.getPlayer();
ItemStack wand = p.getInventory().getItemInMainHand();
ItemMeta wandMeta = wand.getItemMeta(); // Get the ItemMeta
if (wandMeta != null) { // Check if it's not null
PersistentDataContainer dataContainer = wandMeta.getPersistentDataContainer();
if (dataContainer.has(MageClass.WAND_KEY)) {
if (event.getAction().equals(Action.LEFT_CLICK_AIR) || event.getAction().equals(Action.LEFT_CLICK_BLOCK)) {
if (dataContainer.get(MageClass.WAND_KEY, PersistentDataType.STRING).equals(WandUtils.WandType.FIRE.name().toLowerCase(Locale.ROOT))) {
dataContainer.set(MageClass.WAND_KEY, PersistentDataType.STRING, WandUtils.WandType.ICE.name().toLowerCase(Locale.ROOT));
} else {
dataContainer.set(MageClass.WAND_KEY, PersistentDataType.STRING, WandUtils.WandType.FIRE.name().toLowerCase(Locale.ROOT));
}
wandMeta.displayName(MiniMessage.miniMessage().deserialize(WandUtils.WandType.valueOf(wandMeta.getPersistentDataContainer().get(MageClass.WAND_KEY, PersistentDataType.STRING).toUpperCase(Locale.ROOT)).getName()));
wand.setItemMeta(wandMeta);
} else if (event.getAction().equals(Action.RIGHT_CLICK_AIR) && p.getCooldown(wand.getType()) == 0) {
WandUtils.use(wand, p, WandUtils.WandType.valueOf(dataContainer.get(MageClass.WAND_KEY, PersistentDataType.STRING).toUpperCase(Locale.ROOT)));
}
}
}
}```
ItemStack mageWand = new ItemStack(Material.STICK);
ItemMeta meta = mageWand.getItemMeta();
if (meta != null) {
meta.addEnchant(Enchantment.KNOCKBACK, 2, true);
AttributeModifier modifier = new AttributeModifier(UUID.randomUUID(), "generic.attack_damage", 5, AttributeModifier.Operation.ADD_NUMBER);
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, modifier);
meta.getPersistentDataContainer().set(WAND_KEY, PersistentDataType.STRING, "fire");
meta.displayName(MiniMessage.miniMessage().deserialize(WandUtils.WandType.valueOf(meta.getPersistentDataContainer().get(WAND_KEY, PersistentDataType.STRING).toUpperCase(Locale.ROOT)).getName()));
meta.lore(List.of(Component.text("A mystical wand with ancient magic")));
mageWand.setItemMeta(meta);
}
you clooud make a util for it to create Itemstacks
ye I probably will, already have for armor sets and potions
null player?
if its Nullable you can just put a null
yeah i just checked, null is allowed as player in .setPlaceholders
since if its nullable it means its optional optiion in a method
u cant
u mean in PAP?
yeah
you know the /papi parse --null %placeholder% command
if the placeholder as default return then i guess it not matter what u put into it
also go placeholder-api wrong chat
wrong chat move on please.
that was for plugin support, right
idk man even cj is providing support for papi here
i was not clear
go to Placeholder-ap / general plugins
It’s not a keyword, it’s an identifier
i'm sorry, but i'm asking development support here
correct , i assume i will always call things not the most correct way due my english for example a very low english level person would call a car when theres a truck or a van thanks for correcting
When is DelexeMenus going to be open-sourced?
at some point it will
@EventHandler
public void countertest(EntityDamageEvent event){
if (!counterhits.containsKey(event.getEntity().getUniqueId())){
counterhits.put(event.getEntity().getUniqueId(),0);
}
counterhits.put(event.getEntity().getUniqueId(),counterhits.get(event.getEntity().getUniqueId()) + 1);
Bukkit.broadcastMessage(ColorUtils.color("&d" + event.getEntity().getName() + "&f&l total hits &a" + counterhits.get(event.getEntity().getUniqueId())));
}
does event execute twice everytime entity get damage
or im total idiot where i messed up here
also please dont mind that i check if he existed i know i cloud add him to map on join
how ever its only to test how many hits are registered on server sidie
didnt know about it till now thanks ;p
so i assume the event is just called twice everytime am i correct?
idk I dont see why it would be
Did you use /reload to test this?
nah
my plugin does not support reload features
also its the only plugin in the server
i guess shit event execute twice
thanks
because it boardcasts only once
in code
but it boardcast twice now even after i did my 200IQ fix by doing /2 lol
so it goes 0 1 1 2 2 3..
Cool
how would i send a colored placeholder using rgb colors?
what do you mean by send?
yes, but papi no longer parses the colors, so if you send &cText, is the job of the plugin that displays the placeholder to parse it
you can parse the colors with the ChatColor.translate .. method
if your unable to use adventure for your colors chatcolor is still a viable option as its not deprecated because its pending removal
I mean that's the dillema isn't it? If paper were to remove ChatColor, it would be basically impossible for plugins to be compatible with both spigot and paper
Either one, or the other
who even uses spigot and it's api?
also minimessage >>>>>>
makes life so musch easier
That is not true at all lol
Aventure has a spigot platform
Yeah, but afaik it doesn't use the native methods on paper
So, if paper were to remove the old color system, the adventure bukkit adapter would probably break
i dont believe they have removed anything that the spigot adds so far
spigot didnt add anything special tbh
i still use bukkit and nms
I just hope that's a joke
i have tried some pubsub stuff with redis (lettuce api) and works
- server to server
- proxy to server
but strangely proxy is not getting the message from servers
- server to proxy
using the same code for all servers and proxy, couldn't figured out for 20 hours
tried to debugging but it just does not getting the message on proxy if it sent from server
maybe it has something to do with velocity
i think i am going to use the bungee messaging for server to proxy part
Keep in mind that it requires a player to be online
and i guess you need a player reference as a parameter to send a plugin message
or not
maybe sockets?
it started to get a little bit messy
You don't need a player reference to send it but if no player is on the receiving side, the message is discarded
i just checked some plugins and i don't think that is a velocity issue
Make sure you are connecting to redis though
I was trying to use mki crate (https://crates.io/crates/mki), but my antivirus didn't allow proc-macro2 to be executed when cargo was compiling my project just after I added this mki crate.
Cargo error:
error: failed to run custom build command for `proc-macro2 v1.0.66`
Antivirus log:
Event: Malicious object detected
User: DESKTOP-IJRJIGM\User
User type: Initiator
Application name: cargo.exe
Application path: C:\Users\User\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin
Component: File Anti-Virus
Result description: Detected
Type: Trojan
Name: VHO:Trojan-Downloader.Win64.Convagent.gen
Precision: Heuristic Analysis
Threat level: High
Object type: File
Object name: build_script_build-bd4b88e523d04046.exe
Object path: D:\Local Disk\Users\User\Documents\TrashProjects\CLionProjects\RustPlayground\target\debug\build\proc-macro2-bd4b88e523d04046
MD5 of an object: 297F49F22AB15A0BDE347BB071B5A5CF
Reason: Cloud Protection
Does anyone know what is this proc-macro2 and why was it blocked by an antivirus?
https://paste.helpch.at/enumimihok.java
Any reason why my plugin is disabling and not picking up on Vault? Theres my main class. On startup it just doesnt recognize that vault is installed and is just disabling...
pls ping me if you know why
plugin.yml?
Sure one sec
unless they changed the API implementation i really dont know whats wrong with what I'm dojng
doing
Vault is loaded before my plugin as you can see in the main class which I linked already
Only “error” in console is that my plugin is being disabled due to no vault
that's not how it works buddy
just because you check if vault is there doesn't mean he loaded first @small arrow
needs a vault impl provider like essentials or something @small arrow
whats your current loaded plugins
Does anyone have ressource on how to make api using a plugin ?
Like how can i acces playerdata of my plugin A inside my plugin B
An possibly without give out my code (like the devlopers of plugin B only have acces of an interface and not to a class that contains code)
Is there any way to detect what plugin dispatched a command?
yeah it is very annoying when a random plugin runs a command and I have to find it lol
declaration: package: org.bukkit.event.server, class: ServerCommandEvent
that doesn't tell you how to make an api tho
just tells you to minimize api visibility
sadly it doesn't fire that iirc
this would require the use of modules, if may be complicated if you never used it before
if you want to completely hide the code
but you could have an interface
but the api jar would still have your internal code that isn't needed (but it doesn't really matter)
this should work, since a plugin is a non-player...
unless the plugin makes the player execute it
I need it for commands run through console* ups
From what I have seen you have a interface that has all of the methods you want the API to have. Then, in the actual code, you implement it. Then, you only give the API interface to Plugin B, so they have no access to the implementation or any of the code it calls. There is a bit more to it than just this, but this is the basics. I personally don't know exactly how to do it though.
I couldn't find any good resources, but I only did a quick search
What you can do is have like an interface EpicPluginAPI which has like getCoolValue() for ex
Then a class EpicPluginAPIImpl (the -Impl suffix is just preference) that implements EpicPluginAPI
Then in your main class, you can have like public static EpicPluginAPI getAPI()
If you upload your plugin to GitHub, then devs can use https://jitpack.io to easily use your api (you usually don't need to do anything to make jitpack work besides upload the code to github as long as you're using gradle or maven)
Note: this is a simple method - there are better ways to do this, but the first time doesn't need all the fancy stuff
My plugin, essX, vault
Yea how ever u have to fork the server jar
Like it’s most simple
yeah well, without doing that D:
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "command here")
i think i have an idea
but im via my phone
so get the concept + - from code snippet
u can use bytecode Manipulation and replace the method and then u load the modified Bukkit class at runtime
i have even better idea!!!!
sec acutally i can write this one on phone
if it works like it then it should be good
@EventHandler
public void serverExecutesCommand(ServerCommandEvent event){
System.out.printin("stacktrrace for gaby lol + " + event.toString);
i checked this event exists in bukkit
just make it toString and look at the stacktrace im not sure like what it loooks like
but u will find callinig class 100% theer.
theer
there*
fk
Constructor and Description
ServerCommandEvent(CommandSender sender, String command)
Method Summary
Methods
Modifier and Type Method and Description
String getCommand()
Gets the command that the user is attempting to execute from the console
static HandlerList getHandlerList()
HandlerList getHandlers()
CommandSender getSender()
Get the command sender.
boolean isCancelled()
Gets the cancellation state of this event.
void setCancelled(boolean cancel)
Sets the cancellation state of this event.
void setCommand(String message)
Sets the command that the server will execute
200 IQ
its from docs
actually modification to old code i send
@EventHandler
public void serrverExecueCommand(ServerCommandEvent event){
System.out.printin("we got you motherfuckerrr slap kawaii" + event.getSender.getclass.toString);
}
solved completely docs are great.
damn i need to get a job in IT company
You are probably missunderstanding my question. I need to know what plugin dispatched the command, not whether it was run by console.
oh shit yeah then go back to Stacktrace option...
also in the event sender returns the jar that executed i think
that class
of other plugin
just hopped in so sorry if I'm missing context
but if using stacktrace, use stackwalker 👍 👍 👍
(gets stack "lazily" so more performance-efficient)
nah nah what i said will work i think
dkim im wrong event.getSender.getclass will return other jar class
CommandSender getSender() Get the command sender.
aka ConsoleCommandSender or Player
its what gonna appear
public static boolean dispatchCommand(@NotNull CommandSender sender, @NotNull String commandLine)
throws CommandException```
Dispatches a command on this server, and executes it if found.
returns false if no target is found
sender - the apparent sender of the command
commandLine - the command + arguments. Example: test abc 123
CommandException - thrown when the executor for the given command fails with an unhandled exception
I don't think there is a way in the current software to check what plugin sent a command. You'd probably have to add your own code in the API
tthen what can i say get the stracktrace of event via event.tostring
if not byte code manipulate on runtime and change class
great
else decompile and recompile
how ever i think iit wll be there in the stacktrace
99%
like there yes or no but i dont want to say yes for sure because im not sure about what its printing
Whats with the spam tony? You can write more then 10 words per message lol
nah im used to send short messages on my cellphone
dkim the only one that said anything coherent lol
Thanks you for your respond i will try to find out how to do to make my things work anyways thx a lot for your time !
I will try to use this method i think i understand what do you try to explain and also do you have any explication about what is the fancy stuff you was talking about ?
On phone so I can't explain much rn but for ex
- maven central (or self hosting a maven repo) instead of jitpack
- gradle/maven modules to split between api interfaces and the actual plugin, and this also let's you only publish the api module
- not using a static getter as bukkit has some built in ways (although tbh I don't use bukkits method lol)
I think that's about it (kinda ordered from most fancy to least fancy)
Humm i see thanks again for your respond !
Np
I'm prob gonna go to sleep soon so if I don't respond later that's why 🙃
Good night !
is it possible that when I execute the cancel method on a scheduler, it doesn't actually cancel it?
Also, does canceling take any time? For instance, if I cancel a scheduler and right after I set it to null, will that still cancel it?
Bukkit scheduler?
Bukkit scheduler cancel only cancels the next iteration
And so the cancelation time is however long it takes for the current iteration to run, or instant if it already ran
if you call cancel() on run(), make sure to return afterwards
oh, so if I user a runLater, even if I cancel it, it will run it after X time?
No
If it is currently running, it will cancel next
If it is not currently running, it will cancel immediately
And keep in mind what gaby mentioned too
I call cancel outside of the task
if you call cancel now, it won't run the next time it would run
the bukkit scheduler doesn't have a ways to interrupt a task that is actively running if that's what you're wondering, there are other meanings to achieve that with java apis
so, just to clear things out, this is the method executed to delete a duel instance:
public void deleteDuel(DuelData duel, Player winner, OfflinePlayer loser) {
for (Block block : duel.blocks()) {
block.setType(Material.AIR, block.getType() == Material.WATER);
}
BukkitTask scheduler = duel.scheduler();
if (scheduler != null) {
scheduler.cancel();
}
duel.scheduler(null);
ongoingDuels.remove(winner);
ongoingDuels.remove(loser.getPlayer());
duel.arena().isAvailable(true);
DuelEndEvent event = new DuelEndEvent(winner, loser, duel.arena(), duel.type(), duel.kit());
Bukkit.getPluginManager().callEvent(event);
}```
this gets executed when a player dies
but for some reason, it is not being canceled.
don't even know why I set it to null after, since it will be deleted anyways lol
that looks fine, your issue is somewhere else then, scheduling other tasks and losing a reference to them or something
this is the only scheduler I have
¯_(ツ)_/¯
cancelling does work, I can tell you that much
what if, since I set the task to null right afterwards, it happens in the same tick, and since it only cancels on the next tick, it's canceling a null instance? Does that make sense
☺
you do that by canceling it correct?
you cancel it, the next time the scheduler will try to run it it will see it's cancelled and get rid of it
dont use bukkit schedulers
you have to if you want to run sync tasks
thanks tony, very helpful solving the issue
lol
this task is the only thing that handles a duel ending in a "draw"
did u try to add some debugging to see if it actually executes?
so it must be this task.
Debug when u set the variable maybe
i suggest to use map to handle arena / duel stage
I haven't really looked at the code tho since mobile formatting sucks
easier to handle
debug everything
True
will do after dinner
dinner can wait a day or two
why you so mad
bon appetide my best friend Afonso
get your vittamns !!!!!
Since when is Chunk.setForceLoaded persistent?
Are plugin tickets persistent? Chunk.addPluginTicket
no. just no.
since force loading was introduced
Huh never had the chunks stay loaded after a restart when using it until now.
plugin chunk tickets are not persistent, no
Do you know off hand the version they were added?
Ok thx
the API method maybe 1.14? 1.15? not sure, but chunk tickets have been a thing for a bit longer
Well 1.14 added setForceLoaded so ill check there first
yeah, mojang added /forceload around then
Looks like 1.15 Hmmm.....
What can I do for 1.14 cause I can't cancel the ChunkUnloadEvent and can't forceload since its persistent (Apparently lol).
the plugin chunk ticket method was introduced in 1.14.4, force loaded api in 1.13.2
I don't see any /forceload command on paper 1.20?
I don't remember the exact command name but there's a force load command
Trying to figure out how to use it to remove forceloaded chunks lol.
I think they're block coords
🤦 /forceload remove all thx matt
💔 how u cloud
ii mean not u
afonoso
i wished u good appetiide
and u said no?
u deny my nice offer to have fun wiith food today
what a rude guy
I see.
Nvm, I'm just dumb
Anyone know if plotsquared has a way to get all entities in a plot?
well if they have an api, you can likely get the plot, its low and high points and calculate from there
Was hoping I didn't have to.
well, something is better than nothing
shouldnt be too difficult having the rectagle points
Thats not really the hard point. Just would have made the rest of what I need easier.
Does Plot.getMembers include the owner UUID?
Apparently you can't just get high/low corners with plotsquared 6
100% being called and canceled
Whats the difference between com.plotsquared.core.location.Location.getOwnedPlot and com.plotsquared.core.location.Location.getPlot?
anyone know of a way to store a boolean for a player besides scoreboard tags & file?
PDC (in latest)
that exists for entities???
Yeap
alright what about for older versions?
File unfortunately

Could always add your own data to the world file
Pretty sure he meant custom/Not already generated
yeah, would much rather use an existing system (like PDC) than have to setup my own file thing
making 1.8.8-1.13.2 use goofy custom data file system 🤪
i would say that you should manage it yourself if you are making something cross-version
rather than dancing around using nbt on x.y.z but pdc on t.u.v but this other solution a.b.c
@dusky harness
Hm?
what
anyone know how reliable item nbt api's NBTInjector for modifying custom nbt on entities is?
cause it looks a bit like cheeky/hacky and i also dont know if it supports all versions
why not use pdc?
They want to support non PDC versions
support all versions above 1.14
ez done
im supporting 1.8.8+
you problem then
¯_(ツ)_/¯
supporting almost 10 year old versions is an issue caused by the dev
1.8.8 turned 8 years old today
me too
it's old enough to drive
no clue
well my question still persists
you can get a WE region from it and fetch the entities via WE
Damn do we not celebrate??
I did not use it for entities but I can vouch for NBT API.
Will get there dw
make it deprecated pls ty
when i goto compile my plugin it errors and says this package me.clip.placeholderapi.expansion does not exist
placeholder api is in there so im confused as it lets me import it
what does "is in there" mean?
that Placeholder api is my my Libraries for my plugin
Yeah they should have keep game more stable
And do good updates
And gonna tell u also it’s not about pvp update
Those things are easy fixable
Did my first command to reload a config. I registerred it in the Main Class however, when I wanna run it this error pops up: https://paste.helpch.at/didoqotaqo.rb
https://paste.helpch.at/nayamoqivu.typescript
this is my code ^
You didn't initialize the main class in your command
use maven or gradle for implementing it into your plugin. the way you've tried to add it will include the entire placeholderapi jar in your plugin and will cause more issues
?di
Dependency Injection
Dependency Injection is a way of providing objects with the objects they need ("dependencies"). This is usually done with a constructor, but can also be done for individual methods
Read more here: https://en.m.wikipedia.org/wiki/Dependency_injection
Dependency Injection in Java:
https://paste.helpch.at/yijawupoju.java
Dependency Injection in Kotlin:
https://paste.helpch.at/esogakutod.kt
Was that directed @ me ?
yes sir
I thank you
as a silly note, You can just do
if (!sender.hasPermission("admin")) {
no ☺
return;
}
this.plugin.reloadConfig();
dont need to check for player
Ah I see, I always used to do it back in the day, but actually you're right.
you dont have to do this but usually when creating a permission it would be something on the lines of plugin.perm so for this case could be like bc.reload or bc.admin, you could also create a group of permissions in your plugin.yml that has bc.reload as a child perm of bc.admin
I haven't made experience with the
Permission: in the plugin.yml yet. I do not quite how that works
specifically the permissions section of that
Reading through it rn
Anyone has an idea, when I used my self-made command (upon writing it in chat) it shows in chat?
what shows in chat
probably just echoing the command back if i had to guess
isnt that a result of return false in the
onCommand method
if you return false it outputs whatever you defined in the plugins.yml for usage afaik
Or the command itself if usage not defined
if your onCommand returns false itll print the usage found in plugin.yml to chat, so make it return true

yeah i love nbt api
and just asked in their discord, it doesnt work on players (obviously...) so cant even use it (also said its not stable)
i think i have pdcs on players
Wait why doesn't it work on players? If PDC works on players
You can't, HashMaps don't guarantee any order
i tried chatgpt but its not workin
no
Ig u can use LinkedHashMap and Google how to get last element of it @elder perch
just read javadocs and use google
Also I would only refer to chatgpt as a last resort
Theres no comment, upvote/downvoting on answers
So the chatgpt one in this case isn't actually the best way
you wait for sequenced collections
Perhaps access the pdc key after checking the config xD
sequenced collections 
const map = search.searchField(pakage, className, field);
console.log("request /search/field", req.query, map);
return res.status(200).json({"result": map});```
I got this endpoint on an express app, the console.log prints the data, but somehow the json sent is just `{"result": {} }`. Is there any chance that it attempts to return (return res.status ...) before searchField finishies?
what is search
A class from my project, it has some data collected from javadocs (classes, methods, fields) and it just goes through them to check if the field exists (e.g. the input is org.bukkit Material STONE)
// the console.log
request /search/field { package: 'org.bukkit', class: 'Material', field: 'STONE' } Map(4) {
'1_18_2' => true,
'1_19_4' => true,
'1_20' => true,
'1_20_1' => true
}```
is it sync?
no, thought that might've been the issue.
try wrapping map into json?
{}
return res.status(200).json({"result": JSON.stringify(map)});
yeah, { "result": "{}" }
same response?
wdym same response?
with
return res.status(200).json({"result": map});
and
return res.status(200).json({"result": JSON.stringify(map)});
btw the map is a Map<string, boolean> if that matters
yeah, the map is empty in both cases
welp looks like JSON.stringify doesn't know how to serialize a Map ?? doing this const jsonArray = Array.from(map.entries()).map(([key, value]) => ({ key, value })); works
D:
you can just use Object.fromEntries(map)
return res.json(Object.fromEntries(map)).status(200);
plus the result:
yeah weird that it doesnt do that under the hood, since, well, like json, map is storing key-value pairs.
classic javascript L

it was made before 1.14 i think or something
and so it replaces bukkit entity class with its own and injects it to all entities (besides players obv)
https://pastebin.com/RSzHbZ0d I'm getting a warning that this if statement is always false. Not sure why that might be. Any ideas?
player.getInventory().getItemInMainHand() == null I'm pretty sure this is annotated as NotNull
player.getInventory().getItemInMainHand().getType() == Material.AIR ?
yes
\o/ thank you
you can put it on a variable and check if it is null || air, at least thats what I do.
thank you
Oh interesting
Spigot also has air
i think they ment in paper in places where spigot would return a null itemstack, paper returns a AIR itemstack instead
meaning all the previous methods that were anotated as null because of spigot are now notnull in paper
Ye prob
I think paper does that for some methods but this method is notnull for spigot as well
paper doesn't change that in any place
dosen anyone know how to make my commands not red with deluxemenues?
Wot?
var pdc = source.getPersistentDataContainer().get(key, PersistentDataType.BYTE); // move this
if (!plugin.getConfiguration().getFilter().isEnabled()) {
return false;
}
// to here
if (pdc == null) {
return plugin.getConfiguration().getFilter().getDefault();
}
return pdc == 1;
i think thats what he means at least
Hey guys is there a way to make so the dependencies I use in gradle just download a jar file into a folder and it gets the dependencies from there instead of shading
https://docs.papermc.io/paper/dev/plugin-yml#libraries - for bukkit, only maven central
https://docs.papermc.io/paper/dev/getting-started/paper-plugins#loaders - paper only, more boilerplate, any repo
Thank you !
It works !
PAPI hook: https://paste.helpch.at/bawovicahe.java
it always says PlaceholderAPIPlugin.getInstance() is null when I try to use my PAPI.load function which calls the PlaceholderAPI.setPlaceholders() function.
Full error: https://paste.helpch.at/liqulijiye.rb
Bukkit Plugins: (9):
- BlueSlimeCore, CMI, *CMIEInjector, CMILib, GoatHub, PlaceholderAPI, spark, Vault, ViaVersion
you are probably shading papi in your jar
nope
well uh
i use pom.xml
from the extendedclip repo
i have an intellij artifact, it builds the jar file when I build the project
open your plugin using some form of decompiler, like jdgui or recaf and see if you are including papi classes in your plugin
well the contents of the papi jar atleast
it will be obvious if you are or not
worst two words
anyone know why i'm getting this issue in my proxy console when i try join skyblock server through my hub :
Error occurred processing connection for NottLazy ConnectTimeoutException : connection timed out: rogueskies2.falix.gg/46.4.94.213:57307
Or just unzip it
or just jar tf | grep
Hello, I made a system to report a message, the db is in auto increment and I have to put the id in the arguments of the command so i can check if the message has been reported or not, the thing is that, if I send a message, the id would be last_id + 1, if the last id was 1, then it would be 2, and if another player sends another message but the preview message hasn't been reported, the id would be also 2, so, if i report the second message, but not the first, the first would be impossible to report, anyone can help me please ?
can you send your db schema? i'm not sure exactly what your setup is
can anyone please help with this? i have been trying to figure this out for hours
awesome, also what does the /report command look like when someone is calling it?
as in what arguments does it take in
or are you using the new chat report system
id: long id = smain.getLastID() + 1;
what is smain.getLastID()
is that the same autoincrement id that you have in your schema? i hope not
public long getLastID(){
try{
if(connection.isClosed() || !connection.isValid(0) || connection == null){
connection = DriverManager.getConnection(url, username, password);
}
Statement statement = connection.createStatement();
ResultSet set = statement.executeQuery("SELECT id FROM reported_messages ORDER BY id DESC LIMIT 1;");
if(set.next()) {
return set.getLong("id");
}else{
return 0;
}
}catch (SQLException e){
e.printStackTrace();
return 0;
}
}
Why are you speaking cli
i see
i still dont understand how people actually /report a message though
well, if someone insults someone, that can be useful
thats not what i meant hold on
oh
in the first place, your issue is that some messages are unreportable atm. that's why i wanted you to show me the arguments that go into the /report command that a player issues when they want to report a message lol
i think you misunderstood and showed me usage for the command that admins use to view reports instead
anyone know why i'm getting this issue in my proxy console when i try join skyblock server through my hub :
Error occurred processing connection for NottLazy ConnectTimeoutException : connection timed out: rogueskies2.falix.gg/46.4.94.213:57307
nah, the command is generated, i made this command impossible to know, the command is triggerd when the player clicks here:
okay
why is it impossible to report an older message
i'll make a record
okay i think i see
so basically while one message is in the process of being reported, a second message can swoop in and claim the same report ID?
nah
just
the first message
has id 1
but if it's not reported
and i send another message
the other message has id 1
so both have same id
and if i report one i can't report another
right so the second message is using the same report id as the first
i translated my french message in english, i think it'll be more understandable:
moreover the code does not work correctly, when the message sent the command executed is: /report <player> last_id+1 <message>
except that if a player sends a message after and the previous message is not reported
it will be the same id
so the player reports the message according to
but the previous message is considered reported
okay i think the problem is really just that you have too much state for your own good
your code seems to be committing to a specific report ID too soon, you should not need to pick it ahead of time
just have the DB autogenerate the report ID once you actually insert the row
basically you should not need to use this function
but the thing is that i have to check if the message has been reported or not
so the player cannot report it twice, or more
you don't need to know the ID to know if it has been reported
oh?
frankly the best solution to knowing if it is already reported is to log every single message
and use the UID of the message entry everywhere else
but a scuffed alternative is to just search the DB for any messages that have the same author, reporter, and body (although this isnt very good) actually dont even bother with this
using the latest autoincrement ID to check for if the message was already reported is just not a good solution since the latest id can change at any time
and is also shared across all players which makes it extra likely to not stay consistent
to elaborate on this, i would suggest having a messages table with columns id, author, body, timestamp, and then changing your reports table to be id, reported_message_id, reportee_uuid
where the reported_message_id is a foreign key pointing to the messages entry
then checking to see if a player has already reported a message is as simple as checking if there is already a row with both a matching reportee_uuid and reported_message_id in the reports table
uh, i didn't understand everything...
tldr is that i think you should store every single message that is sent
that way, you will be able to have a permanent ID for every message
this makes it easy to check if the same message has been reported multiple times by the same person
how do i create a dropper gui? i found out how to create a chest one, but cant figure out anything but a chest
Google it
Its pretty easy
Bukkit.createInventory(null, InventoryType.HOPPER, "title");
This should work
ah okay, thank you
uhm a bit new to using gradle in kotlin, how do you set the encoding to utf8?
options.encoding isn't working
Send
?
this is how I have it rn: tasks.compileJava.options.encoding = "UTF-8"
ah it needs to be inside {} after compileJava
Also do tasks.withType<JavaCompile>() { ... } so it works with other tasks like test compilation
Kotlin is default utf8
So u don't need to set it
he means hes using the kotlin dsl
yeah couldve explained better
I am wondering on how to detect intricated placeholders.
%player_tier_display_%player_tier_of_karma_%player_karma_amount%%%
%player_tier_display_%player_tier_of_karma_50%%
%player_tier_display_vigilante%
&aVigilante
But with this regex %(\w+)%, I can only check %player_tier_display_% on the first line, which is not good at all. any advice ?
perhaps go with smth like {placeholder}, this way you can detect when a new placeholder starts easier
you mean something else than %placeholder% ? Will the problem not be the same ?
I still don't understand what you're trying to match
I want to match %player_karma_amount% as value to be used for %karma_tier_of_karma_VALUE%, this new value will be used for %player_tier_display_SECOND_VALUE%
kind of recursive.
Wot
nested placeholders, whats so hard sky lol
my english
If you just use % you can probably make a method that parses placeholders by a priority level.
Do you mean
check %player_karma_amount% first (ex HIGH PRIORITY)
check %player_tier_display_VALUE% last (LOW PRIORITY)
?
yes
Never thought about it. It could be useful as long there is no need of placeholder A needs B and B needs A ^^
I'll try that, thanks !
No my brain isn't braining
Jet lag
rip
synchronous brain problems
gotta run lag on another thread
Skyslycer must be running on minecraft 1.13+
No I'm running Minecraft -6 hours
Pro ultra max + hd ultra hd wqhd 720p giga maxi mega kilo 64
damn new iphone looks sick
Lmao iPhone 42 720p kilo
https://paste.helpch.at/aqasexecim.java
any reason why when I farm wheat, carrots, or potatoes, their drops are not being multiplied? (Spigot 1.19.4) (yes my events are registered)
Please ping me
just add debugs and make sure the last part is being reached or not
what's the easiest way to put custom skulls (from like minecraft-heads.com) into a gui
How do I get gradient colors to send in bungeecord send message?
using paper, latest versions, GameProfile, set properties and texture url
sorry, what?
you need to make your own translate color method
Mm and bungee platform is probably the easiest
I did still nothing
It’s getting reached and all it’s just the logic of giving the player the drops I think
I’m 99% sure that everything is fine which is why I’m asking for help
Fixed it
I figured it out like 5 mins later, I didn't need to make my own method for it
Is there any method to check for similar locations without yaw and pitch?
I know I can do a normal if matching x,y,z but was curious if there was already one that I'm not seeing.
You might wanna check blockX, blockY, etc, if the specific point in the block does not matter. I don't think there is a "built-in" method to do that, I usually just create a Kotlin extension function for these cases, because it also depends on what you want to do, what is considered "similar" in your application logic. For one, maybe the point within the block matter, and in this case they might wanna calculate the distance between two locations, and if it is lower than a certain threadhold, then they are considered "the same", while others might not case about specific place within a block, and only care about the block itself, in which case two locations might be "the same" even though they are different points within the same block. I have already used both approaches in different situations, it is important for you to evaluate what is considered "similar" within your application, and choose the right approach to be able to acomplish your goals.
PS.: Not AI generated, I was just feeling very descriptive today for some reason 👀 .
Yeah I am fine, thank you, I answered him in the start of the second sentence btw: I don't think there is a "built-in" method to do that, I just wanted to point out a possible reason for why there is not a "build-in" method that does that.
Just wanted something as simple as Location.equals(Location) but that matches yaw and pitch.
MyLocation.valueOf(loc1).equals(MyLocation.valueOf(loc2)) 
Same issue. Yaw and pitch
huh
Wait, you do want to compare only the yaw and pitch?
Oh you mean make my own object?
class MyLocation {
private int x, y, z;
public static MyLocation valueOf(Location loc) {
// assign xyz
}
// override equals
}
Yeah misread what you meant at first.
Because that is what you asked here: that matches yaw and pitch.
Didn't want to do that either.
you left out the "but" lol
Well, I am not a native English speaker, but your sentence sounded like Locations.equals matched only x, y and z, but not yaw and pitch, and you wanted the complementary method, which would be matching only yaw and pitch.
Read m0dii's responses too. He knew what I was asking.
tldr no built-in method
👍
Yeah, so your options are limited to:
- Create a new wrapper class (@river solstice)
- Create a static method (or extension function if you're using Kotlin)
though you can probably do loc1.distance(loc2) == 0 @hoary scarab
I was thinking that but it does more calculation then needed.
¯_(ツ)_/¯
could also set yaw/pitch to 0's before comparing with .equals
but that's additional 4 lines
mmm extension function
but yeah no you probably should create a static method to compare two locations including pitch & yaw
well hellooo
for some random reason the function #getMenu(String) return null even if the menu exists and #getAllMenus() also return null, but until today it didn't returned null, why is that?
all the menus are loaded correctly (21 to be more precise)
I'm using DeluxeMenus-1.13.7-Release on my server and my plugin
[LIFE-RO] Task #2031976 for Lifero v0.1 generated an exception
java.lang.NullPointerException: Cannot invoke "com.extendedclip.deluxemenus.menu.Menu.getMenuItems()" because "menu" is null
at com.lifero.modules.minecraft.automatically_events.Event.<init>(Event.java:59) ~[lifero.jar:?]
at com.lifero.modules.minecraft.automatically_events.AutomaticallyEvents.lambda$new$0(AutomaticallyEvents.java:31) ~[lifero.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.20.1.jar:git-Purpur-2023]
at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:480) ~[purpur-1.20.1.jar:git-Purpur-2023]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1507) ~[purpur-1.20.1.jar:git-Purpur-2023]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:487) ~[purpur-1.20.1.jar:git-Purpur-2023]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1421) ~[purpur-1.20.1.jar:git-Purpur-2023]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1192) ~[purpur-1.20.1.jar:git-Purpur-2023]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[purpur-1.20.1.jar:git-Purpur-2023]
at java.lang.Thread.run(Unknown Source) ~[?:?]
public Event(int max_events, List<String> played_events, boolean changeEvent) {
Menu menu = Menu.getMenu("menu");
Map<Integer, TreeMap<Integer, MenuItem>> menuItems = menu.getMenuItems();
// didn't pasted the whole code..
}
does your plugin dependsOn: DeluxeMenus?
it might be loading before it and therefore there are no menus loaded
Debug menu
nope
oh yeah it should
i tried /dm reload but is the same
yeah you want your plugin to load after DM
hmm, alright i'll try
it's the same
i don't think that it's the problem because on the first day i loaded the plugin, a few weeks ago, i didn't had this problem and i loaded it with plugman
i didn't had this problem and i loaded it with plugman
Don't load/unload plugins with this. Restart your server.
Also you probably got lucky with which plugins loaded first.
Add some debug to check if menu is null or if its actaully in the list.
It's the same thing, it doesn't work anyway
It return null when i try to get all the menus
.
i tried loadbefore and softdepend to load after, but still doesn't work..
⚙️ Development Support - Stay on topic! - Not configuration help - No favourite IDE arguments.
#general-plugins @umbral halo
ok sry
hey folks. I'm coding a report system plugin and I wanted to make a filter item which filters items based on a variety of options, like status and user
however, for some reason whenever the inventory updates, the lore doesn't update, could anyone help me with this?`
its written in kotlin
I'm also using TriumphGUI's library for my gui's
hmmm
can you give a bit more details? ex where do you change the lore and update the inventory
so the inventory gets updated every time a click happens, and the lore is set at the bottom. I tried using methods but it didnt seem to chzange anything, thats why its a bit messy
I send the lore in chat, and it does update it
it sets the active one to green and the inactive ones to red
it just doesnt update inside the inventory
are you re-setting the lore back to the itemstack/itemmeta?
it seems like setLore() is only changing the list, but doesn't set it back to the item
i cant really change it since the lore for the item builder uses Components
wdym?
Like what I mean is can you updateItem(newItemWithUpdatedLore)
ohh
or maybe just doing ItemMeta#setLore and ItemStack#setItemMeta is enough but I'm not sure, I haven't done a lot of gui stuff in a while
TriumphTeam has a discord server btw where you can ask for help in the future as well
too much code, idk even where to look
ok and where are you updating the item?
thats a great question.
i assumed that every time i click a slot it updates the items
but i cant seem to find a way to update the lore because i cant cast an ArrayList of Components to ArrayList of Strings
the lore is set with lore()
ItemBuilder.from(fillerItem).lore(new lore).build()
there is GuiItem#getAction
or i can make a whole action variable
https://paste.helpch.at/naquqokatu.kotlin I got this MM tag for papi placeholders and when I simply use <papi> without any arguments, the error message set on popOr() doesn't show up anywhere, do I need to catch some exception?
var filterItem = ItemBuilder.from(Material.BOOK).name(filterName).lore(
setLore() as List<Component?>
).asGuiItem(action)
gui.setItem(45, filterItem)
filterItem = ItemBuilder.from(Material.BOOK_AND_QUILL).name(filterName).lore(filterLore as List<Component?>).asGuiItem(action)```
still doesnt update
fyi you should return List<Component>, not ArrayList<>
and again, where do you call this? After updating an item you need to call gui.update() to re-set the items.
this is at the bottom of the setItems function
so its literally the last thing thats run
yeah ok, but you need to run it ever time you want the filler item to update, e.g. after clicking on it
yes but i cant update the item inside of the guiaction
why not?
because the item isnt even initialized yet
and i cant access the item inside of the gui action
Yeah I'm not sure how to give you an example
im sorry for being sto stupid
i have a massive headache and am sleep deprived because my fire alarm went off like 20 times last night
I'll just put a pin in it for now
and come back to it when im smarter
help?
Could it be a loading isssue? aka do you have deluxemenus as a depend/softdepend
There is updateItem
Which prevents that
Hello, with placehoder api. if I have an extenre plugin that displays my placeholder. Knowing that the placeholder changes often, will it update automatically?
I dont get the actual question tbh, other plugins parsing placeholders use PlaceholderAPI.setPlaceholders(p, text) which internally calls the class your registered when creating your plugin, so no matter which version it is, the class you choose will be used to parse the placeholders if params match your checks, every time the placeholders are parsed, your class is called, so if your plugin (with placeholders) is not updated, it will call the old code, if the server owner updated the plugin, the new code will be called as it's reading what is currently in the plugin .jar
I mean, for example, a placeholder that displays the number of players. The number of players can change. Will it update?
indeed, it will if the placeholder is parsed again (and the code of the expansion returns the current amount of players)
Depending on how many times it's called, yes
so tablist plugins update the placeholder automatically I guess (every x times)?
Yes
How can I add onto already existing lore? In my custom enchants plugin I'm adding lore to an item such as "Speed Enchant 1" and when I want to add lore to it (ex. they add another enchantment) the new lore just overrites the existing lore. I've tried something like heldItemMeta.getLore().add(ChatColor.LIGHT_PURPLE + "Multiplier Enchantment I"); but it wont work. Any suggestions?
Have you set the item meta again?
The lore is defensively copied
wdym
heres an example from my class:
ItemMeta heldItemMeta = heldItem.getItemMeta();
heldItemMeta.setLore(Collections.singletonList(ChatColor.GREEN + "Auto-Sell Enchantment I"));
heldItem.setItemMeta(heldItemMeta);
get meta
get lore list
add element
set lore list
set meta
Modifying the list wont work because getLore returns a copy of the lore
ItemMeta heldItemMeta = heldItem.getItemMeta();
List<String> lore = heldItemMeta.getLore();
if (lore == null) {
lore = new ArrayList<>();
}
lore.add(ChatColor.GREEN + "Auto-Sell Enchantment I");
heldItemMeta.setLore(lore);
heldItem.setItemMeta(heldItemMeta);
Maybe I did something wrong but this did not work
Show full code if haven't fixed yet (Oops, 20 minutes late)
No worries! I’ll send all relevant code when I’m back to my PC. The class is around 800 lines long and I don’t want you to have to comb through everything lol. Relevant code is only around 150 lines iirc. Thank you for all the help thus far
here is the code! https://paste.helpch.at/etaroxomat.java
Essentially its just this but with different cases for different enchants + levels
Do what you did here and make sure you add it to a list variable
Since I think getLore returns a copy
did I not?
No u added it to getLore directly
so essentially, I need to create a new list, and add it to that?
Do what you do here
That code should work
If it doesn't work then send the relevant code in paste again
Btw feel free to ping me for replies 🙃
i did and then you said "Do what you did here and make sure you add it to a list variable"
Hm does it send the successful message but not add lore?
wait a minute..
i think i know what the issue is
ill update you in a sec
okay so now it adds the lore on top of the prior enchantments, however it adds 3 of them...
current code: https://paste.helpch.at/ipajewuzon.java
if (!lore.contains(ChatColor.GREEN + "Auto-Sell Enchantment I")) {
lore.add(ChatColor.GREEN + "Auto-Sell Enchantment I");
heldItemMeta.setLore(lore);
heldItem.setItemMeta(heldItemMeta);
I guess ill add something like this
Hello, can anyone help me compiling GriefPrevention expansion by pixar02 using Visual Studio Code?
yes it can
isnt it my default just empty list?
by
anyway im here to help babe so ill give him the right advice
anyway first thing is keep adding lores so player can see how ever start using NBT tags
its way faster to read NBT tags then lore in performance and easier to handle
u can also write in the NBT tags the line off the enchantment so u can modify it later ;p
no
idk why it is null by default, visually at least, no lore (null) / empty list looks the same.
because bukkit put a lot of effort into designing their apis
nullable collections on top
bruh
Anyone got a clue how I could go about making blast proof glass like in hypixel? I have adjusted the hardness of the glass very high, so when tnt is placed behind glass it works (like this https://i.imgur.com/WFWI2cW.png)
However when tnt is placed on an edge (like this https://i.imgur.com/GB6Ibkr.png) the wool breaks when the tnt blows up. Any suggestions?
They probably do their own calculations
Check if all sides in direction of blast are covered.
Acc yeah thats a good shout so if there is an adjacent block in the positive x cancel all explosions in the positive x direction maybe
its not the perfect solution but thats a good shout
declaration: package: org.bukkit.event.entity, class: EntityExplodeEvent
if entity is tnt then #blockList()
and do what u got to do
or this, imo this would be better
declaration: package: org.bukkit.event.block, class: BlockExplodeEvent
check if is glass and then cancel event ezpz
I was trying hotswap-agent with paper in Java 17, but it doesn't work.. (hotswap's errors on start)
The same configuration with spigot server works perfectly. Any ideas?
@minor summit do you have any idea about this?
I've tried to put MiniMessage#deserialize inside a try / catch and it still doesn't throw a ParseException
do I need to modify something on the MM instance?
wouldnt you be better off just remaking the item's lore every time instead of modifying the existing lore?
means you wouldnt have duplicate enchantment lore if you do it properly
I’m open to suggestions but what I’m currently doing is working
Are you using actual enchantment wrappers or just a string in lore
Because you could just check if the item has the enchant lol
I think they're making their own enchants
does anyone know where I can get the snapshot versions (latest build) of ProtocolLib for my spigot plugin (some sort of repo manager)? Is there no way other than to download it myself and shade it?
i need support for 1.20.1 but 5.0.0 doesn't have it
wdym? i'm making this plugin for a 1.20.1 server
are there really none? not even unofficial?
Don't shade protocol lib
Relevant code: https://paste.helpch.at/evilezixun.java
Issue: during the onRightClick event, it is being registered twice, leading players to receive the same error message twice in game. Is there a reason for this?
so sorry for the frequent help recently! This plugin is just a headache
hi
idk i never used minimessage lol
Can anyone help me with custom texture packs issue for non optifine.
I made a texture pack with custom items depends on name it have custom elytras custom swords but it only works on optifine when u play non optifine you cant see custom items textures how can i fix it?
Anyone got experience with custom domains?
like i'm trying to setup a custom ip for my minecraft server but i can't seem to get it to work. it just says unknown host whenever i try to connect using it
google domains
i've tried using SRV and cname
alright
and if anyone know the solution can help me
lifesaver, that video worked thank you so much!
You're welcome I'm glad it helped you
i have no experience with custom texture packs so sorry i;m unable to help you with your issue
np
Wdymmmmm
BigMessage
For example I want to delete blocks 2 seconds after they are placed. I should create a new task when any block is placed. Does it cause lag?
I mean does creating a lot of tasks cause lag?
depends
How to kill an
ENDER_CRSYTAL ENTITY?
and also iit is a living entity or not?
or can i force it to explode
anyway
not familiar with the new API
what
this.plugin.getServer().getPluginManager().registerEvents(this, (Plugin)this.plugin);
}
@EventHandler
public void event(PlayerInteractEvent event){
if (event.getAction().isLeftClick()){
System.out.println(1);
RayTraceResult rayTraceResult = event.getPlayer().getWorld().rayTrace(event.getPlayer().getEyeLocation().add(event.getPlayer().getLocation().getDirection()),
event.getPlayer().getEyeLocation().getDirection(),
7.0,
FluidCollisionMode.NEVER,
false,
1.0,
entity -> !entity.getUniqueId().equals(event.getPlayer().getUniqueId()));
if (rayTraceResult.getHitEntity().getType() == EntityType.ENDER_CRYSTAL){
System.out.println(2);
rayTraceResult.getHitEntity().setFireTicks(20);
}
}
}
i tried to that
but it seems
completly ignore the event
when player has weakness
what exactly are you trying to do?
cause an Entity to die on interact
an End_Crystal entity how ever im not familier with it
i tried to cast to LivingEntity
also EntityDamageEntityEvent does not work
when player has weakness
public eventclass(rarndomshit plugin){
this.plugin = plugin;
this.plugin.getServer().getPluginManager().registerEvents(this, (Plugin)this.plugin);
}
@EventHandler
public void event(PlayerInteractEvent event){
System.out.println("EVENT WAS EXECUTED");
if(event.getAction() == Action.PHYSICAL || event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK){
System.out.println("EVENT STEP 1");
RayTraceResult rayTraceResult = event.getPlayer().getWorld().rayTrace(event.getPlayer().getEyeLocation().add(event.getPlayer().getLocation().getDirection()),
event.getPlayer().getEyeLocation().getDirection(),
7.0,
FluidCollisionMode.NEVER,
false,
1.0,
entity -> !entity.getUniqueId().equals(event.getPlayer().getUniqueId()));
if (rayTraceResult.getHitEntity().getType() == EntityType.ENDER_CRYSTAL){
System.out.println("EVENT STEP 2");
rayTraceResult.getHitEntity().setFireTicks(20);
}
}
}
maybe ill just summon a projectile above it
or at its location instead of setting it on fire
or NMS lol
wait so when interacting with an ender crystal, they die?
the ender crystal onDie creates explosion
i just need to make the ender crystal to die
when interact / hit
that already happens....
if player has weakness false.
when you hit an ender crystal it explodes
unless you have it protected with WG or smt
yeah but not with weakness event and 0.5 damage default hand/item without damage attrriibute
so basically if damage u do is 1 / 20 and u have weakness 1 == 0
and it doesnt even execute the EntityHitEntity event
if it still does damage, you could listen to the EntityDamageByEntityEvent event, check if it's an ender crystal and boom
so i stick to interact
you either make it explode or modify the final damage
it doesnt execute the event at all its why i moved to interact
if player has weakness and u hit with hand
it ignores it
completely idk why
if u hit without weakness or weakness and something that does more then 0.5 it works
@EventHandler
public void onCrystalExplode(EntityDamageByEntityEvent e) {
if (e.getDamager() instanceof Player) {
if (e.getEntityType() == EntityType.ENDER_CRYSTAL) {
Player player = (Player) e.getDamager();
listOfDamagers.put(e.getEntity().getUniqueId(), player);
Bukkit.getScheduler().runTaskLaterAsynchronously(plugin,() -> {
listOfDamagers.remove(e.getEntity().getUniqueId());
}, 10);
}
}
}
legit what I used
works perfectly
dont make me write the entirety of the code just to prove you wrong, that it does work
well ignore the rest but it detects perfectly
Mr Afonso did it work for u with weakness
no but still, you can modify the final damage....
m0dii u dont have too also its just 7 lines and constractur
i did it already it didnt work at all... idfk
i did not the same as u did
i just set the damage to random nubmerr
wth
like 123
or somethng
EntityDamageEntittyevent
if u have weakness and u hit with hand
it dont execute even
well when there weakness it does not work so i ended up doing Raytrace
frrom just Interact
i have no idea i never dealed with 1.20.1 befoe
but i was stuck for 1 hour with that
to allow people blowup endercrystal even if they have weakness
effect applied to them
because if u have weakness and u use hand or any other item that by default does 0.5
its ignored
hmhmm
i also dont know the logic behind it
unless listOfDamagers is a concurrent collection there's a good chance that will blow up
define blow up, and yes it is
🐡
@wary dust Are you still looking? I have some code that does what you want. (Its kinda ugly though lol)
👍 didn't see that... https://i.imgur.com/xArByN3.mp4
yes, i have it as softdepend
Omg how??
^
Relevant code: https://paste.helpch.at/evilezixun.java
Issue: during the onRightClick event, it is being registered twice, leading players to receive the same error message twice in game. Is there a reason for this?
so sorry for the frequent help recently! This plugin is just a headache
Anyone got any experience with tebex?
Ah okay, I'm just trying to setup a theme / template I got off someone and it won't work properly so was just tryna get some help to get it to work
help???
I added deluxemenu as softdepend (deosn't work) and i tried using loadbefore (still doesn't work), i restarted the server but still doesn't work :/
You need softdepend and not loadbefore
It still doesn't work
So it might be some other issue
yo guys as always i like to hit off topic questons here in the must active chat
Oral exam , is it an english exam?
Has anyone encountered problems with hotswap-agent and paper? Because I tried same configuration with spigot and it works, but with paper console spams errors
context?
Then you cant tell if it is english or polish. E.g. if the context was a final exam, like we have in Romania when you finish HS, we have a written and oral exam in Romanian.
Hello, I have this error when I try to start my server:
Hello
it tells you why
None of my plugins have the same plugin.yml
java.lang.IllegalArgumentException: Plugin already initialized!
ik
make sure you dont do any new Main() in your code
can you show the main class of the 'vg.jar'?
my only solution is to change the package of my plugin, but i'll have to change it in all of my plugins that use the package
I have none, I always use this or a constructor
it's really long
wait
.
already sounds like a disaster waiting to happen
don't tell me all of your logic is in the main class
what logic
why is it 'really long' then
👀
yes, i use the getrank, prefix color etc
in the same class
can y'all help me please?
well your issue is likely bad initialization or duplicate jars
probably the latter
what are you talking about
i said i don't use new Main
i never used that
and i will never
.
duplicate jars
how do I solve that please?
well, delete one
?
there is no duplicate jars
Well then you create your main twice
here is my build.gradle:
plugins {
id 'java'
}
group 'fr.idaamo'
version '1.0-SNAPSHOT'
compileJava.getOptions().setEncoding("UTF-8")
repositories {
maven {
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
content {
includeGroup 'org.bukkit'
includeGroup 'org.spigotmc'
}
}
mavenLocal()
}
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT' // The full Spigot server with no shadowing. Requires mavenLocal.
}
do you have more than one subclass of JavaPlugin?
nope
Restart your server idk
I changed the name of my package and the problem was gone, but if i do that, i will have to do that with the other plugins
Main
then dont
okay
change it to something else
if you have multiple jars, that have the same package and the same name Main, then there will be a conflict, which is most likely your issue
thank you, the problem is solved
okay thank you bro
👍
you usually want to name the main class accordingly what the plugin does in general, as a rule of thumb (for me at least)
Shouldn't be the same package either way