#help-development
1 messages Β· Page 1901 of 1
my boss has multiple phases, to get past phase one, a certain condition must be met
And you're using the scheduler to detect when the phase changes?
as in detect when its health hits a certain amount then the scheduler changes its phase or
well yes, when enough boss's "slaves" die, go onto the next phase
try executing a phasechange method outside of the scheduler and cancelling it
you can't really return on the scheduler cause its in a different thread
i see, i see
Is there a way to check whether server has completed startup phase and all plugins are loaded?
I can schedule some task using scheduler, that task would execute after startup phase, but this is rather dirty workaround.
there's no event for it sadly, if you run a scheduler task on the next tick, it waits for the server to be loaded anyway
Would this be good for learning to code plugins?
dont pay for that
its not worth it
also plugins are not everything. invest into a java course, buy books, there are also many good free courses even on youtube. you have to learn java before spigot.
Could you maybe send some good free courses or youtube videoes?
I mean if its spigot you really wanna learn, then if you youtube search thesourcecode, they've got some good bukkit material
this is a stupid question that I can't find the answer to online, are GoogleAuthenticator scratch codes the emergency codes a service gives you if you lose your 2fa key
I don't intend on using Java to anything else than Minecraft plugins
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.
import me.lumina.luminassw.ItemBuilder;
import me.lumina.luminassw.comands.kit;
import org.bukkit.GameMode;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class LuminasSw extends JavaPlugin implements Listener {
@Override
public void onEnable() {
// Plugin startup logic
getServer().getPluginManager().registerEvents(this, this);
getCommand("kit").setExecutor(new kit());
getLogger().info("Luminas sw was Started successfully.... ");
}
```it says there ais a ( missing but isnt can someone please check it?
free code camp is reaally good but i doubt there is a tutorial there
i think the official oracle tutorials are the best
although it doesn't come with exercises or checkpoints
it has the best and most in-depth explanation for the language
^^
found it my class's "{" was never closed π€¦
just a reminder that class names should be in PascalCase
well it litterly tells you which line ... and if you can count to at least 5 there should be no problem if you even used the methods right
it dint tell me the line thats the problem
then you should learn java and how the syntax works if you again missed a ( or ) or { or }
sensible formatting π
You can try.
Try what ?
You can try #getServers().isOnline or something like that
You know that i'm speaking about a plugin of a server not for a bungee plugin
send a msg to all servers you want to know if they are online .... but when there is no player you wont recive anything too
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Through code?
Yes
I mean you can use the api
Or rely on sth like LuckPerms
Which is what Iβd suggest
Ok..
I'm making ranks
Well ok
And feature rich as well as actively maintained x)
True
player.addPotionEffect(PotionEffectType.SATURATION.createEffect(9999999, 255));
``` adding potion effects but i dont get the effect in game
any help?
1.8
yeah update your version lol
we hate 1.8 as well
dude im making a sw plugin 1.17 pvp is not my thing
there is already version 1.18 ^^
and with all the api stuff you can easy recreate the old pvp behaviour ^^
not gonna lie, the recreation doesnt feel the same as actual 1.8 pvp
i still agree though
yeah... not exactly but who the hell wanne have kids that win fights because they use auto clicker ^^
;-;
Just learn modern pvp smh
1.8 pvp is more satisfying
no, go on cubecraft and see
it's hella boring
why shouldn't it ?
you can modify everything like damage/armor and knockback if thats the problem
Its not lol
true, but people like 1.8 for the combo's and stuff
something you cannot do in modern
Cubecraft skyways is a fucking hardcore
Boohoo
hypixel skywars is hardcore
yeah... "combo" of bow spam, fishing rod spam and attack button spam ... xD
fast pace and all
but i think we should not talk about this in development
You can do combos in modern. Thats one of the most important part of 1.9 pvp LoL
The world really seeks for another "unique" skyass server
xD
hypixel sw is lag and hackers smh
Everyone is waiting for another skywars, kitpvp, factions and prison server
For real its so tiring that people keep holding onto those gamemodes
and, to say, 1.9 xombos are MUCH harder
Guys you're literally freaking developers, you can create ANY unique new gamemode easily
yeah lets not fight
1.8 is still unsupported ;)
1.17 definitely runs better
Ur wrong
But 1.18 is such an upgrade to worldgen
You should know thousands of top players can do 1 click combo when they combolock the opponent
So, in theory if they can combo lock in modern version
Combo still possible
Combos work just fine in both versions
I have waay too many hours on Cubecraft and I'm well aware of how effective they still are
I hate 1.9 pvp against my friends, they're too godly and I get stuck in their combos π
Fkin pvp goons
bro!
i played team skywars alot aswell
^
Ya know, escaping a combo is impossible when you got locked in
Unless you run back
Move as inconvenient for your enemy as possible
(Or they mess up)
Which will gonna trigger most players
But wait
Why did i discuss this in dev channel lol
I used to play bedwars a bunch too but everyone got so competitive
I miss the casual sometimes
Tryhards, sweats
Mhm
.sk files are skript files, correct?
My favorite insults
Well, im one myself, but not in this game
In another game, that is more competitive than Mc
duel me in quake 3
I play .io games bro they are even more competitive
hi,
I have to know the way to apply GENERIC_MOVEMENT_SPEED to a Villager i made, but i cant find how to, help? (SOLVED)
How would I convert a .sk skript to an actual plugin?
tried googling with no results
any help would be appreciated
learn java then write the plugin
There is no "convert"
so basically I have to reqrite it?
Yes
actually
I see
how would one make a timer on a bossbar? all i want is just a timer that is the player's time played statistic in HOUR:MINUTE:SECOND format that is displayed on the players bossbar with a resource pack font
do you know how to convert between seconds -> minute -> hour ?
nope idk mathz
?gotoschool
how many seconds are in a minute
60
.-.
oh wait you just divide it by 60
yep
ok
so now what do i do
first, what method should i use
unix timestamp from when they join until they leave? playtime statistic?
i wanna have it per player aswell
what time do you want to display ?
the playtime
HOUR:MINUTE:SECOND
basically i just wanna make the same system as the 100 hours in hardcore
for my smp
and yes i will be using a resource pack
what has this to do with a resource pack ?
to offset it to the right bottom corner
ok thats absolutly not interesting for creating the bossbar
ok
Hours = seconds * 3600
what ?? no
so where do i start?
this would mean that hours are more then seconds
Hello, I am trying to stop villager renaming with name tags
the interact event is cancelled as it should but the entity still gets renamed
any pointers?
https://nekobin.com/tofixivera
create a bossbar, get the time the player has playd and then think about converting playtime to better format
yeah ik, i just don't know how to do that
try PlayerInteractAtEntityEvent
What do you mean
hmm i hate "final var" ... makes it not that easy to understand the code
yes.
but this is just wrong there
ok so first, i'll need to run this function to update the bossbar for each player every second - how do i do that?
hours = time / 3600
Minutes = time % 3600
seconds = hours * 3600
and also it needs to be in sync with the playtime update
Ah yeah my bad
still the same, the interaction is cancelled when clicking with the name tag only but the rename still happens
Had a little brain fart
is there an event#setResult ?
show me your event
Can I get Material names translated to specific language as seen in the client, but on the server?
probs somethin with raw name
not in the api, but some work will do that
is there an event for playtime update?
statistics event ^^
i would rather catch every 10s if the player is there and add 10s to his count ^^
you can catch the player every second too... but statisticsevent spams a lot
but then it wont be synced
why not create a runnable that updates it every second...
so it might update only every 2 seconds
i wanna use the player time played statstic tho, and that requires to be in sync with it
the playertime statistics will not update every second π
oh
so what system do i need to make in order to make it look like a real timer that goes up every second
runnable ?
whats that
loop?
hell no
like a thing that loops every second
?scheduling
thats what im used to, from skript
im pretty sure player playtime stats is updated every tick
no i don't mean i'll use a loop
i mean like is it like a loop that runs every second
?
u can make one with this
ok, where do i store the variable
Why would you
iirc and if it not get changed it updates on join/leave hmmm
nah its defo not updated on join and leave
Iirc I've never been able to pull live updates from statistics
ive used it before and it updated fine
It like only updates every few minutes or something
its fine i can make my own system, i just need directions
Here are your directions
smile

