#help-archived
1 messages · Page 87 of 1
Any ideas?
nimsy let me see
Are you coding the plugin?
no there's nothing to code
Just default scoreboard?
i'm not sure what's causing this
but i know it has to do with scoreboards
and whatever scoreboard-related plugins i have rn are not causing it
well it doesn't seem to be a plugin
maybe i'll just use a pre-existing plugin
Still what plugins do you have in your bungee?
thanks
When I'm not using java, I'm scripting with a plugin called Denizen. DepenizenBungee allows me to use Denizen throughout my servers
@tall pewter seems to be trying to add a new team to the scoreboard that’s already exist
exactly
perhaps the team that already exists is still stored in the server memory somehow
we just gotta find a way to get rid of it
I've tried deleting the scoreboard.dat file many many times
You sure it's not the DepenizenBungee plugin that might cause it?
Idk never heard of it but it seems suspicious
I mean i can delete it and see what'll happen
Delete scoreboard.dat
iterate through all existing teams and delete them and start from scratch?
yeah try that and reset the data as well
And set it up again
Syxteen wouldn't help if the error keeps occuring
Ultra yes but if the error is by server side it will keep popping up unless you find out what causes it.
It’s the scoreboard itself conclure
API let's you interact with scoreboard
these are the placeholde hooks i seem to have: bedwars, bungee, cc, denizen, gadgetsmenu, luckperms, ocm, player, tab
so what do you suppose i do?
I mean I still think denizen is suspicious
p.getInventory().setItem(1, Items.byName("ENDER_PEARL").getItemType(p));
``` so i am giving back the ender pearl (ender butt) after they use it but then it doesnt give it back ^
i've deleted denizen before and the same problem still occurs
dont use ur own methods then @frigid ember
@frigid ember have you tried
p.updateInventory();
no need for that @signal yarrow
Its not my own method is the thing lmfao
?
pretty sure Items is ur own class
i mean
why dont u just do new ItemStack(Material.ENDER_PEARL))
it gives the player the item by the name ENDER_PEARL and the type is a pearl
reasons
its still gets the name then the type
that returns Material.ENDER_PEARL
i dont know whats your point
you need ItemStack constructor in order to give players items
?
*$
do player.getInventory().setItem(1, new ItemStack(Material.ENDER_PEARL)) @frigid ember
But i want the Name that is custom set in my EnderButt Class.
HUH
if i could i would send a ss
can you say a little more information
you never said that you want the pearl to have a custom name
package me.l3ilkojr.hubcore.Items.impl;
import me.l3ilkojr.hubcore.Items.Items;
import me.l3ilkojr.hubcore.Utils.StringUtil;
import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.List;
public class EnderButt extends Items {
public EnderButt() {
super("ENDER_PEARL");
}
@Override
public ItemStack getItemType(Player player) {
ItemStack itemStack = new ItemStack(Material.ENDER_PEARL, 1);
ItemMeta itemMeta = itemStack.getItemMeta();
itemMeta.setDisplayName(StringUtil.format("&5EnderButt"));
itemStack.setItemMeta(itemMeta);
itemStack.setItemMeta(itemMeta);
return itemStack;
}
@Override
public String getItem() {
return "ENDER_PEARL";
}
@Override
public String getItemDisplayName() {
return StringUtil.format("EnderButt");
}
}``` ender butt class
why does a getItem return a string
get Item doesnt do anything atm
ok?
😂
if you think you can fix my problem go ahead if not stop laughing and gtfo
hi, i want to start my server with 10MB
this one only have 1MB
java -Xms1G -Xmx1G -jar Server_Spigot_1.15.2.jar -o true
pls help ?
@frigid ember instead of setItem, try using
p.getInventory().addItem(ItemStack i);
Set -Xmx to 10G then
Does it allow me to set the slot is what i need to
not just to add an item to an inv
Or 1024
it doesnt give it back when i throw the pearl
Server_Spigot_1.15.2.jar Agam why this jar name :i
Without the G
send the full method
but when i land the method works fine
@torn pilot like this ?
java -Xms10G -Xmx1G -jar Server_Spigot_1.15.2.jar -o true
No
like this ?
java -Xms1G -Xmx10G -jar Server_Spigot_1.15.2.jar -o true
p.getInventory().setItem(1, Items.byName("ENDER_PEARL").getItemType(p)); this it gets then name and what the material is then gives the item
it works on EntityDismount
but when thrown it just doesnt want to work
Xms = Minimum amount you want it to use.
Xmx = Max amount you want it to use
send the method where you listen to the throw event
minimum ?
So yes, that would work if you like
public void onProjectileLaunch(final ProjectileLaunchEvent e) {
if (e.getEntity().getShooter() instanceof Player) {
final Player p = (Player)e.getEntity().getShooter();
if (e.getEntity() instanceof EnderPearl) {
if (Items.byName("ENDER_PEARL") != null) {
p.getInventory().setItem(1, Items.byName("ENDER_PEARL").getItemType(p));
p.updateInventory();
HubCore.getInstance().getServer().getConsoleSender().sendMessage("I have give pearl back yes");
}```
Yes minimum
Any idea why the below code only works when I am on creative mode T_T?
public void launchPlayerTo(Player player, Vector vec) {
player.sendMessage("1");
Entity entity = player.getWorld().spawnEntity(player.getLocation(), EntityType.ARROW);
player.sendMessage("2");
entity.setPassenger(player);
player.sendMessage("3");
map.put(player, entity);
player.sendMessage("4");
((CraftArrow) entity).getHandle().setInvisible(true);
player.sendMessage("5");
entity.setVelocity(vec.multiply(1.2).setY(vec.getBlockY() + 2));
player.sendMessage("6");
}
Also the arrow isn't invisible
dont worry about the missing }
java -Xms1G -Xmx10G -jar Server_Spigot_1.15.2.jar -o true
this one is not working, https://i.imgur.com/dmHd0qK.png
@frigid ember did you properly register the event?
yes its in my PlayerListener class with my other events
already have
try debugging after each if statement in the method and see where it stops sending a message
thats where it would cut off
public final class EnderPearlManager {
private final Main instance;
private final Map<UUID, ItemStack> pearls;
public EnderPearlManager(Main instance) {
this.instance = instance;
this.pearls = new HashMap<>();
}
public void addPlayer(Player player, ItemStack stack) {
pearls.put(player.getUniqueId() + stack);
}
public void removePlayer(Player player) {
pearls.remove(player.getUniqueId());
}
public boolean contains(Player player) {
return pearls.containsKey(player.getUniqueId());
}
}
now just do this
private EnderPearlManager manager;
public final class Main extends JavaPlugin {
@Override public void onEnable() {
manager = new EnderPearlManager(this);
Bukkit.getPluginManager().registerEvents(new Listener() {
void onThrow(ProjectileLaunchEvent event) {
if(event.getEntity().getShooter() instanceof Player) {
Player player = (Player) event.getEntity().getShooter();
if(event.getEntity() instanceof Enderpearl) {
manager.add(player, event.getEntity().getItemStack());
}
}
}
}, this);
}
}
@frigid ember
java -Xms1G -Xmx10G -jar Server_Spigot_1.15.2.jar -o true
this one is not working, @brisk mango E:\Windows\Desktop\LocalHosts\Minecraft 1.15.2>java -Xms1G -Xmx10G -jar Server_Spigot_1.15.2.jar -o true Invalid maximum heap size: -Xmx10G The specified size exceeds the maximum representable size. Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. Press any key to continue . . .
@inland depot bruh youre not helping anyone stop
@inland depot i have debugged it tells me it has given the items but obv not
Do you have 10gbs available?
yes
@frigid ember bruh you can just copy the code i gave you that should work
io only have 3half tera
@brisk mango stop being toxic please
no i am going to use my own method
and stop helping people if youre not pointing them in the right direction
Of memory yes? Not storage
then fuck off not gonna spoonfeed you no more
what's the difference
i simply suggested for rbuh to debug his code and see where it stops
idk why u think that's in the wrong direction
ah really, i just wanted to help you and wasted 5 minutes of writing code that works and im a dick
fuck off
temedy
@brisk mango you need to chill lmao
wasting time on retards
but obv you could of helped me instead of being a total cunt
All I see you is being angry
how can i check my memory
Then leave
"could helped me" what did i do?
@brisk mango Not to minimod, but the normal chat rules still apply heree so be careful
you also told me to stop giving useless suggestions when i was providing rbuh with a simple way to see what was wrong with his code....
<o/
Anyway!
but they were useless suggestions
No more arguinggg pleaseeeee c:
how could removing and adding p.updateInventory() help him
when that does not change nothing
@brisk mango pls help ? how can i check the memory
i wasn't referring to that one
just type 2 instead of 10
the one i was suggesting was the debug lmao
and i provided code that would work
Half of the questions asked in here could've just been googled and found in like 1 minute.
i need 5 or 10
Jesus this chat should calm down a little
@brisk mango
2
Everyone here should be helpful 🤔
why u need 5
my server will be of 20 players
@brisk mango https://i.imgur.com/T3Mtgyu.png
this ?
I have a question thennnn. Does anyone know how to post unicode characters in Spigot.yml, such as in the joinmessage?
20B9 is the unicode character point. \u is always needed
so, just find the unicode character point of the character you want to use, do \u(character point) in your spigot.yml and java should pick it up.
If it's a unicode yh
"&c\u2666" "&8&l\u00BB" &r&7Command not found, use &c&l/guide &r&7for useful commands.
Like that?
not sure what those extra numbers are, but if that is the character point number then yes that is the correct way
You said always use 20B9
So I put 20B9 in front
\u = program will know it's a unicode character
and the other part is telling which one
And there has to be quotes?
Yeah but
in yaml otherwise yaml does weird things
yaml is for readability mainly so no considerations it does
I'm the spigot yml the default message for unknown command has quotes in it and the quotes are visible
"/help" is in quotes and you see that in game
We are saying, go ahead and use double quotes around your message
defaultunknowncommand: "\u00a79 <--example owo" #use " and " instead of ' and '
Idk whats so unclear to you
"&c\u2666 &8&l\u00BB &r&7Command not found, use &c&l/guide &r&7for useful commands."
should be working
It doesn't I'll show you
how i can get rss link of resourse?
i wish to have resourse updates in rss
from description i just see general information
not currently possible with the API currently
you can get information about a resource, but you can't use it to push updates
or download updates automatically
i just want to have one discord channel where i could see all plugin updates
thats what i want to achieve
and rss would insta solve it
but sadly there is no rss
Has anyone worked with Bukkit scoreboards using NMS?
Oh man I didn't realise @SerializableAs() was a thing until now, if you add it after configs already used the old name will it still pick them up?
Bukkit is something different than NMS @frigid ember
Yeah ik, I worded it poorly
I am using NMS to manage player scoreboards, because the current format that vanilla/spigot does things just does not make sense
im not an NMS expert
@torn pilot have to escape the \
If I want to have players assigned to a team and show team data, as well as specific player data on that same scoreboard, you have to create a new scoreboard and create all the same teams and then add every player back to their respective teams for taht scoreboard.
I just think the way scoreboards are implemented is dumb in general lol
Nms😳
I mean
the code of scoreboards is really shit
and it even throws exception in the client log
sometimes
poorly designed
okay im going to be deleting each of my plugins one by one and seeing which one's causing it
I would really like for them to re-design because the way they did it really makes no sense @tiny dagger
it makes sense to me
but yeah a redesign would be so much better
and let's be honest their idea of scoreboards back then was different
On projectilehit event how do I check if the projectile hit a block or an entity?
get its position
and check if an entity is there
id say get nearby entities in a radius
and check that
no wrong
easy way for the entity one is that there is a second event that gets thrown for when an entity damages an entity fyi
ok srry i just said whats off the top of my head on a mobile
bruh
check docs bro
javadocs nice
@fleet crane Why is there no setTeams(Map<String, Team> teamMap) method in the Scoreboard interface?
This could alleviate any number of problems when it comes to team assignment
Map<?>
@brisk mango I am using 1.8
Mak pretty sure Map<?> would make chaos
Yeah but getHitBlock/Entity doesn't
it's an api tho
Set<Team> would be more appropriate approach then. I don’t know but Team has a name inside it?
yup
You register teams through a String name
this would still not make sense lol
^
registerteam adds it into scoreboard already
Regardless of whether it makes sense or not, MC uses a map for reference in their source
Reflect into its fields & you will find a map
so setteams makes no sense to me
How does that make no sense
Then reflect the map and cache it?
https://imgur.com/a/DlOgaGg @brisk mango
No, theres only one final field net.minecraft.server.v1_15_R1.Scoreboard
with a security manager
then use EntityDamageByEntity
So what you're saying is not possible unless i go full-blown NMS & recode what has basically already been done
or dont use 1.8
So i still can't find anything that would kill mobs entering a region
Okay
@brisk mango that wouldn't cover the case that the arrow hit ground though
@naive goblet But my question is - do you know of a simpler way to do this?
Than?
Honestly this would probably be best in voice
Any chance you'd join a vc for me to explain?
yo i think the cause is NoteBlockMusicPlayer
not sure if this is a bug... but im getting confused
calling player.getHealth() after player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(12); will return 20
Likely doesn't apply until a tick after
doesnt work even then
So here is my problem:
I have a gamemode in which I have multiple teams. These teams can control "checkpoints". I want to display the total number of checkpoints that a team controls. I want to display this on the same scoreboard for all teams. So something like:
Blue Team : 7
Red Team: 9
Yellow Team: 3
However, I also want to display individual user data as well:
Blue Team : 7
Red Team: 9
Yellow Team: 3
===========
kills: 5 <- only shows up for THAT PLAYER
xp: 700 <- only shows up for THAT PLAYER
If you have a single scoreboard that shows only team data, then you can't put individual player data on the scoreboard - if I change it to show my stats, then all players attached to that scoreboard will see my stats.
If I create a new scoreboard for each player, then I have to re-register the team for each player in the game, to where if I have 15 players in the game, 5 per team, there are really 5 yellow teams, 5 blue teams, and 5 red teams - this is because each player needs their own scoreboard and you must re-register the teams each time.
Personally I haven't really worked with the Scoreboard part. But Idk if this source possible could help out. https://www.spigotmc.org/resources/scoreboard-sidebar-api.21042/
or maybe that doesn't make sense either
How would I make a tool that teleports you to where you are looking, without being glitched inside a block if you are looking at a wall?
if not teleport to the last free block
My question is is t possible to remove Kicked for clickspam.
What if it’s a wall?? There’s 2 free spots
Can I offset it 1 block towards the player if it hits a wall
yes
so the way i would do it:
raytrace till block
if found check safe spot
if safe teleport else turn back until is safe or it same as the origin spot
there is no magic for 1 version only
its the same for all
time to work on that recursion btw 👀
or incursion o.o
what's that?
raytracing is not as complicated as you think
the bukkit api does it for you
p.geteyelocation getdirection
gives 1 the direction with the length of 1
so you can add it to a location yourself
Would it teleport you on the side of the block?
why would it
Raytracing is just a fancy name for the technic to iterate over a line lol
It's really not difficult whatsoever
Exactly!
Well I need it to, I don’t want it to teleport the player INSIDE a block
think the server prevents teleporting into blocks doesn't it? o.O
do the checks i mentioned
p.getInventory().setItem(1, Items.byName("ENDER_PEARL").getItemType(p));``` so i am doing this right ```
Items.byName("ENDER_PEARL").getItemType(p)``` returns ```ItemStack{ENDER_PEARL x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name=EnderButt}}``` but still wont give me back my pearl
@paper compass ray trace let's you get the hit position which is the position on the block the player hit, AFAIK.
Wouldn't teleport you in a block
he would have to do some bounding checks if he wants to not get tp in a hole or something
getString(path, def) would certainly only return null if def is null right?
@frigid ember if you would have listen to my advice then it would
i aint going to change everything i have just to add your enderbutts so it works i am using a Item manager so i can have different things like Cosmetics and other stuff
why does the getItemType() need the player?
hows your going to work anyways it looks just like my client lmfao
class*
i removed that
well mine would work
it has noting to give the player the item back
What do you mean by it returns ItemStack{ENDER_PEARL x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name=EnderButt}}?
when you print it?
yes
just listen to ProjectileHitEvent and then give it back? lol
i mean if ur not able to do basic stuff then its the reason its not working
i g
what do you think i am doing obviously and its not working lmfao
if you think you know basic stuff fix it
ive send you code that does what exactly you need , but sure
show me your code
send it in bins
?paste
doesn't matter lol
Dude
Just use a paste website
Fucks sake lol
Not everything has to be an argument
^
upside is it makes the chat appear lively 😄
How to override EntityTrackerEntry?
wanting to move a player server-side without the server recognizing this position change and sending a teleport packet
oh my favourite. custom entity trackers
and dont ask me what im trying to do because this is exactly what i want to do lol
ok well im trying to implement my own teleport system
@subtle blade are you 12 years old?
one that doesn't reset fall distance
I'm twenty
mk
@crimson cairn you can do that without what you're trying to do
explain
Get fall distance, teleport, set fall distance?
Why would that interfere with other teleports?
other teleports reset fall distance
i dont want to intercept teleports and store and then set the fall distance again
So just for a specific teleport you're doing?
the thing is, I discovered that it may be possible to make a nofalldamage cheat by exploiting teleportation
I'm confused.
What is ThreadedAnvilChunkStorage
If you don't want to interfere with other teleports, then just don't use an event for it.
and I want to teleport players back that dont follow expected motion in air, yet without resetting fall distance
I'm writing an anticheat btw
Well that's the easiest way to teleport without resetting fall distance.
Whether it interferes with other teleports is easy to change and I'm confused why you think it would interfere with all of them?
Surely you have checks
What's with people constantly arguing about the hastebin shit, it's just a domain and open source software lol
If I'm intercepting teleports, how do I know that it was caused by me and not some other plugin
Why do chests render as ender chests with protocol support?
@crimson cairn make your own teleport method that bundles all of it together and use that one instead of the API one.
It's literally three lines???
lol rip
not necessarily
I can send a teleport packet, but that won't update the position server-side
and if I update the position server-side, the server will catch the change and send its own teleport packet
Why do you need to mess with packets at all?
because it is necessary for accurate detection
actually
why haven't I thought of it before
I could just move the player server-side and AFAIK that doesn't reset fall distance
but I don't think that will work for distances less than 8 as the server sends relative move packets instead of teleport
What exactly are you trying to achieve
a proper rubberbanding system
Then based on the goal you can alter how you implement the system
my goal is to make a rubberband system
it will pretty much teleport the player
but with a custom impl
with these conditions:
- teleport the player to the desired location
- must not reset player fall distance
i guess my brain is too small
don't understand why it must be done through packets
org.bukkit.configuration.InvalidConfigurationException: mapping values are not allowed here
in 'string', line 2, column 9:
noPlayer: '&l&4 Must be a player to use .``` Console error
``` package me.faintcamo.exhc;
import me.faintcamo.exhc.commands.HC;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.java.JavaPlugin;
public class ExclusionHC extends JavaPlugin {
public static FileConfiguration config;
@Override
public void onEnable() {
getLogger().info("[ExclusionHC] Enabled");;
getConfig().options().copyDefaults(true);
saveConfig();
getCommand("hc").setExecutor(new HC());
}
@Override
public void onDisable() {
getLogger().info("[ExclusionHC] Disabled");
config = null;
}
}
//```
// If command sender is not a player
noPlayer: '&l&4 Must be a player to use this command!'```
Could you potentially do something with the playerteleportevent instead of using packets?
maybe
but how do I know that the PlayerTeleportEven was caused by me and not some other plugin
Like I said, teleporting without resetting fall damage is three lines of code.
@viral herald bruh so many things wrong in your main class
elaborate
and no need to set config = null; onDisable())
well first of all that static thing
why its static
why rather not make a
public final class DataFile {
private final Main plugin;
private final String name;
private File file;
private YamlConfiguration config;
public DataFile(Main plugin, String name) {
this.plugin = plugin;
this.name = name;
}
public boolean setup() {
file = new File(plugin.getDataFolder(), name);
boolean succeded = false;
if (!file.exists()) {
try {
succeded = file.createNewFile();
config = YamlConfiguration.loadConfiguration(file);
} catch (Throwable reason) {
throw new RuntimeException(reason);
}
}
return succeded;
}
public void save() {
try {
config.save(file);
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
public void reload() {
config = YamlConfiguration.loadConfiguration(file);
}
public YamlConfiguration getConfig() {
return config;
}
}
and initialise onEnable() and then get the instance
lol
so much better than using static from your main class
There is no point in utilizing a custom config class if he just using the default configs.
he has a static FileConfiguration
Its cuz i also have a utils class
what
nothing
im not even gonna bother asking you
I am not gonna help people while you are here temedy I am tired of how you respond to people.
You are just so rude it's not even funny
temedy just here to waste peoples time
more like im wasting my own time
config is never assigned but the error is because // is not a character in YAML
just block him at this point
the console error is because of config file
@radiant pollen yea I realize
^
This is a YAML comment
yaml comments are # this
o
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) ~[server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchServerCommand(CraftServer.java:627) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.aO(DedicatedServer.java:412) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:375) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [server.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [server.jar:git-Spigot-db6de12-18fbb24]
at java.base/java.lang.Thread.run(Thread.java:832) [?:?]
Caused by: java.lang.NullPointerException
at me.faintcamo.exhc.commands.HC.onCommand(HC.java:16) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[server.jar:git-Spigot-db6de12-18fbb24]
... 8 more```
now its that
import me.faintcamo.exhc.ExclusionUtil;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class HC implements CommandExecutor {
public ExclusionUtil util;
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!(sender instanceof Player)) {
sender.sendMessage(util.noPlayer());
} else {
Player p = (Player) sender;
if (cmd.getName().equalsIgnoreCase("hc")) {
if (p.hasPermission("hc.commands")) {
if (args.length == 0) {
}
}
}
}
return false;
}
}
Command class *
temedy stfu
how u expect us to help you when you know nothing about java
util is null. You have to assign it
@brisk mango stfu? Im literally trying my best self teaching myself
Every declaration has to be assigned before you can manipulate it .
Alright everyone relax
You're welcome to ignore him. He's been nothing but an ass since he's joined
alr
Lol
Genuinely surprised I've had as much patience as I've had not to ban you
What is ThreadedAnvilChunkStorage and why do I see it when I stop my server
Chunks are stored as tags in regional Minecraft Anvil files, which are named in the form r.x.z.mca
It is a good read
AnvilChunkStorage is just a name for the method of storage for Minecraft Anvil files
Thank you.
No problem 🙂
Also why does my server difficulty get reset to Easy after I set it to hard with /difficulty Hard every restart?
I don't think it serializes the difficulty when you set it during the server session. It is something you have to update in the server.properties. I am not sure why they don't save it 😦
You need to stop the server and change it in server.properties
then save
and start server
There probably is a way to manually update it in game and then it stores it. However it would have to be done with a plugin.
So there is no point
¯_(ツ)_/¯
unless there is a command for it but I doubt it
Hello, can anyone help me figure out how to serialize and de-serialize my data with YamlConfiguration? I am currently doing it like this: this.game.config.set("BlueSpawns", this.game.BlueSpawns); this.game.config.set("RedSpawns", this.game.RedSpawns); this.game.config.set("Chests", this.game.chests); this.game.config.set("Flags", this.game.flags);
I've tried this: Map values = this.game.config.getValues(true); this.game.BlueSpawns = (ArrayList<Location>) values.get("BlueSpawns"); this.game.RedSpawns = (ArrayList<Location>) values.get("RedSpawns"); this.game.chests = (HashMap<Chest, Inventory>) values.get("Chests"); this.game.flags = (HashMap<Location, Flag>) values.get("Flags");
But it doesn't work. (Flag is just a custom class that holds a few data types)
So, I'm comparing material types, and surprised that some things (Stripped Jungle wood) compares to Air. I've got the air in a collection, and when I say collection.contains(material.Stripped_jungle_wood) it seems to return true.
Is this some backwards compatability material gotcha?
I went a better way by using .isSolid() but an explanation for why this is would be good.
How do I toggle minecraft's block break animation?
I want to break a block in an amount of time (say 2 seconds) with the animation for each stage of breaking the block
That animation
And I'd like to do the sounds too
Is this possible?
(Server side with spigot)
getBlock().breakNatrually()?
I don't think you can specify a speed. It only plays the sounds and instantly breaks the block though
PacketPlayOutBlockBreakAnimation (int a, BlockPosition blockposition, int c)
Where a is the id of the entity breaking the block, blockposition is the block (location), and c is the level of breaking (0 - 9).
``` Taken from -> https://www.spigotmc.org/threads/packet-for-block-digging-animation.385320/
oh, that works too
You might be able to use a BukkitRunnable to change the animation state every x ticks and then run break naturally when you want to
Never mind
Above answer is much better
@velvet halo does c being higher mean it's faster or slower?
no c is the state of how much the block is broken
a is the entity
yes, but it's an int ID
I don't know how to convert a spigot entity to that
is it something like entity.getHandle().getId()
yes I think so
I haven't done much NMS
thank you!
So im attempting to cancel the grow event of sugarcane and / or cactus the problem seems to be that when the grow event is called the block type is air
how do i detect if it is sugarcane or cactus and still be able to cancel the event
Would anyone like to take a look at my latest.log and assist me please? :((
i can attempt to help you send it my way
Thank you
Hello, can anyone help me figure out how to serialize and de-serialize my data with YamlConfiguration? I am currently doing it like this: this.game.config.set("BlueSpawns", this.game.BlueSpawns); this.game.config.set("RedSpawns", this.game.RedSpawns); this.game.config.set("Chests", this.game.chests); this.game.config.set("Flags", this.game.flags);
I've tried this:
Map values = this.game.config.getValues(true); this.game.BlueSpawns = (ArrayList<Location>) values.get("BlueSpawns"); this.game.RedSpawns = (ArrayList<Location>) values.get("RedSpawns"); this.game.chests = (HashMap<Chest, Inventory>) values.get("Chests"); this.game.flags = (HashMap<Location, Flag>) values.get("Flags");
But it doesn't work. (Flag is just a custom class that holds a few data types)
Also, Flag implements ConfigurationSerializable
[20:42:41] [Async Chat Thread - #4/INFO]: [TC] Member RicheyTooTurnt: i love chicken
[20:42:46] [Async Chat Thread - #4/INFO]: [USA|papaete] Member Mr_GoldLlama OG: ah
[20:42:52] [User Authenticator #104/WARN]: [LuckPerms] Processing login for FrostyWolf775 took 5301ms.
[20:42:52] [User Authenticator #104/INFO]: UUID of player FrostyWolf775 is
[20:42:52] [Async Chat Thread - #4/INFO]: [USA|Austin] Member EmporerCheems BETA: Yea lmao its gooood
[20:42:52] [Async Chat Thread - #3/INFO]: [Jakarta] Member ThoilithMHG: Bruh I just found some emeralds and they are not appearing
[20:43:01] [Async Chat Thread - #3/INFO]: [USA|papaete] Member Mr_GoldLlama OG: this isnt good
[20:43:01] [Async Chat Thread - #4/INFO]: [USA|Austin] Member EmporerCheems BETA: ooof
[20:43:06] [Spigot Watchdog Thread/ERROR]: ------------------------------
[20:43:06] [Spigot Watchdog Thread/ERROR]: The server has stopped responding! This is (probably) not a Spigot bug.
[20:43:06] [Spigot Watchdog Thread/ERROR]: If you see a plugin in the Server thread dump below, then please report it to that author
[20:43:06] [Spigot Watchdog Thread/ERROR]: Especially if it looks like HTTP or MySQL operations are occurring
[20:43:06] [Spigot Watchdog Thread/ERROR]: If you see a world save or edit, then it means you did far more than your server can handle at once
[20:43:06] [Spigot Watchdog Thread/ERROR]: If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash with LARGE lag spikes
[20:43:06] [Spigot Watchdog Thread/ERROR]: If you are unsure or still think this is a Spigot bug, please report to https://www.spigotmc.org/
[20:43:06] [Spigot Watchdog Thread/ERROR]: Be sure to include ALL relevant console errors and Minecraft crash
yeah thats not gonna help me...
The thread dump is huge I don't know if I can copy and paste it here
do it, it will change it into a txt file
The problem is that I don't know how to serialize and retrieve these data types from a YamlConfiguration
take a look at this and see if this will help https://www.spigotmc.org/threads/tutorial-bukkit-custom-serialization.148781/
public ArrayList<Location> BlueSpawns = new ArrayList<Location>(); public ArrayList<Location> RedSpawns = new ArrayList<Location>(); public HashMap<Chest, Inventory> chests = new HashMap<Chest, Inventory>(); public HashMap<Location, Flag> flags = new HashMap<Location, Flag>();
I did, I just can't find an example to help with these data types
Could this be the problem
[20:43:07] [Spigot Watchdog Thread/INFO]: Startup script './start.sh' does not exist! Stopping server.
[20:43:07] [Spigot Watchdog Thread/INFO]: Stopping server
no thats not the problem...
That is not the problem but it is a problem 😛
basically the server said it crashed and it tries to restart it however cant find the file to restart
If you want simple serialization with encapsulation classes then I recommend using GSON
You can easily serialize any type, collection, object that you want.
https://futurestud.io/tutorials/gson-getting-started-with-java-json-serialization-deserialization This is a really good tutorial on how todo it
Super simple to follow and straight to the point
better yet the tutorials are free
So im attempting to cancel the grow event of sugarcane and / or cactus the problem seems to be that when the grow event is called the block type is air
how do i detect if it is sugarcane or cactus and still be able to cancel the event
how can I play a sound at a player without letting nearby players hear the sound too?
rather than specifying the world to play a sound you specify the player
player.playSound();
like this? player.playSound(player.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1F, 0F);
Yes only the player will hear it
okay thanks
no problem
also how can I check if a player is in the recipients list of a chat message?
On the async chat event you get a set of recipients
yes
though there might be a problem
I need to wait for another plugin to assign the recipents
then check for the list
because that plugin uses the async chat event too
Remember events have priorities
Yes then it should handle it after the other plugin chat event
okay thanks
No problem!
oh my bad it should be highest priority and ran last
That is ok, just keep trialing and erroring. You will get it eventually 🙂
🙂
I'm getting Memory Section is incompatible with HashMap
I've been notified that not having a "start.sh" is a problem
Can someone tell me how to create/enable it? 😄
Since you are with a hosting provider it is their responsibility to have a start.sh
You are better off talking to them
hi i forget
does anyone know how to get the materials from the minecraft:logs namespace
or minecraft:wood namespace
etc
what do you mean?
would this give me the chat color at the end of a text? lastColor = ChatColor.getByChar(ChatColor.getLastColors(tempArray[i]));
Doesn't getLastColours() return a ChatColor?
it returns a string
oh... the fuck? lol
yeah lol
kk I'll do that in a sec
It seems like Bukkit.getPlayer() seems to auto complete the players name like if I put "hi" when the players name was "hihi" it would return the hihi player how can I make it so it doesn't auto complete?
because I'm checking if the player is online
and I don't want to find the auto completed player, I want to find the exact player
My whole code is ruined by the existence of stripped wood
wdym
^
I've literally spent all day trying to serialize shapedrecipes
But it just won't work properly
why not
idk
I kind of got it to work but when nothing is in the crafting table stripped Dark Oak wood can be crafted and like all the recipes relating to stripped wood are broken so something must be wrong with that
hey guys can someone help me please? ive been messing around with plugins on my spigot server but recently discovered that death screen has been disabled. now ive discovered its the world itself not any plugin but i have no idea how to fix it? wouldreally appreciate it
lifesaver @keen compass
Is there anyway to loop over all the blocks in a worldguard region? Or get all blocks in the world with a specific metadata tag
turns out I just spent a day trying to fix a bug and all I needed to do was change the api-version in plugin.yml
Ok so i am doing ```java
player.getInventory().setItem(8, enderButt);
what happens?
Noting lmfao
no errors? D:
no lol
i wish
so i could fix
also it gives it back to me when i throw a normal pearl
Ah ok so i just used the player move event checked if the player was riding the enderpearl then give them back the ender pearl
pls change the variable, enderButt is cursed
does anyone know why this happens when u put a color in symbols?
the A thingy appears
elaborate a bit more?
actually let me try something
what's the best way to find any nearby chest in a radius of 15 around a location
@keen compass
when i do this
it shows up as this in game
adds an A behind it ;/
minecraft doesn't like unicode iirc
ok
is there a way to prevent certain items from being put in shulkers
InventoryClickEvent
@vagrant widget is that in yaml?
mhm?
if so it needs to be surrounded with double quotes
yml
how can I find the nearest chest in a radius of 15 blocks from a location without lagging my server?
Wdym without lagging the server
tell me a way how can u lag a server with doing that
do you want to search on all three planes or just x and y @tough viper
all three planes
does anyone have any plugin recommendations to make your server look professional?
depends on how u configure the plugins
and @brisk mango I have to get every block in the radius to check if it's near
until I find one that's valid
like any particular plugins
no you dont procez
how so
for (int x = all.getLocation().getBlockX() - 15; x <= all.getLocation().getBlockX() + 15; x++) {
for (int y = all.getLocation().getBlockY() - 15; y <= all.getLocation().getBlockY() + 15; y++) {
for (int z = all.getLocation().getBlockZ() - 15; z <= all.getLocation().getBlockZ() + 15; z++) {
Location loc = new Location(all.getWorld(), x, y, z);
if(loc.getBlock().getState() instanceof Chest) {
}
}
}
}
}
}
Is x86 = 32-bit?
fucking shit discord formatting
i mean
is there an other way?
i dont think so
you always have problem with everything
like "is using instanceof better than checking the type"????
but is there any way to optimize this
bruh im just gonna ignore you
and I didn't have a problem with that, seriously, I was just curious
it's lagging my server though?
I expect to find the nearby chest without lagging my server?
its annoying
well use your brain and ask yourself
maybe you can find a "better" solution
alright, that's fine, thank you frostalf
temedy, i'm asking help for a reason, and i'm no experienced developer
but the questions that you ask make no sense
i asked about instanceof vs checking materials because i wanted feedback from better developers
and maybe, but they do help me learn
and they help me improve
because i'd like to become a better developer
between that shit
and i'd like to optimize my code
"optimize" "optimize"
You arent really going to optimize if youre gonna change an instanceof check to type check
then ok
@brisk mango seriously what is your problem?
my problem is that people ask dumb questions
They ask questions because they need help
Yet you call them out for it and talk shit back at them
"need help"
how is a question about if its better to use instanceof instead comparing the type about help
instanceof is most times faster to do then manual checking
another dude with no brain
@brisk mango depends
What are you trying to achieve by saying that stuff to people temedy?
for small things won't matter, for hot code it really does
and it doesnt matter in the case of bukkit plugins
got any source on that information of yours?
to back up your claims in no difference
bruh what is your point
using instanceof vs comparing an enum
is like using streams vs using for loops
most likely, no difference
There is a difference
but its not really a difference that you can notice
i dont know what people expect honestly
streams are like 2-3x as slow which stacks up
but yes for the most part
fairly unnoticable
and they have their advantages
yes
an instance operator is used for identifying if the object is the specific type of a class, subclass or interface.
Doesn't mean it is the same if you do getType() it has a different purpose
🤦♂️
See now you pull this attitude again where you think people say stupid shit
I was talking specifically about bukkit plugins and specific cases, like
Events.listen(ProjectileLaunchEvent event -> {
if(event.getEntity() instanceof EnderPearl) {
}
if(event.getEntity().getType() == EntityType.ENDER_PEARL) {
}
});
I was talking about cases like this
pretty much as you can see
there should be no difference
so its pretty dumb to ask a question like that
And yes, you did say stupid shit lol
Wow thanks for being rude again
tbf why are we fighting over this
because I asked how to optimize finding the nearest chest in a radius
I am fighting over this because he is insulting people
I'm sorry
you're fine
I have the right to stand up for people who get insulted by people like temedy
have yet to see Temedy provide proof that an instanceof check is equal to an Enum constant
it is, in that code i sent
switching from i.getType() == Material.CHEST to i.getState() instanceof Chest seems to be a lot faster for the nearby chest thing
In small scale applications you are correct you can do just about anything and probably won't notice a difference if you don't do any kind of optimizations. Large scale applications it does matter a lot.
perhaps you could time the response time in MS? It wouldn't be much of a difference but it's a start
how do you know, did you do the response time in MS @tough viper
no, but when I did the logged it it seemed a lot faster
should I time it to see the difference then?
yes
do long startTime = System.currentTimeMillis();
and then when its finished (the check)
long endTime = System.currentTimeMillis();
and do String result = (endTime - startTime) + "ms";
could i take a long or a int number and format for time then countdown?
bad way to profile something tbh
Wdym format
SimpleDateFormat
@opal bay response time isn't always an accurate way to test such things. Instanceof is handled differently then an Enum constant is when it comes to compiled code
that would be a string you would display. and in code you would still use the long/int
String displayTime = new SimpleDateFormat("mm:ss").format(time);
...
never used one.
Bukkit.getScheduler().runTaskLater(task -> {
task.cancel();
});
...
oh okay, I didn't really know that thank you
@opal bay You can also make a class that implements a runnable btw
I don't really have needs for runnables atm but thank you very much :)
though, I use one to post some messages as close as I can get to after the server is finally initiated
i mean its not worth making a custom runnable lol
no harm 🤷
if you need to use something better than bukkit schedulers id recommend java executors
Depends on the situation, timestamps can be even better in some cases.
Especially for situations like checking when an ability has refreshed
i use timestamps most the time
Bukkit.getOnlinePlayers().size()
i said nvm for a reason
java: cannot find symbol
symbol: method size()
location: class org.bukkit.entity.Player[]?
for some reason its giving me that?
the line is just this
s = s.replace("%ONLINE%", String.valueOf(Bukkit.getServer().getOnlinePlayers().size()));```
i mean
Bukkit.getOnlinePlayers() is a Collection<? extends Player>
so there has to be a .size() method
@tough viper ok, had some time to think about the optimal way to do it. might as well increase your search to 16 as opposed to 15 so that it fits nicely with chunks. At the very most, you will be searching in 4 chunks. So what you should probably do is use chunksnapshot since that is thread safe, with chunksnapshot you can use getTileEntities() which chests should show up as one if I remember correctly. Anyways, just check at most from the location in each direction 16 blocks to get the chunks. use thread that you pass the location to, get the chests in the chunksnapshot and compare if they are a distance of 16 from that location, if not obviously don't care about it. If it is, pass it back to main thread of that location or block to do whatever it is you are wanting.
@brisk mango How would you do the scheduler with ExecutorService?
I see that ChatColor.getLastColors() returns a string, but when I try adding it to the end of a pice of text, it doesn't use that color. It just uses the current color.
Hey guys, why is this happening? https://www.youtube.com/watch?v=dQw4w9WgXcQ
😦
i knew I recognized that playerid
anyone know how I can convert ChatColor.getLastColors(tempArray[i]) to a ColorCode enum?
as that returns a string
thanks
oh?
yeah
I just want the last one
It can list the colors and the formatting.
are you able to put colors in plugin yml
then do it manually
getLastColors will list any colors/formats that apply to the last part of the string. So red underline, blue strikethrough, etc.
oh okay
that's awesome
You cant use valueOf with that because it's not a value actually in the enum
No idea.
I was thinking about using getLastColors but I didn't really understand it too well, but now I do thank you very much
what're you trying to do with it?
because I want to simply change the color of a pice of text in the middle then return it back to the original color code
You can do that with getLastColors.
maybe loop through what chatcolors returns and apply them to the remaining string?
Just add the color string to the beginning of whatever other string you have.
yes, but then I want to apply it to the string
Why, exactly, do you need the enums?
You shouldn't need them. Just prepend the text with the result from getLastColors.
I want to reset the color
wait, what?
back to the color before the username
does this help? https://www.spigotmc.org/resources/chatmentioning.78956/
it like changes the color
beginning_text + username + getLastColors(beginning_text) + ending_text
Yeah... that will do it...?
here is the issue
this doesn't work lastColor = ChatColor.getLastColors(tempArray[i]); newMessageA[i] = ChatColor.AQUA+tempArray[i]+lastColor;
Show more of the code
just curious but why is the event async?
thats the default
lastColor = ChatColor.getLastColors(tempArray[i-1])
the sync one is depreciated
PlayerChatEvent?
oh crap I didn't even realize
yup
I wonder why it was depreciated
playerchat event was always deprecated tho haha
@pastel condor What is in lastColor when you tested it?
then why have it?
i dunno
I haven't used playerchatevent in a long time so I didn't realize
it just was to scare people from using it
I never printed it, but the return value looked like this #help-archived message
but it still has uses imo
that's a channel link
Is there any way to debug a server in the same way console.log works in google chrome? I need to be able to see all of an objects properties, methods, etc without stopping the server. I know JVM remote debugging exists but it slows my server immensely.
It doesn't slow your server, it halts it if you suspend the thread ^^
And no, that doesn't exist
Javas debugging is way more powerful anyways
Okay, thanks. Even when the thread isn't stopped, it slows down. When I do a server start/restart with it enabled it take five times as long to start ~5 minutes
@pastel condor just had an epiphany
sorry it's late but
white is the default color and might not be given by getLastColors
try with another color and see if it works correctly
What kind of potato do you run? Lol
Or wait, do you do remote debugging over the network,m
?
We are remote debugging over the network, but even when nothing is connected it takes way too long to load
The VM is sitting at 70% usage and the memory at 30%
It gets hung after Loaded 6 recipes
I can't check the network usage or view the command line unfortunately. We are using a 3rd party minecraft-only host so we don't have VM access or physical access.
Also, I changed the timeout setting like in the guide but whenever I resume the server (regardless of how long the break has been) it crashes "due to WatchDog hard crash"
How can I remove an area of blocks super fast? (without fawe)
Changing type through nms async?
