#help-archived
1 messages · Page 171 of 1
Sets aren’t guaranteed to iterate in any particular order
^^ which is why you convert it to a list first
Then what’s the point in having a set to begin with
Now you’re making an extra copy in memory for no reason
sets are no-duplicates
Well yes
Ok so guys what is a good rtp plugin for 1.16.1?
that gives them a lot of uses
But you could just as easily implement that with a sorted list
If you know it’s going to be sorted
And then you’re not using 2x the memory
that's one idea too. i don't think they considered it much, but creating a small copy is no big deal since it gets deleted
don't forget that multithreading and immutability follow the very same core principle
@frigid ember pretty sure any rtp plugin should work just fine in 1.16 just like other versions
my bad, meant lightweight not small
so confused
Alex don't forget that you'd sacrifice the O(1) performance of a hashset if you were to use sortedsets
That’s a Map @frigid ember
hmmm...
I never suggested using a sorted set lol
I said sorted list
oh my bad, you said list
Lmao
sorry just woke up haha
No problem lmao
https://gyazo.com/21f22619fbadcd790304372f2f2675d8 how would i do this then?
Do you need to return it as a Set
redundant toString() calls too, UUID#equals is just fine
hey, I'm trying to implement a 2v2 manhunt plugin - kinda similar to Dream's thing but with 2 teams of 2 (all players with compasses). I'm using player.setCompassTarget(enemy.getLocation()) to set the compass target. but for some reason, the compass just... doesn't work! I can't decipher what it's pointing at. one thing I've noticed is that if the person it's tracking turns in place, and I'm not moving, my compass that's supposedly tracking them moves as they're turning in place. does anyone know what might be causing this?
not entirely @nimble stump
@tropic shadow setCompassTarget just sends a packet to set the bed location
might have something that conflicts with your bed locations?
so i wouldnt even need to sort it?
@strange forge nobody's tried placing a bed while testing - we're just loading a fresh world and setting teams
@frigid ember judging by your previous question he assumed you return a Set then you want to sort it
i think i can do a list shouldnt be so hard
just make me change the whole way of my menu
just toList() instead of toSet()
yes
As long as your data storage returns it in the order you want it in
That will be fine
@tropic shadow similarly, /spawnpoints etc?
@strange forge haven't touched that either
hmm no idea really
@tropic shadow how often are you updating the compass location
teleport to player#getCompassTarget() to see where it actually sets though
@nimble stump well I've tried both just right clicking and then having everyone stand still while the tracked player turns, and constantly right clicking (right clicking sets the compass target). the thing that's confusing me is that when the tracked player turns, my compass updates. like my compass is tracking the way they're facing?? it's bizarre.
@strange forge: I've been logging the locations it's setting to the spigot console and they're correct
strange, might be some bug server side. what version?
1.15.2
i don't know where you're setting it but
try to delay it by 1 tick
Bukkit.getScheduler().runTaskLater(plugin, () -> setCompassTarget(...), 1);
@strange forge trying that now. what's your hunch as to why that might work?
for people.showPlayer() if its not in my main class what would i put for plugin?
people.showPlayer(this, player);
im doing this but not in my main class and its not working
An instance of your main class
@tropic shadow generally many "bugs" happen when you run lots of tasks that involve packets on the same tick, for example joining then instantly updating game mode
so by delaying with 1 tick it's like running when all higher priority stuff have finished, most of the time it patches these weird things
@strange forge interesting. will get back to you in a sec
@strange forge that didn't do it. want me to upload the source to GH? I feel like it's something else that's the culprit
just upload the class where you set the compass target to pastebin or smth
@strange forge 🤷♂️ I'd been meaning to make a repo anyways. here ya go https://github.com/mpcsh/HuntHunt/blob/main/src/main/java/mpcsh/hunthunt/HuntHunt.java
@strange forge line 140 is where I set the location
it's a play on manhunt, bc we have two teams 😉
you aren't delaying by 1 tick
Hunt hunt hunt hunt hunt hunt hunt hunt CARIBOUUUUU
@strange forge oh yeah I took that out after trying it, it didn't change the behavior
well add it back 😉
hmm not quite sure, i used setcompasstarget before and didn't have issues
So i am trying to delete plugins from the rtp and when i restart the server they show up again (FireZilla)
@tropic shadow why are you not using primitives for size lol
you know that int can be put in a hashmap to replace integer
@buoyant path 🤷♂️ it literally doesn't matter
he does nullability checks for Integer
It doesn't but for good practice
also that
how is the size of a hashmap gonna be null lol
only way would be if the actual hashmap is null
it's not the size of the hashmap, it's whether there's something stored in that slot or not
lines 129-132
could just use containsKey but alright man lol
Integers are autoboxed to ints
also I recommend the early returns to you
guys I do not care about this, I didn't come here for a code review, I just want to see if someone knows what's up with the compasses not pointing anywhere logical
I have faced problems with compasses as well
maybe its worth sending a packet instead?
So i am trying to delete plugins from the rtp and when i restart the server they show up again (FireZilla)
Please help me not go insane
the spigot API seems to have problems with compasses
@buoyant path wym send a packet?
send a packet to show the compass dir
send a packet... from what to what?
Try setting the compass target more often
the confusing thing is I'm basing this off Dream's manhunt plugin, where he does the exact same thing, and it works just fine in the videos
@nimble stump I've tried that manually just by constantly right clicking
how do you know that Dream does that? He only has one video of him coding lol
and its some shitty mob equipment thing lol
he has code published on patreon
oh
Try running his code
See if you get the same result
If you do, it’s a client/server issue
Yeah he did
was it correct
yep, it's correct
I genuinely think it’s the client not accepting it
in that case its 99% a clientside thing
In which case you’re kinda fucked
Spigot should already be sending the packet
the really confusing thing is that it appears to be affected by the direction the tracked player is facing. if everyone stands still, and the tracked player just spins in place, the compass moves
Ive faced that issue before
Well that doesn’t seem right
I wanted to make the compass point straight up
but it would move
when nothing was happening
hmm
I have downloaded the latest build from https://ci.md-5.net/job/BungeeCord, but i don't have 1.16.x support
No i can't
And you downloaded build #1524?
Yep
What does it say on your client
Well that would do it
👍
How would I prevent mobs from spawning in a specific chunk with spigot?
I'm guessing through the EntitySpawnEvent
should've googled first, my bad
🙂
where do you find the latest spigot file
Is there an easy way of checking if an entity is hostile?
Or do I have to check if it is each of the hostile mobs individually?
checking if it is an animal would also work
nvm
dan maybe try checking if its an instanceof Monster?
although i think neutral mobs like pigmen are still counted as hostile even when theyre not angry
might wanna check that
how do you update spigot
?bt
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
that ^
but same command for linux
Be aware that ghasts are not Monsters @rotund orbit
i think so
So you’ll need to check them separately
im not sure, i dont use linux
im only using linux cuz i have a spare trash pc so i am using linux
it should be the same
ill just see if that commnad works
ty for help
That will work on Linux
ghost ping
that was me - automod removed it for tagging you, alex, and iron man
lots of investigation
ghost ping?
its pretty annoying
- the compasses are def tied to the direction the tracked player is facing I have no idea why or how still.
- I tried Dream's JAR and it was busted too, same exact issue.
aren't these compasses tho
- so, I thought it might be the client version. I tried both JARs on spigot 1.14.4, since Dream's plugin.yml specifies 1.14 as the API version. still busted
Seems like a client thing then
ah
like if I'm holding the compass and the player it's tracking turns in place, the compass turns
Like it’s using the pitch of the location for the compass
but it shouldn't move because they're not moving, only turning
Instead of the actual location
@nimble stump I also tried manually setting the pitch and yaw to 0 before setting the target, that didn't do anything
Did they still turn?
yep
That’s fuckin bonkers
Well it seems like the client is doing something fucky
Do you have any other plugins?
wait, do you mean the server? there are no other plugins on the server
everyone's clients are completely vanilla
That’s very odd
I’m tempted to boot up my debug client and see if we can’t figure it out honestly
want to hop in a voice channel?
I can’t VC right now, it’s quite late, but I can hop on in a few minutes
What version is the server
So I can launch the right build
1.14.4 currently
Ok
what's your username so I can whitelist
Same as here
👍 I'll DM you the hostname
random question but how much ram is recommended to run a server with about 10 kids
so hi
is there any plugin that can control my player number on bungeecord
like if i want only 1000 players on my network can i dont let player join the server if the network already got 1000 players
Hey! I am trying to launch my server with 6g of ram allocated. I have a batch file set up like this: (cd /d F:\SMP\MC
java -Xms6G -Xmx6G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=50 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AggressiveOpts -jar spigot.jar) I found this script of a forum post. but I get an error like this unable to access jarfile spigot.jar. I've already changed directories and I am lost
well simply the script doesn't have access to the file names 'spigot.jar'
You CD is probably wrong?
im 100% its not looking at the folder rn
F:\SMP\MC
I tried running it elevated too
Hey,
Does anyone know how I can use the rgb support in my plugin?
I know how it is done via tellraw, but I really don't want to use that for obvious reasons ^^
Does anyone know how people do food spoilage plugins? How do they keep track of information for every single item?
especially when they're in a stack
NBTTags most likely
hello anyone know
a simple-info plugin
like you can type /discord
a info plugin that allows you change commands and is not harded to the command slisted on config file
pls tell tnx
Does anyone know how people do food spoilage plugins? How do they keep track of information for every single item?
@rotund orbit yeah there's a nbt api that can just store stuff in there. Tho items with different nbt info won't stack.
ah so people couldn't have stacks of bread anymore?
if they were different ages
makes sense
thanks guys
I'll look into it
Is anyone familiar with the ghost items bug and do you know how to fix it? I'm thinking I need to completely reset a players data but I'm not sure how you do it
Nvm found it
uhh im really confused. whenever i do java -Xms512M -Xmx1008M -jar /home/pi/minecraft/spigot-1.1.16.jar nogui it just comes with unable to access jarfile
Does that file exist?
Hey, I have an issue where when I hit multiple entities at the same time, while the EntityDamageByEntityEvent is called for each entity, but I'm only able to retrieve the e.getDamager() of the first entity hit
@EventHandler
public void onEntityDamage(EntityDamageByEntityEvent e)
{
boolean nullifyDamage = false;
Bukkit.broadcastMessage("OnEntityDamage called");
if (cooldownTimeMeleeAA.containsKey(e.getDamager().getUniqueId()))
{
nullifyDamage = true;
return;
}
if (e.getEntity().isCustomNameVisible() && e.getEntity().hasMetadata("id"))
{
Bukkit.broadcastMessage("Damager: " + e.getDamager());
if (e.getDamager() instanceof Player)
{
Bukkit.broadcastMessage("Damager detected as instance of Player");
PlayerData playerData = null;
of course it works in the tutorial, would you publish a tutorial which doesn't work? 🤣
but ive done everything right
Can't send an image, but the logs are something like
Damaging [entity]
OnEntityDamageCalled
Damager: Player
Damager detected as Instance of Player
Calculating damage of ...
....
...
Damaging [anotherEntity]
onEntityDamage called
Damaging [anotherEntity]
onEntityDamage called
Damaging [anotherEntity]
onEntityDamage called
Damaging [anotherEntity]
onEntityDamage called
There's no exception or anything either
i did 1.16.1
im using the PlayerBucketEmptyEvent
and how can I get the location of the where the bucket is placed
Location blocation = e.getBlockClicked().getLocation().add(0, 1, 0);
Hi, is this the best plugin for prevent/fix exploits? https://www.spigotmc.org/resources/dupe-fixes-illegal-stack-remover.44411/
Is this one alone enough? Thank you!
did this but when they click on a block's side it spawns one above
not at the side
wait i'll if (e.getBlockFace() == ) do it like this
@frigid ember https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerBucketEvent.html#getBlockClicked()
declaration: package: org.bukkit.event.player, class: PlayerBucketEvent
why not using getBlockClicked??
oh ok, you can then use getBlockClicked().getRelative(event.getBlockFace())
and that'll be the location of where the water will be?
oh you want the water
exactly :/
I'm not sure, but it should be that but with opposite face
you can try tell me if it works
getBlockClicked().getRelative(event.getBlockFace().getOppositeFace())
sure
Location blockloc = e.getBlockClicked().getRelative(e.getBlockFace().getOppositeFace());
its a Block
not location :/
my hash is saving Location, Long
the one you're using for the server
my devices ip or the devices ipv4 adrdess or my public
the public ipv4
no
that's definetively not a public IPv4
that's a private network address
are you on Windows?
What's the event for a smithing table being used?
Don't think there is one
😭
There's one for recipe prep in a smithing table iirc, but not one for actually crafting
Logical for me to suggest it on the Jira?
Just comment on there for a smith event as well?
💜
Is it not possible to add items to a chest itemstack?
Before its placed?
yes
Hi, I can't access the site - tried it from 2 different devices with 2 different WiFis and my phone, still nothing (I get error 524)
Anyone knows what I can do? 😕
If you see Error 524 on your web browser, try refreshing the page. You can also close the browser and reload it to see if that does the trick. Sometimes, a simple restart can fix the issue, especially if it is just a minor glitch.
looks like I can use Container from BlockState, I'll try it out and get back
Restarted all devices multiple times, cleared and flushed DNS - still nothing
how long has this been occuring?
Asked a friend and he said he got in, so I'm guessing it's a problem with me, but on 2 devices and 3 internet connections?
Started a few hours ago
Yesterday worked fine
can you access other sites?
Yup
Ok, so it's definitely a problem with me - can't access dev.bukkit.org either...
This is SO weird...
@torn robin There are two ways of adding items to a chest Itemstack.
- Add the proper NBT data like minecraft does in creative.
- Use the PersistentDataContainer of the item and check the BlockPlaceEvent yourself, then read from the container and add the Items.
Im not sure if the NBT data gets used in the first method if the player placing it is in survival mode.
looks like I can use Container from BlockState, I'll try it out and get back
is that what I would use?
Can access duckduckgo
It doesn't give any error, it just fails to load for a long time then the browser just stops trying
I also tried different browsers but nothing..
Thx anyway!
BlockState, but yeah
8.8.8.8 is my favorite
you could also try 1.1.1.1
hey
?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.
https://prnt.sc/tfv5sz but how this join leave msg ?
its rank so ?
https://prnt.sc/tfv7g8 look see its rank member or giant or vip or owner so how ?
try pinging anything in the cmd
The weird thing is it works just fine
8.8.8.8 is my favorite
I tried a few different DNS options but still zip
Pings work just fine - no packets lost
Still won't load 🙃
I think my laptop and phone have ghosts in their blood
Time for an electrical exorcism and some hardware heroin
one of my staff members grief'ed my server, but i knew i had a backup that i took off shockbyte, and when i put the world folder in, deleted the old one thats grief'ed and started the server then imported the world with multiverse, the world was a empty space void
is there something else than the world folder i need to replace
i really need help, someone pls
I'm looking for a plugin that can give items "lives". e.x. After you die enough times it get removed and you can not get it back, similar to Hypixel The Pit weapons. There are no plugins like this however, can anyone make a plugin like this? Sorry if I shouldn't be posting this here btw
is there a way to use a domain to access your server instead of using an ip address while not on your wifi, just ping me
@devout crest That would not be hard to make
I’ll consider making that plugin because it sounds pretty fun
Hi, I googled for this but surprisingly couldn't find it, what is the default minecraft permission for breaking blocks, something like minecraft.blocks.break or so?
I mean there are for the commands
Uh
You obviously fucked up with a plugin if non-ops can’t break blocks
Is it only around spawn?
No it's just the default of the server
No, that’s not a default. What plugins do you have.
Is it only around spawn?
@winged sparrow Perhaps, haven't tried that
No, that’s not a default. What plugins do you have.
@winged sparrow Just spigot, luckperms, multiverse and my own, but it also happened without spigot, I think it's the default of the server
Server protects an area around spawn for non-ops
If it’s just around spawn, go to server.properties and set spawn protection to 0
@winged sparrow thanks
If it’s happening globally it’s an issue with a plugin set up
If it’s just around spawn, go to server.properties and set spawn protection to 0
@winged sparrow Yikes, I just found that on google, thanks a lot, I must have been way to tunnel-visioned on permissions, I'll try it out!
Also, be sure to shut down your server completely before modifying server.properties
It doesn’t work with reloads
Np, hope that fixes your issue
is there a way to use a domain to access your server instead of using an ip address while not on your wifi
Is it a better Idea having a server generating a custom world to then copy paste it to the game server, or to generate the world before launching the game?
well you want a random or specific world
Random generated world
With a customworldgenerator
And if possible a pregenerated world
then i would say generating a new world should be better
pregenerated? why
if i get it right, you want a random world... so you dont really need to pre-generate anything
Cause this game should handle about 150 players. Imagine generating the world while they're all playing
When you first go on a never visited chunk, this chunk is generated
i actually dont prefer multi-worlds on one server, i actually have every world on a extra bungeecord server. because of exactly this
Yeah but I'm not talking about multi world. My game has one world. This is a random generated world with a custom generator (ChunkGenerator) and the size of the game area is about 35 * 35 chunks (can be higher)
Each new game a new map should be generated
kick the players, and then create the world? should make it i think
Yes, the problem isn't there, but where the world generates
It costs a lot of CPU usage
taht's normal everywhere. You have to do some huge maths to generate a chunk
each block is calculated, each height, each biome, each decorations etc
then... idk
Okay thanks anyway
whats so bad on the usage?
35sq chunks isn't very large
when no players are online
Generating it off the server and uploading it is fine
should be more like 3ish min
If you have fast enough upload speed
Generating it off the server and uploading it is fine
@lone fog Thanks
have a server on the side just generate it then move the files over
Thanks yall that's what I wanted to know
one up shot to MC being so bad at using a multicore CPU is that you can do stuff like this on the same host and not even notice on your main "server" lol
actually i have a question as well... i am developing a plugin, and giving support etc in my dc. i am already using an update checker to tell the users on mc-server if theres a new update
is it possible to use this checker to send a message to a discord-Channel when an update is released?
I'm sure it's possible - but i'm sure they are asking more for an existing solution instead of a build your own 😛
well is there a plugin/bot out there? found only one, and that is closed because of waitings for any updates
Is there a /ping command plugin that works with 1.16.1? I checked some and none of them work.
hey guys,
since yesterday it not possible to connect to the server. i didnt changed anything, just restarted the whole server.. so anybody knows whats happend?
Bungee config:
https://pastebin.com/n46R5Rxg
You're using Pterodactyl right
it says
pong!
essentials "bunger" command that makes no sense, because other plugins can overwrite ping command
@sturdy oar Are you saying it's a built-in function? I don't understand.
no?
bruh
the default /ping command is not by essentials
I know that it's there, but others have it as well
yes
I'm about to try it, thanks!
if you want a numerical value for the ping you should use other plugins
Like what? You gotta suggest something because I have tried a bunch and none of them were compatible for some reason.
Because getPing was never added to the API :p
thats why use reflection
I mean I would think it should be a server function.
You're using Pterodactyl right
@sturdy oar yes
essentialsx just replies Pong! which is completely useless to me.
Anyway to possibly change it?
I found one finally. Tablist ping and it actually works so I'm good now.
I need help
Can someone try access my MC server? ill dm ip
smh fenditony dont u know about custom fonts
How would I set an entities velocity torwards a player?
smh fenditony dont u know about custom fonts
@zinc ingot ???
your response to putting images in the scoreboard with an rp
Lol, yes i didn't know about that, because it's a shitty solution
I have never seen anyone doing it
I want to set all spawned zombies to be named "Test Dummy" and have no AI but I don't know the method for setting no AI
just because you havent seen other people do it doesnt mean its bad...
Show me an image of someone that had done it, I can't find any
the only images scoreboards i know of are obtained with client mods
that's what im saying
featherboard cant
with a resource pack you can
or with mod
ill find some image\
you can't put an image as a character
can we see an example
yes busy atm
Download: https://www.minecraftmaps.com/puzzle-maps/shadow-runner-deluxe
PMC: https://www.planetminecraft.com/project/shadow-runner-deluxe-1-14-4/
NOTICE: In 1.1 level 7 is slightly altered to fix a skip, however the solution is more or less the same, except that the shadow mu...
very beginning is an image
I'll watch the vid
theres a lot of stuff that people don't actually utilize thats possible in minecraft
i dont see any scoreboard that is on the right side
That's a datapack
no, the image is from a resource pack
besides, anything possible with a datapack is possible with plugins
this is a great idea, but ive yet to see anyone actually use this
yeah that's a datapack + resourcepack?
🤔
the video i just posted is with a plugin
and resource pack
datapacks are really just simplified plugins...
yeah I'm aware you can have custom 3d models with new resource packs
i think this was added after 1.13
you can also replace characters with custom images up to 256x256 since 1.8...
Yeah but it's kinda a hack solution
and if you want interactive stuff a mod is just better
instead of creating a different image for each different option available
thats not really a hack solution...
with negative spaces you can create a fully customizable gui since you can position elements arbitrarily on the screen
stil...
besides, it's really not that big of an issue
the dude created an image for each option
yeah
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/persistence/PersistentDataHolder.html
Maybe persistentDataHolder doing this?
declaration: package: org.bukkit.persistence, interface: PersistentDataHolder
he didn't execute it in the most elegant manner
but it proves that it's possible
and the main appeal is that the clients only need the server resource pack
it describes
Note: remodeled ITEM, not block. Blocks cannot have a CustomModelData tag
that's completely different from what we're talking about
Y'all know how I'd stop other plugins printing their usage if my plugin overrides?
http://i.paulcodes.co.uk/i/h2xIuOSUd2.png
I donwloaded that map and i'm checking myself how they're doing it
@stoic shell An ArrayList cannot = -1
Anyone know what the problem is with the event listener here? ^
java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 2
at net.hypercubemc.TheBridge.bridge.spigot.listener.onDeath(listener.java:79) ~[?:?]
also include code
they replace character images in the font file with a custom bitmap image, then display the character as a title
getting code...
it's really common with vanilla adventure maps
Y'all know how I'd stop other plugins printing their usage if my plugin overrides?
http://i.paulcodes.co.uk/i/h2xIuOSUd2.png
you can do it by calling inPlayerCommandPreprocessEvent
onDeath, or onDamage?
can we see your code
bruh
onDeath is called when player/entity is dead
onDamage when an entity got damage from damager
yeah, sorry
@EventHandler(
priority = EventPriority.HIGHEST
)
void onDamageEntity(EntityDamageByEntityEvent event) {
if (event.getEntity() instanceof Player) {
Player player;
if (event.getDamager() instanceof Player) {
player = (Player)event.getEntity();
Player damager = (Player)event.getDamager();
if (this.main.playersInGames.containsKey(player.getName()) && this.main.playersInGames.containsKey(damager.getName())) {
event.setCancelled(this.DetectDamage(player, damager));
}
} else if (event.getDamager() instanceof Arrow) {
Arrow arrow = (Arrow)event.getDamager();
if (arrow.getShooter() instanceof Player) {
player = (Player)event.getEntity();
Player damager = (Player)arrow.getShooter();
if (this.main.playersInGames.containsKey(player.getName()) && this.main.playersInGames.containsKey(damager.getName())) {
event.setCancelled(this.DetectDamage(player, damager));
}
}
}
}
}```
@EventHandler(
priority = EventPriority.HIGHEST
)
void onDamage(EntityDamageEvent event) {
if (!this.main.saves.fallDamageEnabled && event.getEntity() instanceof Player) {
final Player player = (Player)event.getEntity();
if (this.main.playersInGames.containsKey(player.getName())) {
if (event.getCause().equals(DamageCause.FALL)) {
event.setCancelled(true);
return;
}
if (player.getHealth() - event.getFinalDamage() <= 0.0D) {
event.setCancelled(true);
this.onDeath(player);
player.setVelocity(new Vector(0, 0, 0));
Bukkit.getScheduler().scheduleSyncDelayedTask(this.main, new Runnable() {
public void run() {
player.setHealth(20.0D);
player.setVelocity(new Vector(0, 0, 0));
}
}, 2L);
}
}
}
}```
and what you want to reach with this?
Yes, and whats the problem with it?
.-.
@zinc ingot How do they send the scoreboard in the middle?
this seems more like a hologram to me
if you not describe your problem, we not reads your mind
title...
Well, this is what's wrong with it: https://hastebin.com/bohijopeqa.cs
Errors in console when a player gets hit.
Yea, what I sent before error, you can see that error is come from onDeath method
at net.hypercubemc.TheBridge.bridge.spigot.listener.onDeath(listener.java:79) ~[?:?]
if you disable the resource pack then you'd see
?paste
can you say what is the line 79 from your IDE?
String victimName = ((TeamColor) Saves.teamColors.get(((TeamBridge)game.teams.get(playerd.teamNumber)).color)).getChatColor() + player.getName();```
- You have lots of redundant casts (except if you using Object)
Saves.teamColors.getandgame.teams.getcan be null, use contains or check for notnull
hmm, why would it be null...
Because that thing
String or something is can be null, so the list does not contain that
if you do
if (Saves.teamColors.contains(game.teams.get(playerd.teamNumber)) != null)
that means something is wrong in the teams...
then it not throws
well yes, but that wouldn't solve the problem of it not being there in the first place
also use HashMap for using multi arrays
yes...
but the real problem is that the team number is not in the teams it looks like
then add them
easier said than done, this is a bit big
@sturdy oar you can replace font characters with custom images
however downside of this method is you lose that character from being used
Hello I am wondering which antibot do you recommend for the bungeecord?
I don't know of any, but maybe someone here might know the answer for that
there is a spigot search engine
I need a good antibot because 200+ players play on my server every day
well, frostalf, you can use the private section unicode characters, and 1.16 fixed that issue by allowing text components to specify a custom font
I need a good antibot because 200+ players play on my server every day
thats why you should search for it, google is your friend
Is there a way to have the totem have a custom name when it comes into the players inventory
ItemStack#getItemMeta
Is anyone willing to just look into the plugin code and see if they could fix a few things? If so, dm me. I've already spent all yesterday updating it and getting this far.
okay thank you
I need a good antibot because 200+ players play on my server every day
@safe furnace I can help
Are you online-mode right
1.16.1?
I didn't notice it tbh
Let me see on my server if it happens
Did you update from a previous version like 1.15?
But did other structures generate
like the new biomes
@sturdy oar My server does not need a premium
What?
@safe furnace I can help
@sturdy oar
your server is not premium?
no
okay
I can recommend BotSentry, it's the best.
@cobalt yoke !!111! i advertised u now give me discount
Does anyone know how to display the totem of undying effect on a players screen?
how can i check if players are not moving? because playerMoveEvent isnt get triggered if not moving
it's EZ!
make a hashmap
add them if they moved, removed them if they stopped moving
I created a custom plugin and now for the first time I'm trying to add a configuration file, I followed a few tutorials but I'm messing up big time; someone willing to help me out? What I want to create: a config file with some general customizable messages in. I'm willing to screenshare and voicecall if needed
why would a config reset itself
;)
if i get it right, you want to make a config, with strings in it to use... for what?
https://prnt.sc/tfy04z so not work vanturechat emoji ?
if i get it right, you want to make a config, with strings in it to use... for what?
@tough kraken customizable messages and stuff; nothing too big
oh and also if some schedule has to happen daily, weekly or monthly
and you dont know how to create one?
correct
Actually, I’d like to know how to make time accurate schedules work too
@winged sparrow in java you can work with LocalDateTime.now(); I only check if its the first day of the week (monday) or month; and if its 00:00h
Like if the server is down, freezes, or misses a tick, how do you make it happen? I can think of ways to make schedules work but they’re probably overly complicated compared to a standard way of doing it
https://www.spigotmc.org/wiki/creating-a-config-file/
maybe this is helping you
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
@cobalt yoke !!111! i advertised u now give me discount
@sturdy oar i give you discount of 1€ 🤣
is there an option to only compile craftbukkit from buildtools?
don't use botsentry it will brick your playstation 3
@sturdy oar i hate ps so yeah i hope that happened
:D
#PCLover
Gaming PC >>>> Play Station
In my maven project, my plugin depends on my api (to be shaded in) but my api depends on my plugin (because it uses a class inside my plugin) but I am not able to have them depend on each other, how can I fix this?
you need to fix circular dependency
add them if they moved, removed them if they stopped moving
@sturdy oar yeah and how to get if they stopped moving?
you need to fix circular dependency
Yeah I’m getting some issue about that
if they didn't send movemement packets in N ticks, they are not moving i guess
Not sure how to fix it
packets...whuuuu
is there no method to check players movement speed? to check if its 0?
you don't need packets for that
Because my plugin needs to depend on my api, and my api needs to depend on my plugin
just make a runnable or something
you can determine if a player isn't moving in like 100 different ways.
@tough kraken And how would I add comment lines to the config to explain what something is? Thanks
we say, you want to add this to your config:
joinMessage: VNGC joined the game
(example)
then you use config.set("joinMessage", "VNGC joined the game");
if you mean that
and comment lines:
#thisisacommentline
joinMessage: VNGC joined the game
No, I mean, how do I add a line above thati n the config file that says something like "Edit underneath to customize the welcome message"
yes how do I add that comment line in the default config
put a # before the message, it wont get recognized by the plugin. like "//" in .java files
Alright what confuses me is that I'll manually have to input the comments, yet the default config is basically hard coded
private final HashMap <UUID, Boolean> movingPlayersMap = new HashMap<> ();
private final HashMap <UUID, Location> lastLocationMap = new HashMap<> ();
Bukkit.getScheduler().runTimerTask(plugin, () - > {
Bukkit.getOnlinePlayers().forEach(p - > {
final UUID playerUUID = p.getUniqueIdentifier();
if (!lastLocationMap.contains(playerUUID)) {
lastLocationMap.put(playerUUID, p.getLocation());
movingPlayersMap.put(playerUUID, false);
return;
}
movingPlayersMap.computeIfPresent(playerUUID,(k, v) - > {
v = lastLocationMap.get(playerUUID).distance(p.getLocation()) > 0.d
});
});
}, 1L, 5L);
i don't know if this is the best solution, but you get the idea.
yeah thanks, i will try
Thanks for your time I'll have you know in a minute if it works what I did
well can i use player names instead of UUID's? because of bungeecord
ehm don't you have UUIDs on bungee as well
well offline mode etc
it gives other uuids than that from the player
but as it gets resetted at restart/reload, i think i can use player names as well?
remember that 2 player can have the same username in a server
Alright it's just, what confuses me is that I have to have lines like:
config.addDefault("dateformat", "dd/MM/yyyy HH:mm:ss");```
in my onEnable();
While I can just put
```yaml
dateformat: "dd/MM/yyyy HH:mm:ss"```in the config
that would break the hashmap so bad
why that?
that would break the hashmap so bad
@sturdy oar
there is nothing on vanilla preventing 2 players called "TheViperShow" from joining the server
and there are dozens of account with same name
its a private server, so...
if someone knows a way to use UUID's on bungee, just tell me 🙂
btw i have not tested that code snippet, i made it on noteblock
How to show/hide an entity from a specific player?
there is a method
declaration: package: org.bukkit.entity, interface: Player
this is between players
for entities... well I don't think there's any API for that
So how can I do the same with entities? https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java#1053
For a specific player
you cant
I disagree
ok then make a suggestion to spigot/mojang
I don't need to
Is there any email i can forward a support request to?
Ccan anyone help me with an issue I'm having in my plugin?
hey, on the plugin I'm updated, there are still some problems
well, frostalf, you can use the private section unicode characters, and 1.16 fixed that issue by allowing text components to specify a custom font
@zinc ingot Yes you are correct
However will note that replacing fonts with custom images isn't a new thing either 😛
I can't place or break blocks in-game, and I think I know why
can y'all see if there is an problem with this code that would cause it to always be false?
it can be regarded as a hack in a way as well lol, but it is a nice one if it fulfills your needs
TerracottaColorSet.contains(event.getBlock().getType()
it returns false if it doesn't contain it
public static final Set<Material> TerracottaColorSet = EnumSet.noneOf(Material.class);
static {
for (final DyeColor color : DyeColor.values()) {
try {
final Material terraMaterial = Material.valueOf(color.name() + "_TERRACOTTA");
TerracottaColorSet.add(terraMaterial);
} catch (Exception error) {
Bukkit.getLogger().info("Error forming TerracottaColorSet:");
error.printStackTrace();
}
}
}```
yeah 😛
I think there is something wrong here that is making it be false always. Do y'all notice anything?
TerracottaColorSet.add(terraMaterial);```
this returns false if it can't match the valueOf
i guess its a hack, but given that mojang recently released the font feature, it seems like they approve
TerracottaColorSet.add(terraMaterial);``` this returns false if it can't match the valueOf
returns null
but the downside was that whatever character was chosen, was now used up
so you couldn't use that specific character for other things
i mean we have whole UNICODE
it should match the value of though, right?
or is there a problem with my matching?
the matching is very basic
I believe it is also case sensitive
so you need to make sure when you match that you tell it to ignore the casing
Wait but it's matching a Material...
Wouldn't valueOf throw an exception if there is no match?
valueOf gets the values via String
hey, I'm having some issue with an inventory automatic item click slot detection system where you click an item and it goes into the right slot, does anyone want to help me? I have tryed debugging but I'm not sure what's happening
so you are matching via strings, doesn't matter if its materials or not
Yeah but aren't materials always uppercase?
should be, but that has no bearing if your value you are presenting is uppercase or not
it could be your value you are putting in there is lowercase
Huh?
Oh...
You are assuming it is uppercase
oh yeah lol
also not sure if the material will have all available colors or not
so that is also something to consider
then your issue could be using a color that the material doesn't have
so instead of using the name of a color, why not just use a boolean then
to determine which you want
well I mean
lot more optimal then using strings everywhere XD
could even use an int if you want even more optimal too
?
but no errors are thrown...?
not everything will throw an error
Final is one of those things that won't throw an error but can cause you to have unexpected results
lemme try logging...
your set is final as being a null set
@sturdy oar tried this by myself, and seems to work
public static void checkSpeed() { Bukkit.getScheduler().runTaskTimer(Main.getPlugin(), new Runnable() { @Override public void run() { for (Player players : Bukkit.getOnlinePlayers()) { if (!lastLocation.containsKey(players.getName())) { lastLocation.put(players.getName(), players.getLocation()); } Location loc = lastLocation.get(players.getName()); if(players.getLocation().equals(loc)){ players.sendMessage("true"); } else { lastLocation.put(players.getName(), players.getLocation()); } } } }, 0L, 2L); }
alright, I removed the finals, and I added logging
now building and then adding to server...
@sturdy oar tried this by myself, and seems to work
@tough kraken Cool to know, i honestly wouldn't have reduced the task to every 1/10 second
where "true" means, the doesnt move
well idk
so now i want it so, that if a player doesnt moves for 10 seconds, he dies. what would i do for that?
I guess...
you can make another map xd
increase the value whenever the player doesn't move
and if he moves, reset it to 0
so if he doesnt move, set it every second 1 higher, and if it is at 10, kill them?
I'd honestly use ticks tho
maybe it's just my preference, but i prefer storing minecraft times in long values as ticks
what is the difference there?
and what i dont understand since... actually ever, what is the difference Between "20L" and "20" in a scheduler
it's annoying to have code that works with ticks, and somewhere else code that works with seconds in double values
and what i dont understand since... actually ever, what is the difference Between "20L" and "20" in a scheduler
@tough kraken i just answered that on spigot to someone
ah i see
ah yeah that was me, lol
🤦 fail
yeah
I've got a problem with commands.yml 👀
My aliases can't tab complete when put into commands.yml
*_*
what do you all actually prefer more? intelliJ or eclipse? for spigot
cant actually decide, as Eclipse lags for me sometimes at working, and IntelliJ needs years to build the jar
I use Netbeans
doesnt works...have jdk jre all installed, but still shows me it isnt..lmao
for me it are nearly 2 minutes
IntelliJ and NetBeans use ant by default if you don't use maven or gradle
Would depend on your CPU/RAM
16gb ddr4 and ryzen 5 2600
Use maven or gradle, and set up their settings to take advantage of more resources
and you will be building decently 😉
but it also depends on your build setup too
not everything is just super fast because you said so XD
what I mean build setup is what exactly the build system needs to do according to what you told it
do people still compare loading times between java ides?
maybe :c
have no idea, but netbeans allows you to change the JVM arguments for it 😉
not sure if IntelliJ allows the same
eclipse too
reason I like that, is because I don't want my IDE to automatically consume whatever ram it wants
but in a file
yes netbeans has a file too
and then in Maven, if you installed it, also has a settings file to set some resources it is allowed to use 🙂
can even build projects in parallel too if you enable it 😉
but most people here who compare IDE's just like the fact of comparing solely on out of the box stuff
which isn't really a fair comparison lol
yo i just noticed minecraft font for character '|' changed between 1.8.9 and 1.16.1
don't know when though
yo i just noticed minecraft font for character '|' changed between 1.8.9 and 1.16.1
@sturdy oar yeah changed from two lines to |
back
had to go do stuff...
so this is interesting
I noticed that the block I am holding is just "terracotta"
not my team color
this explains why the check didn't get it
also I logged the check in console and it's FALSE
and I logged the block in console and it's TERRACOTTA
not $COLOR_TERRACOTTA
so... lemme find the code that gives the user the terracotta
oh
I've already been there...
And (I thought) I had made it set the terracotta to the user's team color...
Hi SpigotMC. I came here to get support with an issue I am having, not sure if its only on my side or its spigot sided with the 1.16.1 update. So when I use color codes on items to rename them (either on some GUI-s or just some /rename commands I have), somewhy on the second color code, if the item has one, it just goes into italic. Its like this:
Actual:
&6Vote &ekey
How it shows:
&6Vote &e&okey
However, the &o isn't there and other plugins seem to have the same issue.
int teamNumber = game.teamPlayers.get(player.getName()).teamNumber;
TeamBridge teamBridge = game.teams.get(teamNumber);
TeamColor teamColor = Saves.teamColors.get(teamBridge.color);
DyeColor dyeColor = teamColor.getDyeColor();
Material terracottaMaterial = DYE_TO_TERRACOTTA.get(dyeColor);
player.getInventory().setHelmet(GeneralMethods.CreateLeatherArmor(teamColor.getChatColor() + teamColor.getTeamName(), Material.LEATHER_HELMET, teamColor.getColor(), 1));
player.getInventory().setChestplate(GeneralMethods.CreateLeatherArmor(teamColor.getChatColor() + teamColor.getTeamName(), Material.LEATHER_CHESTPLATE, teamColor.getColor(), 1));
player.getInventory().setLeggings(GeneralMethods.CreateLeatherArmor(teamColor.getChatColor() + teamColor.getTeamName(), Material.LEATHER_LEGGINGS, teamColor.getColor(), 1));
player.getInventory().setBoots(GeneralMethods.CreateLeatherArmor(teamColor.getChatColor() + teamColor.getTeamName(), Material.LEATHER_BOOTS, teamColor.getColor(), 1));
for (int i = 0; i < 9; ++i) {
ItemStack itemS = Saves.inventoryBar.get(i);
if (itemS != null) {
if (TerracottaColorSet.contains(itemS.getType())) {
itemS = GeneralMethods.CreateItem(terracottaMaterial, itemS.getAmount());
}
player.getInventory().setItem(i, itemS);
}
}```
I'm already setting it with the terracottaMaterial of the team's color 🤔
@silver sky Have you tried putting the &o before the &e?
what the heck...
My logging says the material variable is set to... BLUE_WOOL?
i have a taskTimer, in it i have this:
notMoved.put(players.getName(), //value);
how can i increase the integer (value) by 1 every second?
oh
bruh
I made a mistake, I had 2 util methods for later use, DYE_TO_CONCRETE, and DYE_TO_WOOL
they were both changing the DYE_TO_TERRACOTTA set
i have a taskTimer, in it i have this:
notMoved.put(players.getName(), //value);how can i increase the integer (value) by 1 every second?
final int value = 0;
Bukkit.getScheduler().runTaskTimer(() -> {
if (notMoved.containsKey(players.getName())) {
int current = notMoved.get(player.getName());
int v = value;
v = current;
v++;
}
});
or something like that
that won't work
that task is constrained to the tick loop of the server
therefore it won't guarantee that it updated within 1 second
would this work?
notMoved.put(players.getName(), notMoved.get(players.getName()).intValue() + 1);
instead create a separate thread for your task making the thread manually, have it sleep for 1 second
every time it wakes up it updates the value
would this work?
notMoved.put(players.getName(), notMoved.get(players.getName()).intValue() + 1);
yep
then i just use this 🙂
instead create a separate thread for your task making the thread manually, have it sleep for 1 second
this just an example what I've sent
if my server would not crash almost everytime on join lmao
@rare prairie yes but your method would mean it would lag in updating every second if the server is lagging
however it really depends on what OP actually wants
sometimes it is ok if methods lag with the server other times not always ideal 😛
bruh make another thread
if you use bukkit scheduler for it
it will always be constrained with the tick loop of the server
exactly
Ok, not ideal if you really want something to update every second
if the ticks of a server start lagging behind your loop now is inaccurate
bruh, why you say this even I know, thats just a fast example
It's getting logged how it should be
Clarification is always necessary especially if they really want it to update every second even if server is lagging
The terracottaMaterial variable is BLUE_TERRACOTTA
but in my inventory, I have TERRACOTTA :/
then somewhere you are mixing up your variables
would probably recommend a custom object for this
so you can consolidate your data
int teamNumber = game.teamPlayers.get(player.getName()).teamNumber;
TeamBridge teamBridge = game.teams.get(teamNumber);
TeamColor teamColor = Saves.teamColors.get(teamBridge.color);
DyeColor dyeColor = teamColor.getDyeColor();
Bukkit.getLogger().info(String.valueOf(dyeColor));
Material terracottaMaterial = DYE_TO_TERRACOTTA.get(dyeColor);
Bukkit.getLogger().info(String.valueOf(terracottaMaterial));
player.getInventory().setHelmet(GeneralMethods.CreateLeatherArmor(teamColor.getChatColor() + teamColor.getTeamName(), Material.LEATHER_HELMET, teamColor.getColor(), 1));
player.getInventory().setChestplate(GeneralMethods.CreateLeatherArmor(teamColor.getChatColor() + teamColor.getTeamName(), Material.LEATHER_CHESTPLATE, teamColor.getColor(), 1));
player.getInventory().setLeggings(GeneralMethods.CreateLeatherArmor(teamColor.getChatColor() + teamColor.getTeamName(), Material.LEATHER_LEGGINGS, teamColor.getColor(), 1));
player.getInventory().setBoots(GeneralMethods.CreateLeatherArmor(teamColor.getChatColor() + teamColor.getTeamName(), Material.LEATHER_BOOTS, teamColor.getColor(), 1));
for (int i = 0; i < 9; ++i) {
ItemStack itemS = Saves.inventoryBar.get(i);
if (itemS != null) {
if (TerracottaColorSet.contains(itemS.getType())) {
itemS = GeneralMethods.CreateItem(terracottaMaterial, itemS.getAmount());
}
player.getInventory().setItem(i, itemS);
}
}```
How could this be wrong...
In console, I got:
[12:57:30 INFO]: BLUE
[12:57:30 INFO]: BLUE_TERRACOTTA```
Exactly as it should be
the second shows that terracottaMaterial is correct, and is BLUE_TERRACOTTA
Anyone got an idea?
DYE_TO_TERRACOTTA hashmap it contains the BLUE value, let see that code, where you add materials to this map
then Saves.teamColors.get#getDyColor have a blue dye color
yes it does
oh...
I found the problem
ItemStack itemS = Saves.inventoryBar.get(i);
this takes from a file called data.yml
Item3:
==: org.bukkit.inventory.ItemStack
v: 2567
type: TERRACOTTA
amount: 64
Item4:
==: org.bukkit.inventory.ItemStack
v: 2567
type: TERRACOTTA
amount: 64```
Hey, teleporting a player during PlayerEvents from one dimension to another gives a TickingEntity removing entity while ticking! in 1.16
It did not do so in many previous versions
Does anyone have a fix?
type is terracotta here, so that if check should of never been changed to check if it is a color
probably should first see if there is any updates @wheat mirage
if you are on the latest commit version, then it would depend which player event you are trying to use. Some of them need to be cancelled first
because it should be a generic name there, and the plugin should set the color if it is a generic block with different colors
there's the issue 😄
I'm on latest @keen compass
I'm using EntityDamageByEntity
Teleporting during that event raises the ticking entity error
It's already been cancelled
Caused by: java.lang.IllegalStateException: Removing entity while ticking!
at net.minecraft.server.v1_16_R1.WorldServer.removeEntity(WorldServer.java:1081) ~[spigot.jar:git-Spigot-ccb012a-4309566]
at net.minecraft.server.v1_16_R1.WorldServer.removePlayer(WorldServer.java:1100) ~[spigot.jar:git-Spigot-ccb012a-4309566]
at net.minecraft.server.v1_16_R1.PlayerList.moveToWorld(PlayerList.java:603) ~[spigot.jar:git-Spigot-ccb012a-4309566]
at org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer.teleport(CraftPlayer.java:676) ~[spigot.jar:git-Spigot-ccb012a-4309566]
at org.bukkit.craftbukkit.v1_16_R1.entity.CraftEntity.teleport(CraftEntity.java:462) ~[spigot.jar:git-Spigot-ccb012a-4309566]
Excerpt from stacktrace
doesn't seem like a player event
are you use spigot software
I can see why it's happening
but I can't see a great way around it
@keen compass It's an entity event I guess
My bad
Hard to do, as I kick the player in that same event in many cases
Entity#remove is used?
They need to get teleported before being kicked
@rare prairie No, just teleport. See stacktrace.
@rare prairie when teleporting between worlds, technically the entity is removed and then respawned
yes
this is even true for players
It's so weird
As I've never had this error before
1.16
Well
I was previously on 1.12
The more updated versions have more things multi-threaded and there is significant changes especially when you want to compare years old software
to something more current
Yeah I'm still surprised the infrastructure has changed so much
anyways, just use a task
not like you are going to be kicking players while they are teleporting are you?
Well, yeah
As I said
I kick them in the event
I might have to delay the kick a tad
so you kick players while they teleport?
You're not working on my codebase so you've no idea what's necessary, but ok.
That's probably going to have to be the solution
true, but you can always change a players spawn position whether online or offline
Players logging out inbetween event and task could be problematic.
delaying the kick after teleport will fix it
@rare prairie see msg above yours
If the player is involved in the event and logs out between event and teleport
could be problematic
not really
Depending on if packets are processed inbetween
you can change the players spawn position whether online or not
@keen compass I don't need to change their spawn position
obviously you do
Becuase I just told you that
because you just said you want to make sure they are in the correct spot when you kick them
If you can change their actual position while offline, that would be helpful
You can
Will Player methods work for that?
Or will I need to get a different object
Like OfflinePlayer etc
OfflinePlayer should work for this
It is no different then getting an offlineplayers inventory
Since when was that possible?
the only difference here is you just want to change where they spawn
It wasn't in 1.12 I don't think
getting an offline players inventory has been a thing since 1.7
@keen compass I think there's a misunderstanding here
Their spawn position is their location they will respawn
Like their bed
Their offline location is where they will be when they login
Important distinction
It is considered spawning when a player logs in
For clarity's sake, not really, no.
anyways, you can change where they will end up being regardless. Either while they are offline, or when they log in