Well then why did mine not work 
oh great, that means i don't have to make my own system
no idea
how do i sync it tho
i need to sync the bossbar update with the playtime update
so when the playtime goes up one, so does the bossbar
you just need to create a loop that updates the bossbar every second in your case
yeah but then its not synced and unless it starts on the same tick as the playtime, it will not work correctly
its always worked fine for me
alr
i think you can rly dump those 1 or 2 seconds that are not correct
i want it to look good tho
it'll look very unsatisfying or fustrating if it only updates every couple seconds
dont know what u did, but i used this ```
public long getPlayTimeSeconds() {
return getPlayTimeTicks() / 20;
}
public long getPlayTimeTicks() {
Player player = Remain.getPlayerByUUID(uuid);
return player.getStatistic(Statistic.PLAY_ONE_MINUTE);
}
and i have no idea why its c alled PLAY_ONE_MINUTE by the way, it returns it in ticks
the naming of the statistic always makes me happy
yea
so what do i do to make it synced?
I thought I did that too but π€·ββοΈ
i was very confused at first as i had played my localhost for 25 years
ItemStack[] newItems = new ItemStack[kit.getItems().length];
int count = 0;
for (ItemStack item : kit.getItems()) {
if (item != null) {
if (item.getItemMeta() != null) {
ItemMeta meta = item.getItemMeta();
meta.removeAttributeModifier(Attribute.GENERIC_KNOCKBACK_RESISTANCE);
item.setItemMeta(meta);
}
}
newItems[count] = item;
count++;
}
player.getInventory().setContents(newItems);
Not removing kb resistance from items. No errors.
You don't have to spam it
don't spam my friend, if people don't respond to you immediately just wait until someone can help, if its been a while you can bump it by replying to the initial message with something
will this give me player's death location?
In InventoryAction, are all variants of DROP when the inventory holder drops the item out of the inventory?
As long as nothing else is teleporting them
this wont work
because the player will be on their death screen
hence not alive
hmm
any idea as to what i do?
what if pull the location before putting them in spec?
hmm
respawn will not give him his death location i think
i have never used damage event any idea
i wanna tp them totheir death location and summon a lightning bolt at it making a sw plugin(1.8 pls dont shout at me for using 1.8)
if you use respawn you will have 2 bassically unused teleports
while if you don't show the death screen, you can instantly put them in spectator
idk use whichever you want
i kinda dont wanna show deathscreen too
ill look into both thanks for giving me the idea!
for additional information, im pretty sure there is 2 ways to avoid a death screen, either with packets or a damage event
gamerule doImmediateRespawn true
i hate respawn ... i would always put the players into spectator mode or smth and then handling their respawn
no π
yikes :D
heyo, i'm back and i still have the same question - i wanna make a playtime timer that goes up every second, that is also displayed in each player's bossbar with their own playtime and using their time played statistic
repeating task
Would recommend not doing it every second, maybe every 5 or 10
Dont want to lag out the server
i don't think i can do it with the bukkit schedular since it won't be synced with the statistc of each player
did you even try it ???
I got it working with mojang
well i was gonna but then you said that it will do that anyway
they dont exist any more
well then go and try it before thinking it wont work
well are they deleted ?
why wouldnt it
like old 1.16
i am quite sure it wont work cause well logic
i think they still exist ?
i mean, they dont exist on newer versions
that doesnt make any sense
if you use the jars in bundler you have spigot mappings
it will work
if the schedular runs every second and is not synced with the playtime, it will most likely skip a second and will only update every 2 seconds
if if if ... try it.
Is there any alternative to the Conversation API? I feel like it's a lot of boilerplate code.
well i made my own
well this site sucks ... no way to find everything at the same time
and what for is spigot-1.17.1-R0.1-SNAPSHOT-remapped-obf
Could I use it?
?schedular
at least it is not abandoned
how do i do the thing
?scheduling
thx
?help
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
idk i dont think you can, because its tied into so many thing from my framework
you would bassically require the entire thing
sucks
Ah I see. I'll pass then.
its not hard to make though
another common spigot library
Yea, i'll probably just make my own.
yea
the only advantage of spigot conversation api was message blocking from other sources
doesn't that require packets
could someone explain this to me please?
this is basically java but modify to spigot usage ^^
also the title says what it does
ye
i don't understand, sorry
get an understanding
what's that mean
?learnjava
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.
?englishforbeginners
not helpful
ok
if you wanna be toxic, just don't help, thanks
we get it, but its really annoying when people come here and dont understand the most basic things about java
this is how i learn
you do you
not everyone can learn like that
Is it better to use one timed scheduled runnable to loop over all players or create a new one for each player?
respect us as well
Let's say you want to schedule a task to run 30 seconds later which broadcasts a message:
BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskLater(plugin, () -> {
Bukkit.broadcastMessage("Mooooo!");
},20L * 30L);
this code will run after 30s since 20 ticks times 30 is 30s
use one
one
thanks
scheduler.runTaskTimer(plugin, () -> {
Bukkit.broadcastMessage("Mooooo!");
},20L * 30L,20L*60L);```
This will run after 30s the first time and then every 60s
maybe swap 60 with 1 ?
idk how this works
and 20L*30L to 0 to run it instant
writing texts or what works ?
like do you need no space for the repeating and with space for the runtasklater?
how does it identify what i mean
java: setPassenger(org.bukkit.entity.Entity) in org.bukkit.entity.Entity has been deprecated
any fix for this
it just warning me
addPassenger
multiple passengers are available now
ok can someone else help
i just need one like only the player
what is the problem ?
there is a clear different ? ... if you want to run it later you just use schedule.runTaskLater
and if you want to run it again and again you use scheduler.runTaskTimer
also its on 1.17.1
- that's not what i asked
- you're bein more mean than helpful
you asked that ?
look i just really don't want to argue right now, i'm only looking for friendly help for this simple timer
of course i get mean ^^ you just dont read what the page tells you about how to use it
i read it and didn't understand, that's why i asked
can someone else help? warnning: please only help if you're patient, it takes some time for me to understand things
what part you didnt understand
im still confused where to add it
how it knows which one is the delay on first run and delay between each run
use it instead of setPassenger?
why should we adapt to you?
?learnjava
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.
this is a help channel
if you want to really be helpful, you might want to be understanding
?jd
Read the scheduler page over and over until you understand it. Its a very good tutorial and tells you everything you need to know
thank you for being understanding, however, i don't think i'll be able to understand it without further explination
Not enough?
the argument order
There really is nothing more to explain. It covers everything
do i have to have a delay for the first run?
no
0 delay means it attempts to run next tick
so if i want to transfer people to hypixel for exemple?
so 0L * 0L, 20L * 1 for every second with no first run delay?
Yup
You canβt
The target server has to be open to connections from your bungee
ok, thanks - new question: how do i use this in general? as in just doing this like how you run a method
but if the server target is bungee i can right
No
then what
i want it to always run
Hypixel doesnβt expose any of their actual Minecraft servers
also the fucking method-(arg-)names tell you what is delaying and repeating and so on
Only their bungees
someone know how can i force player to refresh tab?
it's just an exemple i wont do that
You canβt
but if my server is bungee and the other one is too i can?
in this case my friends server
Playtime Timer in Bossbar
cause the problem i had with bungee is that i had to enable ip forwarding to be able to join my server directly and i didn't have the config file
i still don't
Lazy to even help someone who donβt want to learn how to read but want to make a book
You have to enable IP forwarding in the spigot config
it says that it's in bungees config file
There might be a config value in the bungee config too, I canβt remember
and i didn't find this option in spigot
But you need to turn bungeecord on in the spigot config
Itβs βbungeecord: falseβ to βbungeecord: trueβ
how can i change paper to bungee then?
Paper is a fork of spigot, it also has a spigot config
Just like spigot has a bukkit config
if anyone can join my thread and help me in there, that would be great, thank you!
Anyone knows why eclipse doesn't let me import JavaPlugin (spigot 1.18)?
I tried switching to intellij and there it works but for some reason intellij doesn't detect errors
i found somewhere that my server needs to be in the same network as the other server
Nope
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
thats recommended but not necessary
so if i change my server to bungee i could be able to enable ip-forwarding right?
i enabled bungee many times and i could join my server from the other server only
i'll send you the error
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
ty
Yeah once bungeecord is on you canβt join the server without bungeecord @storm chasm
oka
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ EnderRider ---
do i need to worry abt this
Hi what do I do about this?
it shows error
update your java version
Compile for Java 8 or switch your server to Java 16
is there a link to download one?
Itβs the spigot, he has to update his Java
?java16
Install Java 16 at https://adoptopenjdk.net/?variant=openjdk16&jvmVariant=hotspot
?java17
Install Java 17 at https://adoptium.net/?variant=openjdk17&jvmVariant=hotspot
which is better?
so how to change it to bungee?
I told you, spigot config
just bungeecord: ?
bungeecord: true
but i said i need ip forwarding as well
Thatβs in the bungeecord config
In the BungeeCord config.yml file, ensure that ip_forward: is set to true
and that's the main problem
i don't have it
Have you created a bungee server yet?
never
can anyone join my thread and help me there?
You have to make a bungee server first
paper spigot or just vanilla but i have no experience with a real bungee server
Is there a place where the the nms remapped packets are listed compared to their original counterparts?
You need to have a bungee server and Minecraft servers
You need both
The bungee runs separately
and sorry but how to make one?
i can't make my server bungee directly?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
No, bungee is a proxy that connects users to different Minecraft servers
Say you have two Minecraft servers, A and C
And you have a bungee B
The player connects to B, and then B connects to A or C depending on what the player wants
And B can switch between A or C at any time
But the player is always connected to B
more accurately...
Player connect to Bungee and is directed to whatever server you define as the lobby.
They want to use forced hosts so people can choose where they end up iirc
for me it's a to c or c to a
sorry
Bungee can;t allow direct connections to a specific server, safely
you need to always connect to the lobby, then get sent from there
Forced hosts are absolutely a thing
Not sure what youβre talking about
It just requires a different connection domain
It allows you to bypass the default server
this is not for me
there is no lobby
see it's always what people want
I'd not seen the forced hosts option
Itβs a neat little trick
the thing i want is transfering players from a to c
which packet is reponsible for that?
But yes, using it you can send a player directly to a server based upon their connection
the slime jumping
You need a bungee for that
but alex said it's possible isn't it
with bungee yes
i just didn't know that bungee can do that
Thatβs pretty much all it does
Is there a way to compate spigot maping packetnames
with mojang ones
got bit stuck
not sure what names are what
xd
@brave sparrowbut i use a panel so is the wiki for that too or?
Youβll probably have to rent it from your server host
https://timcloud.ddns.net/mapping/
wait until website is loaded and search the classname your looking for at top left search bar
How can I use this in 1.18?
net.minecraft.world.item.ItemStack
I get the error: Method not found
so confused
not able to find PacketPlayOutSpawnEntityLiving
did you wait for site loading finished ?
ClientboundAddEntityPacket
because i found it instant ... https://timcloud.ddns.net/mapping/1.18.1/classes/net.minecraft.network.protocol.game.ClientboundAddMobPacket/
oh thanks
so I just needed to put PacketPlayOutSpawnEntityLiving in search bar
in left top corner
enter ?
so I need packet
name to
ok it works
from some reason didn't work before
I was presing enter
oh that is yours?
yes... needed something where i know how it works and also includes everything ^^
Chicken spawned
I made it
I can die in peace now π
What would be best option to send mob packets to players in radious
just loop on scheduled
nmsworld.broadcast or smth is also a thing
but dont know if its for the complete world or just in a range
smth?
well plan is to make armor stand as passenger
on player
to use it as additional slot for backpack item which has custom model in resource pack
I tried with noramll api
Spigot/Bukkit
but there is so many problems like mob fallign of
or not been able to teleport
wrong channel
this is development
OKAY SORRY
no need for apologies π
π€£
Because your list is edited when u iterate thru it
probably
try make clone
then do it
Not sure 100%
in what I am saying
show us more. the exception, the full code. everything
new YourListImpl<>(yourListBefore);
& when does it throw the exception? probably someone closed the inventory or left the game while iterating through
/
/
do someone knows?
what
smh when i try to find something i sent earlier in this channel
can i get player name of all Offlineplayer?
i try like this but not work or can't get offlineplayer name?
OfflinePlayer#getName
BannerMeta#getBaseColor() is deprecated, how to use DyeColor# with Banners?
I imagine you would add a Pattern with the PatternType set to BASE.
so got question trying to get passenger on top of my head with packets
code
public static void test(Player p ){
CraftPlayer cPlayer = (CraftPlayer) p;
ServerPlayer sPlayer = cPlayer.getHandle();
ServerLevel world = ((CraftWorld) Bukkit.getServer().getWorlds().get(0)).getHandle();
ArmorStand armorStand = new ArmorStand(EntityType.ARMOR_STAND,world);
armorStand.setPos(p.getLocation().getX(), p.getLocation().getY(), p.getLocation().getZ());
sPlayer.connection.send(new ClientboundAddMobPacket(armorStand));
sPlayer.connection.send(new ClientboundSetPassengersPacket(armorStand));
}```
but passenger-armorstand only getsspawned on my location
@ivory sleet your name said u can be pinged xd
I think you're misunderstanding what ClientboundSetPassengersPacket does.
You have to set the passengers yourself.
?
how
I want it to be only packet
so client side
I was thinking that is the point of this packet
PacketPlayOutMount
You still have to set the passengers yourself, it looks like the Entity that's passed is the Vehicle (so, that's your player), and you should set the armorstand as a passenger.
and how should that be done ?
I am confused
like if I do sPlayer.setPassenger(armorstand) will that not add it in real time ?
server side to
You want to set the variable directly to avoid the server sending everyone the packets.
sPlayer.passengers = ImmutableList.of(armorStand);
That, of course, will break if they have more than one passenger though.
So if you need multiple passengers on the player you'll need to account for that.
wait so this will not crate real armorstand entity on server
?
It shouldn't
intresting
and now I can grab that
armor stand
from that list when I need it
and modify it
I still got a problem I can't teleport with armorstand
Well, does it set it as a passenger?
So the value is null but shouldn't it like just skip it then here
if (list.get(i) == null)
or just go inside the list and not end the plugin
It's going to go inside the if block if get returns null.
?paste the rest of the code
You might have to re-send the packets when you teleport.
Oh that's a different issue then, what are you doing?
like p.teleport wont work
so I got passenger which is armorstand
so I can applay
back pack custom model on it
What is it doing
Does it matter?
Yes...?
I mean what is it doing that you're not expecting it to do
return null? return top?
Throw an error?
It throws an error here if (list.get(i) == null)
IndexOutOfBounds?
Probably because you're using the length of slots and then accessing list and slots is larger than list :p
Right yeah but you're saying p.teleport does nothing?
Send your teleport code
well I am talking about essentialsX teleport comamnds like tps and spawn
not working
plus I tried to telport player my self
nothing happens
with p.teleport
Any errors?
no
wat 
I am lookin at CraftPlayer
teleport method
@hasty prawn I think this is problem
Yeah that'll do it
dismount the passenger and teleport it gg?
Anyone have a tutorial for Adventure?
well how
I find their docs insanely bad
idk, but you can't teleport entities while they have passengers so the workaround is to dismount their passengers, teleport both, and remount them
iirc
I can be your personal guide
lol
looks there would be nice to PreTeleportEvent in API
what u tryna do'
in future
Atm trying to use minimessage to convert a string with colors into text in chat
PlayerTeleportEvent
well I am saying we need PrePlayerTeleportEvent
That is pre
You need to send the component not a string of it
^
My problem is I have no idea how to do that
or use sth like LegacyComponentSerializer
and cant find anything about it
Hm?
Take a look at the audience docs
Alright
another thing
I don't even need to send packet
//sPlayer.connection.send(new ClientboundSetPassengersPacket(armorStand));
well it is not if u add it to sPlayer.passengers = ImmutableList.of(armorStand);
you have to set the passengers for that packet though
well I did that
but it work without it
It might just be because of the AddMobPacket
How would someone send a look packet to a specific yaw and pitch instead of coordinates? (Using 1.17.1 remapped-mojang)
im starting with scoreboards and i would like to insert a new line to an existing scoreboard
how could i do that?
@quaint mantle calculate the yaw and pitch given the coordinates
But say I don't have coordinates and instead want the bot to look in a general direction
for example, simply spawning into existence
if you simply want it to spawn into existence then you don't need to send a specific yaw and pitch
okay, how about aiming a bow then?
private File presentDataFile = null;
private YamlConfiguration presentDataConfig = null;
public YamlConfiguration getPresentDataFile() {
if (presentDataConfig == null) {
reloadPresentData();
}
return presentDataConfig;
}
public void savePresentData() {
if (presentDataFile == null || presentDataConfig == null) {
return;
}
try {
getPresentDataFile().save(presentDataFile);
} catch (IOException e) {
plugin.getLogger().log(Level.SEVERE, "Could not save presentdata.yml", e);
}
}
public void reloadPresentData() {
if (presentDataFile == null) {
presentDataFile = new File(plugin.getDataFolder(), "presentdata.yml");
}
presentDataConfig = YamlConfiguration.loadConfiguration(presentDataFile);
Reader defConfigStream = new InputStreamReader(plugin.getResource("presentdata.yml"), StandardCharsets.UTF_8);
if (defConfigStream != null) {
YamlConfiguration defPresentData = YamlConfiguration.loadConfiguration(defConfigStream);
presentDataConfig.setDefaults(defPresentData);
}
}
public void saveDefaultPresentData() {
if (presentDataFile == null) {
presentDataFile = new File(plugin.getDataFolder(), "presentdata.yml");
}
if (!presentDataFile.exists()) {
plugin.saveResource("presentdata.yml", false);
}
}
Tried making a custom yml, but for some reason it doesn't work.
What I did: I deleted the file in the plugin folder then reloaded using reloadPresentData(), but it doesn't do anything.
Hey I'm looking for a Minecraft Practice/HCF/Kits Developer anyone interested.
Wrong channel
wghat channel;
Did you save default config on enable?
This isn't a server for ads, go to the spigot forums
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
yes
some way to avoid this? TeleportCause.PLUGIN doesn't work
thats normal
im trying to follow https://www.spigotmc.org/wiki/making-scoreboard-with-teams-no-flicker/ to create a scoreboard that will display the last actions in my game
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
the actions are stored in a List<Pair<Player, Action>>
and they can repeat
and the scoreboard isnt displaying duplicated actions
i would need help with that
well, im teleporting player too often and i need to avoid it because it will be ultra spam, when there will be more players
well idk
i remember a config (yml) for reduce the warns for this
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ShapedRecipe.html
How am I suppose to set ingeridient?
setIngredient ?
yeah but it requires a recipechoice?
RecipeChoice, Material OR MaterialData
ExactRecipeChoice
nvmd its just ExactChoice
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/inventory/RecipeChoice.ExactChoice.html
implements RecipeChoice
Just as hint π
okay well
uh
how do I do that for shapeless?
it says exactchoice is only valid for shaped recipes
imma just hope it works
im trying to see if there is a way to see what item was used to attack the damaged with the EntityDamageByEntityEvent, i tried looking at the docs but couldnt find anything/understand it lol https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDamageByEntityEvent.html
declaration: package: org.bukkit.event.entity, class: EntityDamageByEntityEvent
help me please
can you help me to update a server for 1.18?
im still on 1.8-1.17.1
uhmm first of all wrong channel #help-server second of all, just follow the buildtools guide and replace the server.jar
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
@ivory sleet could you please take a look if you have time
Use getDamager then check the item in the main hand
well you need to get the damager-entity
oh.. just do what Olivo said
ahh thx
is there a way loading worlds from a custom directory?
not seeing anyway to convert the mainhand into a item?
tf why u want to convert mainhand into a item?
You want an ItemStack not the Item entity
Also don't cast if you don't know what you're doing
this is definetly not the way getting the item of the mainhand
^
ik what im talking about, I've done already enough shit with Java XD
if you want to have an entity item of the mainhand just create an entity item and set its itemstack to the itemstack of the mainhand
there ya go https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/inventory/EntityEquipment.html#getItemInMainHand()
declaration: package: org.bukkit.inventory, interface: EntityEquipment
ahhh, yes a item stack then
ohh, how would i get the mainhand itemstack from that?
Hello, can you help me with dynmap 1.18?? I did /wb fill.. then i did dynmap fullrender and my 3D map do this (picture: https://ctrlv.sk/DJS8).. what can i do? Thanks for your help :)
think that belongs in #help-server
and btw i think that is how it should look
cause tilted view
or im missing something
ahh wait you didnt make that hole yourslef lol
hmm
This allready returns an ItemStack
followed that one but now getting this error lol
Isn't it damager.getInventory()
Of what type is damager
player
I think this is the time to teach documentation reading
then get his PlayerInventory and call getItemInMainHand() from that
AHH FUCK
....
Player#getInventory()
PlayerInventory#getItemInMainHand()
that always tends to be my problem lol
someone can answer this btw?
The world directory has to be in the same directory as your server jar
so either copy the dir or create a symlink
sadge, so I can only load them either from the root directory or from world/?
If you use the API then yes
if i have a itemstack and give it to a player can i later check if the item came from that itemstack?
You can mark the ItemStack using its PersistentDataContainer.
you can only load worlds from the universe folder
which by default is the root directory
Does this mean you can change it?
yes, but all worlds have to be in the universe
yeah ok that would be too much of not worth time
hmm can you add a custom nbt tag to a itemstack?
like splyfofsamazingcustomnbttag
That's what the PDC is for
Thankfully it's well documented
?pdc
i now realise why not more people try to make item creater thingy
Why? There are a ton of item builders out there. Its not that difficult. Just a bit labour intensive
Because of fireworks, potions, lore editing etc
i think im kinda regarding doing that as a almost first java project lol
Oh... Spigot is a horrible place to learn Java tbf.
There are a lot of concepts which are not exactly beginner friendly.
ik lol, but atleast i can somewhat see the results of the code in minecrafty ways
anything that has to do with coding for MC is a horrible place to learn Java alone bc of MCs code
Forge is worse
good, so i have not fucked up completely
Spong ><
Spigot is child's play compared to forge
not sure if that should make me happy or scared
With forge you need to know way more things about java. Generics, suppliers, general abstraction etc. The errors are also way more difficult to decipher
By the end of it you'll come out fully understanding java or hate programming for life
well i already hate programming so it cant be much worse lol
Hating programming for life is an inevitable outcome if you are a programmer
https://paste.md-5.net/faloxaroxa.cs
How does it not find Player in this error?
This is the function
looks like you are implementing the wrong player
net.minecraft.world.entity.player.Player is what something in your code is calling for
Look at the err
yea, well
found it
nvm, I have nothing calling for that now
still throwing that error
Run mvn clean
where it says 21 more, can I actually read that?
Never used the stacktrace before, it only says, the line 22 thing in my code, all of the other things are in the spigot or nms code
?stacktrace
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Well, the thing is that in the stacktrace, nothing is from my code
send it
^
Yes, but that is only a calling to another class
so?
JungleTribeDruid druid = new JungleTribeDruid(plugin);
How can there be a player error in there if it is just calling
It doesn't go more in-depth on the class that I am calling here
Can you send that entire class?
thats what the error is calling out
You've run a mvn clean and restarted the server or did you reload it?
Interesting
Cause honestly I have no idea
Everything looks like it should be fine?
Yes, that is my thing, I'm baffled
You're not remapping properly.
The server doesn't have a net.minecraft.world.entity.player.Player, thats for Mojang Maps. It wants net.minecraft.world.entity.player.EntityHuman
I don't have anything like that in my code though
Do you think you could DM me your JAR file?
It works now, but it is throwing a similar error
Oh? 
mvn clean did the magic I guess
and maybe bcs the pc is lagging terribly because I have 3 mc clients running and a server with 2G RAM while watching yt vid and 20 tabs or so
yeah it did
remember me to say something later
kits:
kit1:
items: [ItemStack, ItemStack]
kit2:
items: [ItemStackm, ItemStack, ItemStack]
Does anyone have a suggestion on how to get this into Map<String, List<ItemStack>>?
?
nah you're good
Doubt it
some rips