#help-development
1 messages Β· Page 1836 of 1
how do u make it so that only server ops can run my command?
if not op, run a message
if not op, ban them
then return:
true: nothing appear
false: the message usage will send to the player
is it not a permisison thing
is HikariDatasource#close() the same as HikariDatasource#getConnection().close()?
isnt it a permissions thing in the plugin.yml
if (!p.isOp())
so I have a system where I'm trying to delete a few worlds from the server (they regenerate on start), but they keep saving on stop so the deletion process gets interrupted every time. Whats strange is 1) this only started happening in 1.18.1, and 2) this does not happen on my test server, even in 1.18.1; it's only on the hosted one. I tried setting autosave to 0 in bukkit.yml, i tried disabling autosave through World#setAutoSave, i tried unloading the worlds first and then deleting them, even running /save-off doesn't work. And like I said, I can't reproduce this in my test server, so I have zero clue why it would be different on my hosted server. This is my code for deleting the worlds: https://paste.md-5.net/otawefixev.cpp
you can
how
2 ways
might be more but i know two ways:
check if player have a specific perm, example: if (p.hasPermission("string")) // do some wunky things here
do it in the plugin.yml
are these default server worlds? like overworld?
they are all separate from the defaults
then delete them in your plugin onLoad
that executes before worlds are loaded
alright I'll try that
would i go like htis
permissions:
condense_wand.*:
description: Ops only
default: op
you need to define and assign the child nodes under the .*
some permission plugins do not understand *
Quick question: I am trying to create a method to insert different values into my MySQL database table. This has also worked well so far. However, I have now added another column to the data table that is not to be filled by the method and accordingly can also have the value null. Since this column exists, I now get the following error message when trying to insert values there:
java.sql.SQLException: Field 'chunkid' doesn't have a default value
chunkid is in that case the table column I mean. Does anyone happen to have an idea what I might have done wrong?
like this
permissions:
condense_wand.use:
description: Ops only
default: op
All blocks of minecraft have a BlockState ? or only oriented block, stairs, banner... ?
i'm making my own system of schemtatics and i'm trying to save all data of oriented blocks
maybe i only need to use BlockData ?
how to make a basic command
hey does anyone know where gameprofile is in the new spigot api for 1.18?
thats not in the API
then where is it
thats a mojang class
thx
well, i don't reccomend this but you must depend on the jar
can you listen for plugin disabling? I wanna check if a plugin that is not mine is disabled
i love you so much
How could I store an item specifically as it is? For example, if I try to store the itemMeta of a dye, then it doesn't save the dye color and stuff
Currently, I just store enchatlnts, name, and material
I need something more specific though
iirc itemstacks are serializable
so unless i got your question wrong, you can serialize it
can you always cast Plugin to JavaPlugin?
I'm trying to subcribe players to a channel using jedis Bukkit#getServer#getScheduler#runTaskAsynchronously, however it returns with this error:
Cannot resolve method 'runTaskAsynchronously(java.util.stream.Stream<capture<? extends org.bukkit.entity.Player>>)'```
Im trying to stream my players through Bukkit and filtering them
Is it correct that they removed the footstep particle from the regular spigot api? I cant find it
Its not in the nmc and in the spigot api
is there an event which can be listened to before the server stops? the closes thing i can find to it is WorldSaveEvent or WorldUnloadEvent
put code in your onDisable method
onDisable?
code?
the one you override in your main class
the one extending JavaPlugin
public void onMessage(String channel, String message) {
() -> Bukkit.getServer()
.getScheduler().runTaskAsynchronously(Bukkit.getServer().getOnlinePlayers().stream().filter(player -> player.hasPermission("command.staff")));
}```
yea
me?
yes
why do you have a lambda at the start
what are you tryna do
when is it specifically called before the save when the world stops?
it's called when your plugin is disabled
publish a string to all players which have a certain permission
yes
just do something like:
public void sendMessage(String message, String perm){
for(Player p : Bukkit.getOnlinePlayers()){
if(p.hasPermission(perm)) p.sendMessage(message);
{
}
I mean i need to destroy an entity before the world saves then stopping
destroy the entity when the world unloads then
Bukkit.broadcast(String message, String perm);
oh ok i was just confused would it be still saved into the world on the unload event
if you want it to not save in worlddata you can make it not persistent
but it won't save on chunk unloads either
hello mr kill05 nice to see you here
hello
oh hi hapily
why hexicdragon2
lol
btw can you always cast Plugin to JavaPlugin?
no
https://gyazo.com/a5ad3937f9bb65e7574932da2d7482ec
Why does intellij wants me to do this
but you can always cast JavaPlugin to Plugin
how can you get JavaPlugin from plugin then?
how did you get plugin?
polymorphism 101 lol
plugin disable event
in what case could it not be instance of JavaPlugin
i cannot think of any case off the top of my head
but it might still happen
but you can just check for it and then cast right?
What's the code for a custom hex color chat color
(Not the bungee api ChatColor enum class thing)
is that for fff000
ff0000, yes
Ty
np
π
π
is hikaridatasource.close() the same as hikaridatasource.getConn().close()?
how to make my scoreboard not static?
Hm does it not work in an MOTD (custom chat color)
remove the static keyword :kekw:
;-;
its true
i would imagine closing hikari will close the underlying database connection
I make this but i'm not trusting if is the better option
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
@Override
public void run() {
setScoreboard(event.getPlayer());
}
}, 20, 40);```
for automatic update
yea thats what i'm thinking
just use a lambda instead
i'm new in java, how use this?
Bukkit.getScheduler().runTaskTimer(this, () -> setScoreboard(event.getPlayer()), 20, 40);```
Hey fourteen, you can help me?
with?
wait 1 minute
the order isn't correct ._.
code:
public void setScoreboard(Player p) {
Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
Objective obj = board.registerNewObjective(getConfig().getString("Scoreboard.Title").replace("&", "Β§"), "dummy");
Object[] lista = getConfig().getStringList("Scoreboard.Description").toArray();
for (int i = 0; i < lista.length; i++) {
Score onlineName = obj.getScore(PlaceholderAPI.setPlaceholders(p, lista[i].toString().replace("&", "Β§")));
onlineName.setScore(i);
}
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
p.setScoreboard(board);
}```
it's always sorted by alphabet
then why are you sorting it
can send the fixed code? idk how
na
Hello! for some reason papi is sending this error:
But i'm using other 2 placeholders in the same way and they work, could anyone help me?
its very simple, you dont need a list of objects, just get a list of strings
Object[] lista = getConfig().getStringList("Scoreboard.Description").toArray();
is the correct
the type is still Object[]
try to actually learn about what you're doing instead of asking for code
'-'
String[] lista = getConfig().getStringList("Scoreboard.Description"); ?
or List<String> lista
show PlaceholderHandler line 68
and for it?
Hmm to string array or to string list for a string list....
deleting them onLoad works, thanks
there is no line 68
then you fucked up big time
what
because the stacktrace shows the error is in line 68
at me.jasperjh.animatedscoreboard.core.PlaceholderHandler.replacePlaceholderAPI(PlaceholderHandler.java:68)
then you didnt compile it again or sth
anytime there was a line 68 lol
the stacktrace doesn't lie!
the stacktrace doesn't lie unless you are using some stuff messing with your bytecode
lol
open a decompiler and see what line 68 is
lista.stream().map(s -> {
Score onlineName = obj.getScore(PlaceholderAPI.setPlaceholders(p, s.replace("&", "Β§")));
return onlineName.setScore(what i insert here);
});```
like jd-gui?
I prefer luyten but jd-gui is fine too
check PlaceholderHandler.java:68 file
what do you want to insert there?
for set in score
the file or the code?
is needed?
go to the file and check
nothing, the code is garbage. you cannot return what a void method returns because it doesn't return anything
what are you trying to do?
but there is no line 68 in the papi class and the line 68 in the file is a comment
set in my scoreboard the string of List<String>
setScore obviously only takes an int
I need to set the items from a List<String> in my score.
no you want to set the objective to have your strings as name
but mfnalex, you are meaning the class where i create the placeholder expansion?
the score itself is always only a number
I mean the class of which I sent you the error message:
at me.jasperjh.animatedscoreboard.core.PlaceholderHandler.replacePlaceholderAPI(PlaceholderHandler.java:68)
that isn't my plugin
oooh
is animatedscoreboard
what's your plugins package name?
check me.fragment.minespaceskills.papi.PlaceHolderApi.onPlaceholderRequest(PlaceHolderApi.java:49)
me.fragment.minespaceskills
then show PlaceHolderApi line 49
this return
either plugin is null or plugin.health is null or plugin.health.effectiveHP(player) is null
this is my effectiveHP class
where do you set plugin.health ?
bro, I want to put the strings in this List<String> on my scoreboard
I know and I told you that SCORES are numbers and OBJECTIVES have names
main class
obviously that's null
declaration: package: org.bukkit.scoreboard, interface: Objective
declaration: package: org.bukkit.scoreboard, interface: Score
if you don't insert health = "value of health", this is null
so, like this?
you basically want to get the score's objective and set its name
yes
ok, ty
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
that's really something you should know lol
i need to make a meme
'-'
whyyy is my craftbukkit broken D:
RIP
did u run the correct scripts!
which ones? I didn't run anything yet
actually ngl i dont think you have to run anything except build tools
idk
lemme try opening up cb on my local env
I don't think I have to run buildtools at all. I compiled / installed bukkit, and now am up to doing a change in craftbukkit but yeah
D:
but anyway, I already ran buildtools anyway soooo that can't be the problem π¦
rip
and the funny thing is
it worked yesterday
and I have not changed ANYTHING in craftbukkit at all, not yesterday, not today
yeah lmao
now it tells me my LazyPlayerSet class is broken - i never opened that file at any point in history lol
i'll just clone it again - probably the easiest solution π
[17:32:50 WARN]: [KScoreBoard] Task #388 for KScoreBoard v1.0-SNAPSHOT generated an exception
java.lang.ClassCastException: java.util.stream.SortedOps$OfRef cannot be cast to java.util.List
at me.koddydev.KScoreboard.setScoreboard(KScoreboard.java:62) ~[?:?]
at me.koddydev.KScoreboard.lambda$onJoin$0(KScoreboard.java:56) ~[?:?]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71) ~[server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [server.jar:git-Spigot-db6de12-18fbb24]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_312]
Kscoreboard line 62?
List<String> lista = (List<String>) getConfig().getStringList("Scoreboard.Description").stream().sorted();
'-'
e.g. collect(Collectors.toList())
.stream().sorted().collect()?
i dont even see the point to this
oh ok
seems like they want to sort their list
@tender shard your game looks pretty cool
no, Collectors.toList() ^^
thanks :3
I like the graphics
why do you need the stream
yeah it's what 26 year old idiots produce when they have access to a legal version of photoshop lmao
definitely wasn't worth the money lol
getStringList() already returns a list of strings
because they sort it ofc
'-'
I bought the creative cloud on black friday and have barely used it since
I feel you
he said before he didnt want it sorted
weren't you just annoyed because you were sorting it and you didn't want it sorted
yeah D: I got it for the student price
oh really?
yeaaaa
erm
ima dm u rq mf
then ffs just don't sort it and use the list directly lmao @quaint mantle
to explain what's going on
okiii
guys
sorry for my codes
i need for fix the scoreboard but in the chat works
in scoreboard
what do you need to fix?
the sequence
Nome
Money
the scoreboard automatically gets sorted by alphabet
i need to fix it '-'
soooo prefix every line with a number or something similar
if you set the score with the objective it'll go from highest number to lowest
maybe color codes would work too, no idea
that's those yellow numbers right?
how '-'
I think that's how my former employer did it too
Objective 1 5
Objective 2 4
Objective 3 3
...
they're the red numbers on the far right
ffs did you even look at the javadocs I sent you?
i using 1.8
that's bad but doesn't matter
okay I'll explain it one more time
this
every line in the scoreboard has an objective (the name/string) and the score (the number)
ohhhhhhh ok
lines with the same score are sorted by alphabet
and all others are sorted by their score
idk about how it is in 1.8 tho so gl
so give your first line the highest score, your last line the lowest score, etc
I am guessing it's the same in 1.8
yeah I think scoreboard api was added and then it just silently existed since then lol
thx '-'
onlineName.setScore((lista.size() - i));
'-'
for (int i = 0; i < lista.size(); i++) {
Score onlineName = obj.getScore(PlaceholderAPI.setPlaceholders(p, lista.get(i).replace("&", "Β§")));
onlineName.setScore((lista.size() - i));
}
thanks everyone
btw you should stick to english names for your variables, makes it easier for other people to help you
ok!
π
:)
uuuh for real why is this happening D:
I just cloned it again
still it can't resolve all that stuff
:(
e.g. it cannot find EntityPlayer.timeOffset
verify the version
verify the version? I literally cloned it from spigot stash 1 minute ago
'-'
and yeah, it's 1.18.1-R0.1-SNAPSHOT π
I'm not having the same issues tbh
just ran buildtools and then opened the cb local env in the folder that it builds
hm yeah that might work but shouldn't I use the code from spigot stash instead?
at least that's what the contrib guidelines say
old things are old
I just wonder - how am I supposed to create a PR if I'm not using my forked repo to clone it?
yeah the buildtools code works but as said - how am I supposed to commit sth now?
now my buildtools code is borked
how to remove scoreboard of a player
π
lmfao
RIP
I'll wait for md_5 to come online lol
?
but how? the thing that buildtools created is not from my own forked repo
entity summoning problem
i need to remove the scoreboard on disabling plugin
ngl I just copy paste my changes to the web editor of my fork then push
You can push to whatever repo you want
and I already told you what to do
but not if their histories aren't related
But they are
Your fork should be kept up to date with master automatically
i have best internet
bet I got a better one?
i have 10 mbps :(
π
lucky you, you get food
I'm hoping you're on a vpn
or vps
no why woud I?
your ip is right there π
so?
you can also have my address if you like -> https://jeff-media.com/en/site-notice/
mwaha now i have ur ip im gonna do funky things with it!!!!
your priorities are interesting
who cares about someone's ip
the EventPriority.LOWEST is the one that gets executed first right?
lmao yeah
so the lowest priority is the highest, and the highest priority is the lowest? (apart monitor)
no, lowest is lowest
declaration: package: org.bukkit.event, enum: EventPriority
lowest is first to execute, highest (and then monitor) is the last
its a bit confusing, but the highest piority gets executed last. hence having the most influence on the event
i don't get it
oh
yes, if you do something on lowest, someone on highest can override your changes
Highest priority has the final say in the event.
^
indeed
ohhhhhhhhhhhhh
lowest squid is highest squid?
maybe we should go back to Map<String,Object>
kekw
I'll map you to a string
that statement is on point
that's kinda gay
mine is decent https://gyazo.com/f36a1d4269d6cd60787298a2793f8578
ping jeff-media.com pls and show results
just wondering about the ping brazil <> germany
im on wifi
evil adel
sadge
wifi bad
145 ping avg to jeff
where are you from again?
ah okay that's also quite good
my servers are basically next to DE-CIX so I kinda expected good pings, but not that good
okay everyone google your birthdate + "florida man"
lmao
not the place for this
oh yes sry
I thought we were in #general sry
sowwy boss
any help pls, im stuck on that
did you read the replies you got? two people said slimes probably don't have pitch
it is not about pitch
but you asked about the pitch and yaw
rotation basically
okay so only yaw
yaw then
y(eeh)aw*
hm no idea. did you try adding some debug stuff to see whether it actually sets the yaw?
e.g. print the yaw before and after tping the slime
I'll test it myself, gimme some minutes pls
should not matter if it extends Slime and you aren't overriding any teleport logic
although not sure, I never ever worked with NMS entities besides some NPC stuff
im removing the pathfinders
hm I dont think pathfinders matter when teleporting
but as said, not sure
I'll just do some testing things
well, i googled a bit and some people related that they had the same problem AFTER removing the ai or pathfinders
btw what makes me mad is
World has a method spawnEntity but still requires the location, that I already used to get the world from
there should be a static Bukkit.spawnEntity(Location, ...) thing or a Location.spawnEntity() thing lol
oh wait @golden turret
how do you even spawn custom entities?
I only get World#spawnEntity that takes an EntityType
CraftWorld#addEntity
thx
wait that method is totally different in 1.18
hm I have no idea how it works in 1.18 lol sorry I'm out
my CustomSlime constructor looks like this:
these people that only use recent versions...
public CustomSlime(EntityType<? extends Slime> entitytypes, Level world) {
super(entitytypes, world);
}
those people using outdated versions...
yeah but no idea what "level" is supposed to be
world
NMS world
nope
to what?
brb making custom slime project
I wonder what other Levels exist beside ServerLevels
also Level is a horrible word for World lol
but
why would I need to cast a ServerLevel to a Level when ServerLevel extends Level
that makes no sense to me
that's how its called in mojna'gs mappings yup
this doesn't make any sense at all, it's like casting a String to an Object to use a method that requires an object as parameter
I really don't get it lmao
I can't help, sorry π
nms is hard bro
how to edit my tab
yes
example
how can I check if a generic of an object is of a certain type?
let's say i have a Consumer<?> and i wanna check if it is a Consumer<Player>
how would I do that?
it's a bit different in my case
I'm using a Consumer and well you can't stream a consumer
or can you
is there any api for creating islands in a void world?
you gave me an idea
before spawn, i will get its yaw
and then check for every field on the class
and see who is equal to the yaw
getGenericType() ?
'-'
neat
i forgot what is yaw and pitch
from the class Class?
pitch = up/down, yaw = left right
god that sounds confusing
I know that Field has it
what kind of object do you have?
Consumer
i have a BiConsumer<?, String[]>
and i wanna check if the wildcard is a Player
or a ConsoleCommandSender
BiConsumer<String,Integer> test = new BiConsumer<>() {
@Override
public void accept(String s, Integer integer) {
}
};
test.getClass().getGenericInterfaces()
should return an array of Type[]
hello
i want to get a skin signature and value for GameProfile for npc plugin
what should ido
you can call getClass on the Type to get the class
oh so i check the instance of that
executor.getClass().getGenericInterfaces()[0].getClass().isInstance(Player.class) something like this?
test.getClass().getGenericInterfaces()[0].getClass().equals(Player.class);
if that skin already is on some player use mojang api, or MineSkin to generate skin value and signature
isInstance is to check an whether an INSTANCE is of a certain class
you just need to check whether the class of your first (0th) type equals the Player.class
a premium player
how to use the mojang api
get the value and signature from a name
ah ye
pls let me know whether it works. I just made that all up and have no idea if that works lmao
it should work though
erm hm no
well
you're right about the subclasses
that might be an issue
one sec
like if the consumer had <CraftPlayer, String[]> it would return true with isInstance
or na?
yea
yeah then what I sent should work
it can either be a Player or a ConsoleCommandSender
otherwise, get the Types.getClass.getInterfaces and check whether one of that is Player
replace uuidhere with player uuid
aight thanks
then just check for both π
i'll finish it up and let u know if it works
i know this but
i want my code to get the uuid of a player (offline mode server)
and then get this
you CANNOT check whether it equals to a superclass, you have to check those two interfaces explicitely
and yeah pls let me know whether it works π
although I have no idea why anone would need this π
UUId of offline players?
they can easily just use fake names
just dont do offline servers lol
^
coding a command api that uses a biconsumer so the developer can put in what does the command execute
ah oki
the first object of the biconsumer is the sender
gg?
what
daaaamn
i used to have my own functional interfaces but i thought might as well use java's functional interfaces
but at this point i think it would've been better doing so ;-;
functional interfaces are scary
because
I don't know how they work
lmao
if you got any good example for functional interfaces pls let me know @misty current :3
well a biconsumer is a functional interface
not gg π‘
oh
I maybe need to read something about it then lmao
learn haskell
probably you know how they work but not the name
I mean, ofc I know what consumers are etc, but no idea what's meant with functional interface
I had to do that once
and I nearly killed myself, that language is so fucked
FunctionalInterface is an annotation so you can represent it with a lambda
functional interfaces are basically ones used with lambda statements
command frameworks are pog can confirm
ugh it's really just that?
yeah pretty much
the annotation yeah
alright then I know what it is lmao
ACF = life savior
yes
i implemented ACF into a plugin yesterday when helping a guy organize his first plugin, and it's sooo good
yeah although it's sometimes a bit stupid
was a bit confusing to get into tbh but I got it now
e.g.
public static void whatever(CommandSender sender, Player argument) {
...
}```
it does proper tab complete for player names
buuut
it's still possible to provide a value with no proper player name and argument will just be null
took me like 10 minutes to figure out how tf to actually make a command after extending basecommand
yeah the docs are a bit sparse
I learnt it from looking at example code or at other plugins using it
i forgot i already fixed that issue lol
nothing wrong with that, it was made to save data π
i meaaaaaaaan
idk abt that one chief
ye, but its slow because its meant for config files that are human readable
yeah but I doubt that you read the files synced on every tick
reading files in general is slow. the difference between json and yaml is basically non-existent if you also take into account the fact that the OS has to actually read the bytes of the file in the first place
unless maybe you have a 7GB YAML file
and you probably don't π
but yeah technically json is better if you store large stuff that doesn't need to be edited ever
although I wouldnt care about switching if I'd already have it done in yaml
too late lol
but the api/library/framework (idk what to call it) is super easy to use
of Yaml?
see what i found
fun
π€
so in some moment of the tick
the yaw is changed
tried to add breakpoints but didnt worked
It's a playerInventory, why does it show a chest inventory ?
it does show a player inventory
you just can't force a player to see another players inv
it will just look like this
you'll have to either
- set the actual player's inventory contents to something else or
- send the player packets to make them believe their inventory changed
Ok its intended
what did you change?
does anyone know how to make a bee always angry. when i set it to be angry it hits you then becomes passive. how to i prevent that
What I want to do is to copy the inventory. I want to copy the values, not the reference
shouild i have a runnable that runs every 5 mins or so that saves my config as well as on disable?
is there a material that counts in all types of glasses?
Sorry for ping, but what theme do u use?
Monokai Pro from Material Theme UI plugin
Thanks β€οΈ
I would love to have high contrast mode but I must pay the full license
which im too broke
np bro @quaint mantle
Maybe
But in principle
You should NEVER need to save your config
Because it is simply a way for your users to change certain behavior of your plugin
<repositories>
<repository>
<id>jitpack</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
</dependencies>
<dependency>
<groupId>com.vexsoftware</groupId>
<artifactId>nuvotifier-universal</artifactId>
<version>2.6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>```
Why is this dependency not working? It is how it is listed on the GitHub page.
can anyone here read kotlin?
need some help with something
trying to understand what level.let{} does
@ivory sleet
Sorry for the ping! Can you help with this?
line 25
Heyo! I register my fully custom entity and it has no asstributes, it's attributes are null. I want to set default attributes for my custom entity, but idk how currently, because my currently soultion sometimes does not working. No attributes error
Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.ai.attributes.AttributeProvider.a(java.util.function.Consumer, net.minecraft.world.entity.ai.attributes.AttributeBase)" because "this.d" is null
at net.minecraft.world.entity.ai.attributes.AttributeMapBase.e(SourceFile:48) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
at java.util.HashMap.computeIfAbsent(HashMap.java:1224) ~[?:?]
at net.minecraft.world.entity.ai.attributes.AttributeMapBase.a(SourceFile:48) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
at net.minecraft.world.entity.EntityLiving.getAttributeInstance(EntityLiving.java:2333) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
at net.minecraft.world.entity.EntityLiving.<init>(EntityLiving.java:292) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
at net.minecraft.world.entity.EntityInsentient.<init>(EntityInsentient.java:132) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
at net.minecraft.world.entity.EntityCreature.<init>(EntityCreature.java:17) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
at pl.tuso.xentitydev.entities.type.EntityDev.<init>(EntityDev.java:70) ~[?:?]
at pl.tuso.xentitydev.entities.Snail.<init>(Snail.java:26) ~[?:?]
at pl.tuso.xentitydev.events.DevCommand.onCommand(DevCommand.java:25) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
... 19 more```
WorldLoadEvent listener is being called twice? Is this normal?
Sure
Set<Material> glasses = Arrays.stream(Material.values()).filter(m -> m.name().contains("GLASS") && m.isBlock()).collect(Collectors.toCollection(() -> EnumSet.of(Material.class)));```
π
That should count every type of glass block
That is, every material which is a block and has "glass" in the name π₯²
How do i give entities more health than vanilla
using attributes
what not
every time i try it doesnt give it more health
use entity.setMaxHealth() and entity.setHealth()
oh
then setHealth
ok thanks
Is this the correct way to get the color of a string?
ChatColor color = ChatColor.valueOf(ChatColor.getLastColors(kingdom.getDisplay()));
If for example, kingdom.getDisplay() == &4Test, will it return ChatColor.RED?
How could I add an identifier to a block I place by plugin, so I dont select every block ?
I would like to distinguish them
You can only add data to blocks which have TileStates
Where can I see that ?
?javadoc
thanks
so if im doing something like
smth like a countdown
and i wanna store it in a database
could anyone help me setup a plugin in intellij for kotlin/
i should just store it in a hashmap
and when the player leaves
i save it to database
and remove from hashmap
right?
if its a count down per player just throw it in the players PDC
1.8.9
slit wrists and give up
why
1.8.9
cant i use databases :P
so is editing the database every second better than changing hashmap and only editing database when player leave or kicked
hello
does the timer stop when the player logs off?
Yes
then just store it and restart when they log back in
Hi, do you know what variables are to put in my score to know how much money you have?
???
so the answer is no
Hi, do you know what variables are to put in my score to know how much money you have?
Hi, do you know what variables are to put in my score to know how much money you have?
???ΒΏ?ΒΏ
Not enough information to give an answer.
usually %vault_eco_balance%
why are you checking if its a block
i think they mean placeholders
possibly
grax
if it has glass in its name it will surely be a block
Thank you
glass bottle?
because of spyGLASS
glAss();
OH
'twas secretly an OpenGL call
and how do i earn money?
not sure what you mean by that
and how do i earn money?
still
not really sure what you mean
.v
I speak spanish xd
Because they probably don't want to match bottles
Yes i realized that
If they do then they can remove that
Why do you need to split for that
And that wouldn't match glass panes
STAINED_GLASS_PANE
Probably did
?
no because getLastColors will return both the section sign and formatting iirc
why do you need to know that it is red
I'm creating a discord role for the kingdom and discord roles have colors
Is there any way to do this?
Hello
Placeholderapi not work
Code: ```java
package me.koddydev.kvender.util;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.OfflinePlayer;
public class Placeholders extends PlaceholderExpansion {
@Override
public String getAuthor() {
return "KoddyDev";
}
@Override
public String getIdentifier() {
return "Bolsa";
}
@Override
public String getVersion() {
return "1.0.0";
}
@Override
public String onRequest(OfflinePlayer player, String params) {
if(params.equalsIgnoreCase("%kvender_bolsa%")) {
return (Settings.valorBolsa < 50 ? "Β§c" + String.valueOf(Settings.valorBolsa) : (Settings.valorBolsa == 50 ? "Β§6" + String.valueOf(Settings.valorBolsa) : "Β§a" + String.valueOf(Settings.valorBolsa))) + "%";
}
return null;
}
}
plugin.yml?
name: KVender
version: '${version}'
main: me.koddydev.kvender.KVender
api-version: 1.8
depend: [Vault, PlaceholderAPI]
authors: [ KoddyDev ]
commands:
vender:
description: Comando de vender
use %KVender_bolsa% as placeholder
ok
with capital k and v
how could you transfer logs to someone, but that someone cant use console or cant access server files directly (say a player does some action and in some way they can get a potentially larger amout of information)?
if(params.equalsIgnoreCase("%KVender_bolsa%")) {
or
if(params.equalsIgnoreCase("KVender_bolsa")) {
wait, do ```java
if(params.equalsIgnoreCase("bolsa")) {
And in-game use %KVender_bolsa%
because KVender is you're plugin name
add your own logging Handler
/papi parse uVini__ %KVender_bolsa%
@Override
public String onRequest(OfflinePlayer player, String params) {
if(params.equalsIgnoreCase("bolsa")) {
return (Settings.valorBolsa < 50 ? "Β§c" + String.valueOf(Settings.valorBolsa) : (Settings.valorBolsa == 50 ? "Β§6" + String.valueOf(Settings.valorBolsa) : "Β§a" + String.valueOf(Settings.valorBolsa))) + "%";
}
return null;
}```
not work
could explain more in detail? like in which way would that work?
okay, nice
fixed by:
Is it possible to create a custom block implementing the TileState interface ?
or
is it possible to implement TileState on already existing block ?
%indentifier_bolsa%
%KVender_bolsa%
Ah
Anyone?
Would you guys say Redis is better to communicate to other servers than bungee for plugins?
Ok so my goal is to set an id to each petrified slab block so I can have an unique inventory for each of em
TileState is not on blocks ?
certain blocks have a TileState. You can;t add one to a different block
helo
Bungee has some limitations regarding players
You need to have a player online to receive messages
<repositories>
<repository>
<id>jitpack</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.vexsoftware</groupId>
<artifactId>nuvotifier-universal</artifactId>
<version>2.6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>```
Why is this dependency not working? It is how it is listed on the GitHub page.
try removing the / on the start dependencies tag.
no that's just an error with me typing it in
i have more than just 1 dependency
and i wanted to keep it straight forward
hmm I have no idea then. I haven't used maven that much.
java.lang.IllegalArgumentException: bound must be positive
at java.util.Random.nextInt(Random.java:388) ~[?:1.8.0_312]
at me.koddydev.kvender.KVender$1.run(KVender.java:55) ~[?:?]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71) ~[server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [server.jar:git-Spigot-db6de12-18fbb24]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_312]
Random r = new Random();
int result = r.nextInt(getConfig().getInt("BolsaDeValores.Maximo")-getConfig().getInt("BolsaDeValores.Minimo")) + getConfig().getInt("BolsaDeValores.Minimo");
Heyo! I register my fully custom entity and it has no asstributes, it's attributes are null. I want to set default attributes for my custom entity, but idk how currently, because my currently soultion sometimes does not working. No attributes error
Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.ai.attributes.AttributeProvider.a(java.util.function.Consumer, net.minecraft.world.entity.ai.attributes.AttributeBase)" because "this.d" is null
at net.minecraft.world.entity.ai.attributes.AttributeMapBase.e(SourceFile:48) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
at java.util.HashMap.computeIfAbsent(HashMap.java:1224) ~[?:?]
at net.minecraft.world.entity.ai.attributes.AttributeMapBase.a(SourceFile:48) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
at net.minecraft.world.entity.EntityLiving.getAttributeInstance(EntityLiving.java:2333) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
at net.minecraft.world.entity.EntityLiving.<init>(EntityLiving.java:292) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
at net.minecraft.world.entity.EntityInsentient.<init>(EntityInsentient.java:132) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
at net.minecraft.world.entity.EntityCreature.<init>(EntityCreature.java:17) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
at pl.tuso.xentitydev.entities.type.EntityDev.<init>(EntityDev.java:70) ~[?:?]
at pl.tuso.xentitydev.entities.Snail.<init>(Snail.java:26) ~[?:?]
at pl.tuso.xentitydev.events.DevCommand.onCommand(DevCommand.java:25) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
... 19 more```
private static <E extends Entity> void setDefaultAttributes(EntityTypes<E> type){
try {
final Field field = AttributeDefaults.class.getDeclaredField("b");
field.setAccessible(true);
Map<EntityTypes<?>, AttributeProvider> attributes = new HashMap<>((Map<EntityTypes<?>, AttributeProvider>)field.get(null));
attributes.put(type, EntityInsentient.w().a());
Utils.setField(field, null, attributes);
} catch (NoSuchFieldException | IllegalAccessException exception) {
exception.printStackTrace();
}
}```sometimes it works and sometimes it doesn't, as if it didn't have time to add attributes.
how to make a custom chest in this case ?
Any1 having something to help me recreate bungeecord protocol?
I want to buy small ovh server and recreate something like tcpshield just for my servers
Hey, can someone help?
How can i get the ChatColor from a string like this "&4test"?
I don't want to set the chatcolor, i want to get the chatcolor
does itemMeta.getLore return a reference or a copy ?
Copy probably
use regex
find the group, then map the letter to its chatcolor
Dutch?
mhm
something as simple as \&([0-9|a-f|k-o|r]) should do the trick for the basic chat colors
You can also use getLastColor
But that will return a string
not a chatcolor
I never used regex before
Yes, use the string as a map key
Hi,
I want to change one thing in a big bukkit plugin and I cant figure out to open it to change it and close it and save it as a jar again. I have been trying for hours. I am editing a prexisting plugin btw.
anyone know a fix
idk how to open a jar and edit
yeah im just changing something in one of the class files
You need a decompiler
but idk how to decompile in eclipse
Eclipse doesnβt have one built in
then how do I do it
recaf
Or use IntelliJ
Like this?
ChatColor color = ChatColor.valueOf(ChatColor.getLastColors("&4Test"));
will it do it automaticall
What part of that is a map
I can't find a map containing ChatColors
You make one
Ohhh, thx
Map<String, ChatColor> colors = new HashMap<>();
colors.put("&4", ChatColor.DARK_RED);
colors.put("&c", ChatColor.RED);
colors.put("&6", ChatColor.GOLD);
colors.put("&e", ChatColor.YELLOW);
colors.put("&2", ChatColor.DARK_GREEN);
colors.put("&a", ChatColor.GREEN);
colors.put("&b", ChatColor.AQUA);
colors.put("&3", ChatColor.DARK_AQUA);
colors.put("&1", ChatColor.DARK_BLUE);
colors.put("&9", ChatColor.BLUE);
colors.put("&d", ChatColor.LIGHT_PURPLE);
colors.put("&5", ChatColor.DARK_PURPLE);
colors.put("&f", ChatColor.WHITE);
colors.put("&7", ChatColor.GRAY);
colors.put("&8", ChatColor.DARK_GRAY);
colors.put("&0", ChatColor.BLACK);
//-----
ChatColor color = colors.get(ChatColor.getLastColors("&4Test"));
So like this?
that does not work with multiple colors
In gradle, got 3 modules, core spigot and bungee, currently i shade just in the root project and make universal jar but does anyone know how to apply shadowJar properties on every module without putting it in every build.gradle? allProjects doesnt work
I'm confused, how does getLastColors even work then?
it really just returns the last chat color
e.g. "&cHello this is red &aand this is green" will result in &a as an output from getLastColors
&c is ignored
So why doesn't it work then?
Oh, like that. getLastColors is enough. Now i need to convert it to a java Color
you can go from hex -> java color
Thx
? '-'
Hi, im coding using intellij and maven, but i have one problem. When i'm debugging the stacktrace is not parse to my code, why? for example at net.minecraft.world.entity.ai.attributes.AttributeMapBase.a(SourceFile:48), when i click it it show me that, why?
because decompiled code isn't going to line up 1:1 with what's running on the machine
Iβve always wondered how the JVM knows what line
Does bytecode contain line numbers still or something?
Will getLastColors return null if there are no colors codes?
so what can i do in this situation, i can't debug with that, because idk where is a problem?
iirc yes
can someone please help me with nms?
i have both 1.18 and 1.8 buildtools
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.8-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
this is my xml
I am trying to port an old plugin to a newer version, but I'm not sure if the API changed and if this package still exist or what the equivalent would be now
org.bukkit.craftbukkit.v1_16_R3.inventory.CraftItemStack I'm trying to get this updated for 1.18, any help would be appreciated
I may just be stupid and not know where to look (a bit new to this), but is there any documentation/tutorials on how to make a plugin depend on another? I know how to add it in it's plugin.yml, but not how to use the independent's methods, etc. in the dependent plugin.
plugin needs to have api
@quasi stratus
Hello, i have problem with LuckPerms API
How i can get Expire time from group?
Yea, i tried that before...
Even so I couldnt do it
ask on luckperms help formus or discord
so?
@quaint mantle did you run the build tool?
You canβt use multiple versions in the same project
and how do I make these nms work?
how
maven
How do i install NMS for spigot 1.16.5?
In the same class* (unless using reflection)
can you please help me? like, hop in a discord call and ill stram it to ya because i cant figue it out
