#help-development
1 messages · Page 2178 of 1
me neither, just guessing
guess thats not the cause of the issue
I restarted and i still get this error. the plugin works but I get this error
?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.
- any code?
I sent the error
public void SpawnMob(RaidSpawnWaveEvent event){
System.out.println(event.getRaid().getBadOmenLevel());
if (event.getRaid().getBadOmenLevel() >= 5){
Illusioner mob = (Illusioner) event.getWorld().spawnEntity(event.getRaid().getLocation(), EntityType.ILLUSIONER);
event.getRaid().getRaiders().add(mob);
}
}```
this is the code
?paste
bet getRaiders is unmodifiable
Anyone knows why .setInvulnerable(true) is not doing anything for me?
what is line 17
event.getRaid().getRaiders().add(mob);
youre in creative while hitting the mob?
^^
what does that mean
u cannot add things to the collection if its read only
ah yes I was
that you can't modify the list and if you try it will throw that exception
🙂
only working when not in creative I guess
well youre in creative, nothing except you should be invincible
it worked, tysm
I have to prevent a player from dying or getting damage, best way to do it?
cancel the event
like he shouldn't even be able to get damage from people in creative
ok so is there another way to make the Illusioner be a part of the raid or there isn't?
cancel damage event involving that player
hm okay
it just returns the raiders that are left but how do I add the Illusioner to it
does it return the actual list of raiders or a copy?
it says a list of current raiders
if its a copy then yeah adding wont work
You could get the location of the patrol leader with the RaidSpawnWaveEvent and just spawn it manually. Maybe set the patrol block the same as the patrol leader and set can join raid to true
If someone would know what are these commands doing ping me, thanks
Its custom world generator
The manual spawning?
Hey I got a quick question, does OfflinePlayer#getLastPlayed return the last time they joined the server, including if they are currently on the server?
Example:
Player is online returns same session
- or -
Player is online returns the join time of last session
I'm not sure if that makes sense but if someone knows that would be very helpful 😄
it’s the last time they logged in
Returns:
Date of last log-in for this player, or 0
The docs sais
Gets the last date and time that this player was witnessed on this server.
If the player has never played before, this will return 0
I would think it's the join time and when the player is online it's still the join time
You could test if the player is online with a second check. Use isOnline for that
Darn I ran a test where I deleted my PlayerData from the world and I got that its the last session (IE: not the current session)
Okay was unsure about that but great to hear👍
Gotta find a new way to save the players login, since I dont want their login time to be linked with 1 world anyways :/
Use a MySQL database and the JoinEvent. Just save the current time and uuid of the player in it
I thought it would cause problems because I can't force it to join the raid but it joins every time
is there anything I have to watch out for when making a Dependency and uploading it to spigot? this dependency is supposed to make it possible to add custom mobs without nms, anyone have tips?
is there any plugin where if you break a block it automatically place it back just like hypixel?
i need it for my server for the spawn.
I would only suggestion to not use too many third party dependencies (that are not included in the spigot pom) to reduce file size
Use the spawn protection in the server.properties
only dependency other than spigot is reflections, so that should be fine
thanks 🙂
How do I apply this a potion effect?
ItemStack item = new ItemStack(Material.TIPPED_ARROW);
Reflection is not even a dependency. It's built in java. Or do you use a other library for it?
Try casting the itemmeta to a PotionMeta (but not 100% sure if it will work)
maybe theres TippedArrowMeta
Oh okay. But if it's reflections. Does it work with Java 17 and higher? Reflections were dramatically changed there
Does not exist
I use java 16, not sure if it works on 17
avoid reflections where you can
like this? PotionMeta meta = (PotionMeta) item.getItemMeta(); meta.setBasePotionData(new PotionData(PotionType.INVISIBILITY, false, false));
its onEnable
it should work on all java versions. It's the Spigot versions that are annoying to work with with reflections
it gets called once
this is just overengeneering
Do you only use public methods? Things like getDeclaredClass doesn't work anymore if it's private or protected
💀
but first re-set it to the item
I only have public classes, not sure if thats what you meant. but the code I sent gets all classes which implement Listener in the package which is specified by path and register it to the pluginmanager
You need to set the itemmeta with ItemStack#setItemMeta at the end
I mean when you Access private classes with reflections in Java 17 it will result in a error
oh ok that makes sense... good thing I dont have those 🙂
is says Potion Type is not upgradable
is there an event that gets triggered when a novice villager changes its trades by its own?
How is this null?
Objects.requireNonNull(Bukkit.getStructureManager().getStructure(NamespacedKey.minecraft("map" + random.nextInt(1))))
.place(Util.getStructureSpawnLoc(), false, StructureRotation.NONE, Mirror.NONE, 0, 1, random);
is says Potion Type is not upgradable
When I do this:
meta.setBasePotionData(new PotionData(PotionType.INVISIBILITY, false, false));```
Try: addCustomEffect https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/inventory/meta/PotionMeta.html#addCustomEffect(org.bukkit.potion.PotionEffect,boolean)
declaration: package: org.bukkit.inventory.meta, interface: PotionMeta
You think it’s too confusing?
https://i.imgur.com/rUSCrKZ.png
some names are misleading/could be better
https://hub.spigotmc.org/jira/browse/SPIGOT-7009 reward for whoever fixes this bug
is that a "idk how to" or a "i cba to look"
more like a "how tuff is the spigot community"
I'm prety sure this happened to me too recently, I was stuck in the loading terrain screen and the only fix was to remove the player data from the world folder
your fault lul
Hi.
Im having an issue with my scoreboard. When a player joins it updates itself as it is in code. But when quit it doesnt. Any help?
@EventHandler
public void Restedlawsyztskichwychodzacych(PlayerQuitEvent e) {
for (Player p : Bukkit.getServer().getOnlinePlayers()) {
ScoreboardManager manager = Bukkit.getScoreboardManager();
Scoreboard board = manager.getNewScoreboard();
Objective obj = board.registerNewObjective("SUBOWICE", "dummy", "-=§e§lEKIPASMP§r=-");
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
Score score10 = obj.getScore(" ");
score10.setScore(6);
Score score = obj.getScore("Zabójstwa: §e" + yamlFile.get(p.getName() + ".zabojstwa"));
score.setScore(4);
Score score2 = obj.getScore("Śmierci: §e" + yamlFile.get(p.getName() + ".smierci"));
score2.setScore(5);
Score score3 = obj.getScore(" ");
score3.setScore(3);
Score score1 = obj.getScore("Portfel: §e" + yamlFile.get(p.getName() + ".portfel"));
score1.setScore(2);
Score score69 = obj.getScore("Gracze Online: §a" + Bukkit.getServer().getOnlinePlayers().toArray().length);
score69.setScore(2);
Score score101 = obj.getScore(" ");
score101.setScore(1);
Score score71 = obj.getScore(" §e§lekipasmp.pl ");
score71.setScore(0);
p.setScoreboard(board);
}
}
Hey I get this error package com.earth2me.essentials does not exist when I try to package Maven
that method name gives me a headache
idk how scoreboards work, but i'm 99% sure that setting 2 scores on 2 isn't right
Score score1 = obj.getScore("Portfel: §e" + yamlFile.get(p.getName() + ".portfel"));
score1.setScore(2);
Score score69 = obj.getScore("Gracze Online: §a" + Bukkit.getServer().getOnlinePlayers().toArray().length);
score69.setScore(2);
still same error
what are you trying to do
get a tripped arrow
this is what I have now ItemStack item = new ItemStack(Material.TIPPED_ARROW); PotionMeta meta = (PotionMeta) item.getItemMeta(); PotionEffect effect = new PotionEffect(PotionEffectType.INVISIBILITY, 10, 1); meta.addCustomEffect(effect, true); item.setAmount(random.nextInt(1, 3)); item.setItemMeta(meta);
this is the error Potion Type is not upgradable
use /effect give yourname invisibility 10 1 and see yourself ingame
kinda weird if you ask me, but thats how things work
this gives me the arrow of invisibility with 22 seconds duration. how do I set it to 1 minute?
PotionEffect effect = new PotionEffect(PotionEffectType.INVISIBILITY, 10, 0);
new PotionEffectType(<effect>, <duration>, <modifier>)
10 duration obv means 10 seconds lol
I set it to 60 and it gave me an uncraftable arrow
I set it to 10 and it gave me 22 seconds
try 27 then lmao
would result in 60 seconds
but 27 ticks isnt even 2 seconds
tf?
well you put 10 and got 22 seconds
according to that formula 27 would be 60 seconds
idk too, ask him
PotionMeta meta = (PotionMeta) item.getItemMeta();
PotionEffect effect = new PotionEffect(PotionEffectType.INVISIBILITY, 10, 0);
meta.addCustomEffect(effect, true);```
it makes the duration 22
Hello team, hope you are all good, I've one question, In my PlayerInteractEvent, i would like to do this : when a player click 20 times on my block, the block break, how can I do ? with a for(int i) ? Anybody as an example ? Thanks for reading
you need to save the amount of clicks somewhere
every event that starts doesn't remember the one before
and then check in PlayerInteractEvent if it's 20 and if so then break the block and reset the clicks
Nice, thank you for your help !
No problem
anyone knows why it gives it in 22 seconds duration?
You would also need a player quit event to remove the player from the list when he leaves
WeakHashMap does that for you
What happens if you use 1 instead of 10?
its supposed to be in seconds tho
so why is 10 seconds 22?
iirc potion effect duration is weird in spigot
Actually nerver heard of it. Is it a Java Feature or a spigot one?
Java silly 😁
no idea
Can you try 27 and see if it's like 1 minute then?
k
I'm curious now lel
org.bukkit.plugin.InvalidPluginException: Cannot find main class `bangui.me.duke.Me.Duke'
Mhh I will need to look into it
how can i change my main class location lokl
weak just means that if it can’t access the player variable it removes it
Main in the plugin.yml
whats a weakhashmap again?
lol tysm
No PrObLeM
So you put a player as the key in it? Always used a uuid for it
Yeah he was first xD
better if you store the uuid itself i'd say
its uncraftable tipped arrow of invisibility
dw haha we're all here to help or to get helped :d
that's weird
uuid is better if you aren’t dependent on them logging
most likely because it's a not used value in the game? idk
I it returned to giving me this Potion Type is not upgradable
if you want to use uuid you need the join and leave events
Oh right. The uuid should be inaccessible too if the player leaves
Okay? xD 👍
storing the whole player object as the key is kinda... useless
^
it’s very smart
Never done that and never will
waste ram 😎
I don't like the idea of a player integer map xD
or play cod. result is the same
does anyone know why it returns an uncraftable arrow?
PotionMeta meta = (PotionMeta) item.getItemMeta();
PotionEffect effect = new PotionEffect(PotionEffectType.INVISIBILITY, 27, 0);
meta.addCustomEffect(effect, true);```
oh wait
But tell me how java removes it from the map? Called when get is triggered or async?
Try getting the highest acceptable value, 10 worked, so maybe try 11 or more now
whenever it try’s to get data but it doesn’t exist
since when
ill try to make 22 in ticks
RIGHT?!?
What is the zero for again?
amplifier
Oh okay 👍
PotionEffect effect = new PotionEffect(PotionEffectType.INVISIBILITY, 60 * 20, 0); // equals 1 minute
if youre lazy
Right about cod?
and as bad as me in math
right about the ticks thing
since when is effect duration measured in ticks
Ohh Okay xD
No idea
thats why i slowly start to quit mc lmfao
nooo
Minecraft ≠ Spigot. Change my mind xD
fuck you
xd
just make a tick utils function
and this Potion potion = new Potion(PotionType.STRENGTH); potion.setHasExtendedDuration(false); ItemStack item = potion.toItemStack(1);
return this in the console Potion Type is not upgradable
god, why is sound equalization such a weird thing
wdym?
Because the algorithm is bad? Idk xD
MY HEADSET IS FUCKED UP
which one you got?
because i fucked up the equalization
reset it
logitech g pro x
was perfect before i started playing with the equalizer
how tf
idk, software?
Then don't xD
their software is dogshit
I only use headphones not Headsets
well I have a roccat keyboard and it's kinda annoying
i love it
which one do you have?
ah I got the skeltr
Nahh! No name for the win😂 Nah just joking. Razer best xD
what?
Roccat skeltr
nah it's not new
I used it twice. 1 with 440 duration and 1 with 1200.
one of these gave me an uncraftable arrow of invisibility with duration of 2 seconds
like 2 yrs old or smth
is comfy af tho
why is this so weird
🤨
best decision I made tho was switching to a wireless mouse
agree
which one for you
razer viper ultimate
fully charged it runs for like a week
I just put it on the charging dock when I'm afk and easy to go
i just love the deathadder like since i was born, so it was obv which one i should get
I am quite happy with my razer stuff
when the deathadder v2 got a wireless variant, i had to get it honestly
I had a roccat mouse
Same 👍
i have 3 roccat mice lmfao
and the fcking scrolling wheel got fucked up after like 6 weeks
and 2 keyboards
kinda annoying when gaming or coding
lemme guess
its that weird one that i also have
dunno the name
looks like an egg
i LOVE this sidebutton
but mine had a problem
I don't wanna buy it every 6 weeks
which made it make random doubleclicks
yeah i heard of that
i really loved the mouse cause it fit perfectly for my hand
exactly
but the annoying scroll wheel bug just fucked it up
the viper ultimate is kinda small for my hand
120 i suppose? idk
they have weird namings for their shit
true
That's so nice
charges in like 2-3 hours
my desk is fucked up anyway
@iron glade @slate mortar Shouldn't you switch channels to #general ? This doesn't seem like development help anymore xD
you dont get this discord
THIS is general
yk
^
it always has been
Noticed it a while ago but still xD
#general is kinda weird
You need someone to remind you of it to change it xD
no one wants to go in there
Why that?
heh
guys?
Looks like memes with some general chat stuff
yes?
that is still an uncraftable arrow
PotionMeta meta = (PotionMeta) item.getItemMeta();
PotionEffect effect = new PotionEffect(PotionEffectType.INVISIBILITY, 440, 0);
meta.addCustomEffect(effect, true);```
in that case
But look @slate mortar. Our poor @harsh totem needs help and when you talk about roccat and stuff he can't post his request for help. 😢 xD
what is even a tipped arrow?
/**
* Creates a potion effect. Assumes that particles are visible
*
* @param type effect type
* @param duration measured in ticks, see {@link
* PotionEffect#getDuration()}
* @param amplifier the amplifier, see {@link PotionEffect#getAmplifier()}
* @param ambient the ambient status, see {@link PotionEffect#isAmbient()}
*/
public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient) {
this(type, duration, amplifier, ambient, true);
}```
i help people as well :)
im not poor🥲
Arror with potion effect when it hits a entity
*rich
I am not sure about that xD
😃
from now on i only report bugs i already have a fix for
do you?
lol toxic
hey hey calm down
hehe
chillax
Am sorry. English is not my main language. You person in need of help? xD
Yes I did 😎
mine isnt either lol
we 3 are german, let's face it
4*
this is our discord now
im jewish 💀
we 3 are idiots in that case
Deutsch ist halt auch einfach geiler XD
keep the chat in english
well, tbh I'm 3/4 italian and like 1/4 german or smth
got him
Dieser Discord ist nun Eigentum der Bundesrepublik Deutschland xD
honestly no idea
minesucht.net fanboy
Sry :c
I'm out of ideas my man
whats that?
lmfao
maybe i'll make my plugin output to the console what I hold and then i'll hold the arrow that I want to get
A crappy pay to win server with just plotworld and empty Minigames i think
Never heard of it
Can't remember it anymore xD
german server?
yes
I should join and tell them I am an operator
.de tells you everything xD
like GommeHD? LMFAO XD
ye
I remember when the server was so fcking full that you got kicked like every 2nd time
Oh the server closed!? @hybrid spoke
still, whats the case
yes
just like the rewi-server
I too. Bought premium then xD
minecraft germany dies
Yes and the small server can't even help it either
But who cares about that anyway if you have Hypixel and private SMPs xD
which i cant relate
what is long_invisibilty tf?
[11:53:00] [Server thread/INFO]: ItemStack{TIPPED_ARROW x 1, POTION_META:{meta-type=POTION, potion-type=minecraft:long_invisibility}}```
Dont like it. I only really like Vanilla SMP and some Murder Mistery nowadays
Maybe because the effect it so long in duration? Thats confusing as hell
the first one is 22 seconds and the last is 1 minute
these are vanila items
i dropped minecraft. there is nothing interesting anymore
so the second one is the extended one
á long
I would like to play in an smp but every smp I join is full with dumb 8 year old
yes but there is no such thing in the code. there is no potion type like this
SMPs can be fun for the first 2 weeks
Thats why I am programming my own and hosting it for a germany YouTuber and streamer. Season 1 was really cool
I was once in a good smp and it was realy fun until someone griefed it and everyone quit
but its clear what it represents
They didn't have a rollback plugin?
no
Yikes
I was in a good one and slowly the server died out and no one really played anymore
it was for friends and someone manipulated the admin to give him op for a sec and then he whitlisted the griefer and the griefer joins the day later
in 3 am
he joined in 3am just to ruin the server
Servers that use op are yikes
why even is there an admin on a SMP?
there was no need for ranks
he is the hoster
fuck the hoster
🤨
And who will pay then? Or is this his payment??
I'm sorry, no. OP is like the root user on Linux. You use root to make a user account and that's about it.
its his server but still he has no rights to have perms on a SMP
thats an unwritten rule
Ahh I know this type of hoster
So does anyone know how to get tipped arrow?
sorry for asking so many times but I tried to search in google and haven't found something that works
dont you already have that
This is what the server outprinted to the console when I held the tipped arrow because I wanted to know what the meta should be
and it didn't help
there is no such potion type
I just made it outprint what I hold
long_ means the extended version of the potion type
yes but there is no such type
I want to get a tipped arrow of invisibility.
1 with duration of 22 seconds and 1 with a duration of 1 minute
dont you therefor have the PotionData?
does somebody know how can I stop this task from running:
task1 = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
I cant stop it
cuz the variable is an int
Scheduler#cancelTask
Hey, guys, give please advice. What is the best way to implement such a scale so that the colors change sequentially. Red - reduction of the scale, yellow - the normal state of the scale, green increase the scale. The scale depends on the value of the variable. I think it can be implemented with if , if else and server threads. Are there other options?
https://www.veed.io/view/db05a626-5479-40db-a93d-c7431f50313a?sharingWidget=true
ok
Many you know?
explain it again for people who don't know what you're doing
how do I set the potionData to extended
look up the boolean values
I want to create a stamina scale. This scale will change with a certain action. It depends on the variable.
there is no function to set anything in PotionData. there is only get functions
first constructor
cool
Is there a way to add like a building with a command without having to manually set every single block?
is there a way to do this not via if, if else and server threads?
meta.getBasePotionData();?
oh
public class FakePlayer implements Player {
Bukkit.getOnlinePlayers().add(this);
why...?
is there a way to do this not via if, if else and server threads?
is intelli high?
show us what you tried
no thats normal
Never happened before tho
that would be too easy
How would I check if another specific plugin is installed?
Bukkit.getPluginManager().getPlugin("name") != null
ty
You also have an idea for that?
schematics
but schematics also are technically block by block
That's what I just looked into, would I need to use the worldedit api?
that would be the easiest
What's that?
Also you can't add to this list
do you ppl know how can I check if players boots equipment in null
player -> inventory -> equipment -> boots == null
Is this correct:
if (p.getEquipment().getBoots() == null)
I would use player.getInventory().getBoots()
oh ok
Hello there, is there a 2ay to change a packet message like"failed to log an authentication server... "?
Sry misread xD
You are evil
Why do you want to do this?
Its not possible change? Kay i am sad for now
you underestimate me
Change the language file. I think you can do this via a texture pack
Do I?
totally
Explain yourself xD
Because we have a fast login and player didnt know what does it mean, if they miss clicked
Kay, i will look at it, we have a reaource pack that player Must have
Okay so this is a Plugin Message?
Never used fast login so I don't really know what it does or how it works
The question is. Will it be loaded before the kick?
No its default minecraft kick handling if they dont have a premium minecraft
Oh, no 😁 then it dosesnt work
Protocol Lib maybe?
The question is what causes this message? Is it from a Plugin?
if it cant reach the authentication servers, how would it work with ProtocolLib?
If it is the auth severs you can't do anything because its all on Clientside and you can't change anything then
I can't find the world edit maven dependency, anyone?
Noo, its default message by minecraft
worldedit has its own wikipedia entry? https://en.wikipedia.org/wiki/WorldEdit
how do I check if a pillager is a captain?
Also this: https://www.spigotmc.org/wiki/setting-up-the-worldedit-api/ (but check what the latest version is. Maybe it's outdated)
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Maybe Raider. isPatrolLeader()
paw patrol
Or the same raid spawn event and then
getPatrolLeader()
Your favorite show? xD
To find the latest versionty
do you have smth against it?
i will cancel you on twitter
Wdym? You could always look at their repo in your browser and look for yourself
Oh god pls no. Anything but that😭
It's not in a raid. I meant in general like the ones in pillager ouposts
does someone have any example for when an EntityChangeBlockEvent is called BESIDES from a player stepping on redstone ore (setting "lit" to true)?
Then the first one
K thx
enderman?
silverfish?
or do you mean only player related?
isn't there a more specific event for enderman?
Does anyone know how to hook into the world edit api?
i dont think so
oki perfect, then I'll use endermen as example thx
https://worldedit.enginehub.org/en/latest/api/index.html just look up the wiki
I'm on that site but can't find an example how to hook into it
As a man of ASCII loving, whenever I try to send any art to console it comes out as ???
does anyone know of ascii art generators composed of just _ and | ?
or how to print to console better 😉
console is just meant to show logging output, not fancy stuff
I used this code
it returns false when I kill a captain
if (p.isPatrolLeader()){```
maybe it's because it was summoned by me?
but cool 🆒
Could be. Just a question. How have you spawned your pillager?
./summon pillager
Oh xD
does it need to spawn naturally?
I think so
My question is. What type of caption do you want? The specific game set caption or one of them with a flag?
the second one
?paste
@sand frost can I just check if he wears anything in his helmet slot?
I am unsure if he has this thing as a helmet but its worth a shot
then what slot is the banner in?
Helmet seems reasonable but I don't know if he has this thing in any of his slots
heyyy, does any1 know of an tutorial on how to code scoreboard with changeable in config?
Which scoreboard plugin are you using ?
No i wanna make one.
like code
Ah
Why else would i type in this channel.
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
letters
sentences
maybe words
oh misread
smart
Anyone know a reason why FileConfiguration#set with a Location object just saves the Location String instead of splitting it into the ConfigurationSerializable keys?
Hello ! Hope you are all good, I've one question, I would like to spawn an item (i create the itemstack) when i right click on my clock (the item spawn at the location of the block) how could i do that ?
Can you show what it looks like when u save it?
The block u right click?
way of checking if an item is a food?
Get the block u interacted with and if u wanna spawn it on the too of that block, get the block above it and add 0.5 to the x and z and soawn at that location
test: Location{world=CraftWorld{name=world},x=1.0,y=2.0,z=3.0,pitch=0.0,yaw=0.0}
Getcreativecategory
See if it's food
thanks you
Are you saving Location.toString?
No
Can i see your code?
how are you setting it?
What is defaultvalue
A Location object
Why don't u use config.set?
I have this method but I think the name is misleading. My CustomBlockData thing implements PersistentDataContainer for blocks. But I'm now adding stuff like "automatically remove the custom blockdata when the block is broken", etc. I have chosen to add an option to prevent this, but "persistent" is probably the wrong word. Maybe I should call it "protected"? Any suggestions?
/**
* Gets whether this CustomBlockData is persistent. Persistent CustomBlockData will not be changed by any Bukkit Events
* @see #registerListener(Plugin)
*/
public boolean isPersistent() {
return has(PERSISTENCE_KEY, DataType.BOOLEAN);
}
Because the section doesn't exit before
It doesn't need to
Hello, let's see if anyone can help me. I play with spigot, and I don't know if it's because of that but mobs with nametags or caught objects shouldn't count for the mobcap, but they do, since when they reach 70 they stop spawning. Does anyone know why this happens, or if it has to do with spigot?
Can you show your entire method
I expected that since addDefault() calls set()
?paste
are you just calling set and saving now?
Yeah
Only the config.set part is called
So parser is null
exactly
dunno wtf that code is doing
Only the config.set part is important
Maybe if it get object it just calls tostring
Nope, same thing
what api version?
how do I check if a pillager has a banner?
i was trying to use custom skull
get its inventory
declaration: package: org.bukkit.entity, interface: Raider
i switched from spigot-api to spigot after getting fresh jar from build tools
Oh u just wanna see if it has banner
not raider
or that, idk how banners are set
a normal pillager
still it dosent seems working
pillager extends illager extends raider
raider just means that it is part of a raid's mob set
how can i get the player who put the item on prepareanvilevent
get the inventory's viewers
event.getViewers.get(0)
p.getInventory().contains(Material.WHITE_BANNER)
I got this in an if statament and it returns false when the pillager has banner
the banner is white because this is the banner that the pillagers have
pillager.getInventory.getHead != null
Cannot resolve method 'getHead' in 'Inventory'
i guess its inv.getItem(slot)
what slot is the head
it is texting the message for 10 times
wait isnt it getEquipment?
oh yes
yep
I forgot
Nobody does, in any circumstance
?bing
Bing your question before asking it:
https://www.bing.com/
I did ;-;
still false if (p.getEquipment().getHelmet() != null)
Internet explorer
💀
make sure to check if its not air either
yes but it returns false when it wears banner
How to perform some action during the time the player crouched? If you run the PlayerToggleSneakEvent event, then the event will be executed only once
shouldnt it execute whenever a player sneaks?
sneak -> fires event -> start scheduler -> unsneak -> fires event -> end scheduler
im trying to get my plugin to register jda but the build() portion as an error
lmao man
hover over it
and see what it says
well then do something to make that error go away
it is still false even when the pillager has banner
I dont think the correction is right
well either way I don't think what I have done with jda works
noone can help you if you don't show us the error message
if you just say "i have an error", all I can say is "then fix this error"
hes just not catching the login exceptions
theres no error, but it's just unfunctional
i think he blocked you @tardy delta
who?
lollll
Technically it can
Juet create an object that holds everything u wanna return
meh tuples when
that’s to OP LOL
pillager.getEquipment().getItem(0); should return the helmet slot, right?
why not getHelmet()?
I tried that
I checked if the helmet is not null and it returned false when the pillager wore a a banner
i mean there's not even a getItem(int) method
declaration: package: org.bukkit.inventory, interface: EntityEquipment
what is the reason getHelmet isn’t working?
dont think 0 is a EquipmentSlot constant
declaration: package: org.bukkit.entity, interface: Raider
isPatrolLeader()
would that work?
?paste
?
what
Do I add a schematic file to the plugin's resources and copy it into a new directory in the onEnable() or how do I like add it?
add it to what
the plugins folder
yea
I dont know how to do it i havent touched schematics but my best guess is that you make a folder for it in your plugin folder then try to get the file and load it via that.
then why the dumb reaction?
you manually put the schematic into your plugin folder
bc you werent providing help
you were giving useless comments
I want that the plugin comes with the schematic
he asked a yes or no question
Oh then try loading it frmo resources folder
like when someone installs it it extracts the schematic into the plugins folder
he did not
Yep that was my guess too
He asked, and i quote: "Do I add a schematic file to the plugin's resources and copy it into a new directory in the onEnable()..."
which is literally what you just repeated
chill
this should be true when the pillager has banner but it's false
(p.getEquipment().getHelmet().getType() != Material.AIR)
ok let's chill
| Do I add a schematic file to the plugin's resources and copy it into a new directory in the onEnable() or how do I like add it?
its open ended my friend
Is there any event that will run all the time, regardless of other events?
use a bukkit runnable every tick?
he asked if it was correct?
which i responded to with yes
where is your problem
The question is why would you want to run an event every tick 
yeah.. 😅
declaration: package: org.bukkit.entity, interface: Raider
Thanks
No. the pillager is not a raider
it is when it's summond in a raid
oh
you could make an if statement specifically for if it has a banner equipped
and do what you need to do
which is what I sent
could you log the helmet type?
coughs
The helmet is air when i wears banner
tf?
then try
the helmet is a banner no?
isPatrolLeader
hmm logic, when my battery is 10% my screen becomes brighter
big brain
that’s what i’m thinking
you don't understand the format
wow
bro people are so pretentious holy shit 😭😭
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Raider.html
could you try isPatrolLeader()?
declaration: package: org.bukkit.entity, interface: Raider
It's false when I summon a pillager that has a banner...
isPatrolLeader should work
p.isPatrolLeader()
public BatterySaver implements Listener {
@EventHandler
public void batterDie(PlayerBatterChangeEvent e) {
if (e.getBatteryLife <= 10) {
e.getPhone.setBrigtness(100);
}
}
}```
quality code
could you just send your code?
🧈
I have made a code which allows zombie to tower up when player is at higher position then them but how can i allow zombie to bridge to them also
I know with debugging that the plugin reaches here and stops because it's false
if (p.isPatrolLeader()){
the .schematic format legit has a pallette, where each block state is assigned a numerical ID
public void Limit(EntityDeathEvent event){
if (event.getEntityType() == EntityType.PILLAGER && event.getEntity().getKiller() != null){
Pillager p = (Pillager) event.getEntity();
if (p.isPatrolLeader()){
Player player = event.getEntity().getKiller();
PotionEffect effect = player.getPotionEffect( PotionEffectType.BAD_OMEN );
if (effect != null && effect.getAmplifier() >= 5){
PotionEffect potion = new PotionEffect(PotionEffectType.BAD_OMEN, Integer.MAX_VALUE, effect.getAmplifier() + 1);
player.addPotionEffect(potion);
}
}
}
}```
you just happen to have 21k blocks and they're all with the blockstate associated to 0
i mean early returns are a thing
and you probably want to check if the killer is a player
I do check it
here event.getEntity().getKiller() != null
instanceof Player?
what if the killer is a zombie or something?
that would work too
getKiller() returns only if its a player
nothing else
How would I copy this UFO.schem into plugins/myPlugin/schematics ?
i mean it can be killed by an irongolem aswell
getKiller() returns only if the killer is a player
Otherwise it returns null
I told you that everything works fine until the check of the banner
aight can't help you with this then
😢
How can I spawn a lightning but I don't want it to set block on fire.
How to track that the player drank a bottle of water?
declaration: package: org.bukkit.event.player, class: PlayerItemConsumeEvent
world#strikeLightningEffect
This just gives the effect of lightning, but with no damage
I know this, I need to understand that it was exactly a bottle of water?
event.getItem().getType()
I still want the damage
then get the entities in the area and add the damage
or there is an event called BlockIgniteEvent... you could just check for igniteCause ENUM - value LIGHTNING and cancel it.
And you will need to check for location variable too, to prevent canceling fire from regular lightning.
That way I only know that it's a bottle
then get the item in hand
i think it should be called before the item is actually consumed
event.getPlayer().getEquipment().getItemInMainHand().getType()
or something like that
Better to use PlayerItemConsumeEvent#getItem
that gives the item it leaves behind
yep! players could also snack a suspicous stew from their offhand
he has already tried it
at least i think that's what he meant
whut? no
Oh
He want to check If player drink a water bottle
A glass bottle that filled with water
i haven't tried it
water bottle is of type water bottle and not of Glass bottle
they have different types
What should I compare it to, what should I specify in the ItemStack?
I can't find WATER_BOTTLE on the material
Yeah
It's all potion
It is potion
And i want get "water potion"
check if the potion has any potioneffects
cast it to potion and check if it has no effects
if no, it's a water bottle
Get the PotionData and check the https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionType.html
what command permission do I put in the yml to only allow operators to use the command?
any you like
just don't assign it
just check if the sender is console
if no permission is assigned in plugin.yml, then everyone can use it
that makes no sense
they want OPs to use it, not only console
no i meant don't assign the permission to anyone, sorry if i was being unclear
player.isOp()?
How can i get potion effect?
commands:
stackresize:
permission: stackresize.admin
permissions:
stackresize.admin:
description: Allows to use /stackresize
default: op
now only people with "stackresize.admin" OR ops can use it
Get the PotionMeta and then you can get the PotionData from there
sender.isOP?
Oh, thank you
is it possible to do it so only OP's will be able to use it?
player.isOp()?
it'll still show up in the tab menu
You need to play around with the TabCompleter then
players who don't have that permission won't see the command on the tab menu
then add a tabcompleter
yea
he doesn't want permissions, he just wants to check for op
I missed that
cant an op use all command by default?
are there un obtainable permissions?
?
^^
if you really don't want to use permissions
how can i cast a double to a float?
Why it's: java if((PotionType) e.getItem().getType() == PotionType.WATER){ not work?
(float) double?
and this wouldn't break anything?
let's say i have double 1.1D and i want a float it would become 1.1F right?
Not like that
PotionMeta meta = (PotionMeta) item.getItemMeta();
Why can't you do everything in float?
You need to get the ItemMeta of the ItemStack and then cast it to PotionMeta
probably
because i can't get floats from configuration files
Get string parse float?
just look it up on stack overflow if you dont trust me
dont
yeah i trust you
Performance
I assume you only get it once right?
I tried, it didn't give me any error ween I compare double and float
there's not a getFloat method tho
just type it into google "java cast double to float"
Just use getDouble and then cast it to float
yeah man i understood how to do that i'm just answering the other guys
that's what i'm doing indeed
Use this:
Float.valueOf
so who is asking this question now
this uses string, mjanko said it isn't performant
just cast it please
But work
again, yes.
why not just cast it ?
Cast, if it breaks figure something else
Just in case anyone wants to know, that's how I extracted the schematic from the jar to the world edit folder:
public void extractSchematic() {
if(isWorldEditInstalled()) {
if(!ufoSchem.exists()) {
try {
InputStream stream = getResource("UFO.schem");
FileUtils.copyInputStreamToFile(stream, new File(getDataFolder() + "/../WorldEdit/schematics","UFO.schem"));
getLogger().info("Ufo schematic has been extracted successfully!");
} catch (IOException e) {
e.printStackTrace();
}
}
}
else {
getLogger().info("World edit not found, UFO schematic was not extracted!");
}
}```
i think this should work on both
What should I compare it to?
check if it has an effect
after adding worldedit to my pom the output file is 300kb bigger is this normal?
I mean I added it as dependency
could you show me how you added it
make sure you have <provided>
scope needs to be provided
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-core</artifactId>
<version>7.2.10-SNAPSHOT</version>
<scope>provided</scope>
</dependency>```
that's correct
then there should be nothing wrong
maybe it's something else in your pom
damn 300kb
maybe the schematic you added?
^^
I checked and it's raw size is 2kb
Can you write this
open your jar with 7zip or winrar
and see what's taking the extra spce
Ok
if you haven't fixed it when I get home I'ma send it to you, okay?
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>```
that;s it
yea
Do I have to add that provided?
probably not
is it in spigot by default?
someone with github knowlege wanna work on a bungeecord system together?