#help-development
1 messages ยท Page 31 of 1
More likely it is actually complaining that it cannot be null
getOfflinePlayer(x) never returns null. Intellij is not wrong
Use player.hasPlayedBefore() to validate its existence
Which as @warm mica Pointed Out would be correct
same issue
?jd-s lemme Factcheck the truth
Keep in mind that the method might freeze your server as it is doing a http request in case he never played on the server before
Why?
Isnt cached on the server
what a bad design
๐
Because it is accessing the Mojang API to look up the player name etc
I recommend you to access it on a separate thread
I'm using this code to try to make entities drop cooked food when killed. But it doesn't seem to be working. Does anyone know why? - Thanks btw
@EventHandler
public void onEntityDeath(EntityDropItemEvent e) {
if(e.getEntity().getType() == EntityType.COW || e.getEntity().getType() == EntityType.MUSHROOM_COW) {
if(e.getItemDrop().getItemStack().getType() == Material.BEEF) {
e.getItemDrop().getItemStack().setType(Material.COOKED_BEEF);
}
}
}
Of course spigot does Not specify what before means
?doesntwork
or loop through getOfflinePlayers()
doesnt do request tho?
How would I do this? Do I need to get Configuration sections and FileConfiguration.addDefault("thing", List<ConfigurationSection>) or something? And don't configuration sections need a name?
No, that method only returns all players that have ever played on the server before
You may initiate a new ConfigurationSection by constructing a MemoryConfiguration
ConfigurationSection section = new MemoryConfiguration()
Waiti think i have something like that 1m please
bump
And then I just do what I said?
are we supposed to do that when something doesn't work? Is that a bot thing?
๐คฆ
Yup. Simply but them all in a List and pass it to that method
Alright thanks!
public void reload() {
this.config = new Config(Crates.getInstance(), "crates");
Object object = this.config.get("crates");
if (object instanceof MemorySection) {
MemorySection section = (MemorySection) object;
Collection<String> keys = section.getKeys(false);
for (String id : keys) {
this.crates.put(id, (Crate)this.config.get(section.getCurrentPath() + '.' + id));
}
}
}
I have find that
?
Maybe can help you
What is it though
Its a method for loading crates
I'm not loading crates?
An example of what
That If Statement is kinda dangerous
Throw an exception and keep the old value of config
Here it would Just Go unnoticed If the value is either Not present or Not a section
I want en entity to float over another entity. Currently I am teleporting them over the player, but it does not look great. Is there a better way to do this
Tried this ```java
ConfigurationSection scheduleSection = new MemoryConfiguration();
scheduleSection.addDefault("time", 86400);
scheduleSection.addDefault("command", "example");
scheduleConfig.get().addDefault("timed", List.of(scheduleSection));
(`scheudleConfig.get()` returns a `FileConfiguration`)
And all I got in the yaml was ```yml
{}
Mounting:
TopEntity
InvisibleSlime
BottomEntity
What is top entity?
The entity you want to float above the bottom entity
hi
So I would have a slime riding a player?
Ant then a sheep riding a slime?
So,
@EventHandler
public void join(PlayerJoinEvent event) {
Player player = event.getPlayer();
ServerLevel world = ((CraftWorld) player.getLocation().getWorld()).getHandle();
CustomBee customBee = new CustomBee(player.getLocation(), ColorUtil.color("Bee"), true);
world.tryAddFreshEntityWithPassengers(customBee);
testbee.setBeeUUID(customBee, customBee.getBukkitEntity().getUniqueId());
Bukkit.broadcastMessage(testbee.getBeeUUID(customBee.getBukkitEntity()) + "");
}
This sets it on the PDC
however using the function you made for me, it doesnt actually include my PDC values in the output
If the top entity is a sheep yeah
Can I have a sheep riding that sheep again?
Technically yes
Then the pdc is not set
How do I make entities ride each other in the first place
Anyone else finds it annoying that YamlConfiguration#getConfigurationSection returns null if the section doesn't exist? I always use a helper method that auto-creates it before returning the section object ๐
Meh
Not annoying. Test it exists before assuming it does
You'd usually want to create it if it's missing
Nah
yoo 7smile is back
Not generally
either he has a sleep schedule like mine (wakin up at 10pm) or he just came home from work
public void setBeeUUID(Bee bee, UUID uuid) {
NamespacedKey beeUUIDKey = new NamespacedKey(this, "bee-uuid");
bee.getPersistentDataContainer().set(beeUUIDKey, PersistentDataType.STRING, uuid.toString());
}
public UUID getBeeUUID(Bee bee) {
NamespacedKey beeUUIDKey = new NamespacedKey(this, "bee-uuid");
if(bee.getPersistentDataContainer().has(beeUUIDKey, PersistentDataType.STRING)) {
return UUID.fromString(Objects.requireNonNull(bee.getPersistentDataContainer().get(beeUUIDKey, PersistentDataType.STRING)));
}
return null;
}
If its not set then it wouldnt return the value with my getter
From experience that is rarely the case
It all depends on what you are reading
^
Semester break. My sleeping schedule is all over the place...
declaration: package: org.bukkit.entity, interface: Entity
still a student?
Use set instead of addDefault
For both?
Yes
Yes. I already have a physics bachelor. Next semester is my last one and after that i have one in electrical engineering.
But im gonna append a masters in CS afterwards for sure
Same output
You'll have more degrees than jobs on your cv
๐
CustomBee PDC not working right
Smile could you please take a look at my thread #1003352471135080608 because you are the only one who have experience with mongo db
I might've missed your thread ngl
what means ngl?
not gonna lie
How exactly are you serializing the String?
wdym
How are you creating the output
join their thread
Which output
can any mob ride any mob?
We're talking about something else
How are you saving the file
config.save(file);
i would directly load a file which already contain the section created
And then just update their values
im confused when i use Location location = e.getClickedBlock().getLocation(); its rounding the location to the block that's near to the block i clicked
Made a custom thread for my bee issue so it doesnt get flooded @lost matrix #1003790393160237136
Want me to dm you my FileConfiguration Wrapper?
?paste
would be nice to figure this out its been forever
you can use this
For IntelliJ?
Does it work if you set something else? Like a String or something
I use Xcode Theme
Wdym
Like not using an integer and string and instead strings only?
Git, Minecraft Development
I don't know if you were looking at the light theme version, but I use the dark one that comes with it and I like it
No, if you put a random number or String instead of the List
Dont get mad
Just to test whether it works in the first place
I've succesfully used a configuration section with my wrapper before though, testing it now anyway
It still does the {} thing
(I set it to scheduleConfig.get().set("timed", "abc");)
Soemone have a link to get head (only face) with URL ?
exemple: head.com/username?=Steellgold
only face hmm
You want me to dm you the wrapper after all? I don't know how it'd be broken but I don't know what else could be wrong
yeah ik what you mean, trying to think
I cant remember if its a GameProfile/Skull method or some NMS method
Someone in here did it
i think it was you @drowsy helm ?
Ignore ping sry
They may be afk though
i finded: https://mc-heads.net/avatar/Steellgold
ah
Sure
is there a way to store a armorstands body part/position? kinda hard to explain but rn youd need to do armorstand.setRightLegPose(pos); for example is there a way to be able to put a enum or something to get what part of the armorstand wants to be moved cuz rn i use switch/case and a string like "rightleg" then move rightleg if its that
Is there any way for BungeeCord to hide the player count on the ProxyPingEvent?
yo
what you need?
If anyone else can give any insight on my PDC issue #1003790393160237136 pls
sorry the eprson figured it out like second i pinged you
they wanted front face of the player head
oh lol easy
nah ur good dont stress
how can i change the text above a player's head
I want to put some custom text instead of the username
FINALLY figured out how to include a gradle script
it looks so much cleaner than my other projects
https://github.com/orbyfied/j8/blob/master/j8s-command/build.gradle
yes
but its weird
you need to have bukkit save the entity
it has to convert the pdc back into nbt data
how
oof.
This did not work.```package knockbackffa.knockbackffa;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerToggleSprintEvent;
public class PlayerDeath implements Listener {
@EventHandler
public void onPlayerDeath(PlayerDeathEvent e) {
Player player = e.getEntity().getPlayer();
e.getDrops().clear();
player.updateInventory();
player.sendMessage(ChatColor.GOLD + "KnockbackFFA: " + ChatColor.GRAY + "You have died!" );
}
}
is the event being called at all?
why is the package knockbackffa.knockbackffa lol
The plugin is named knockbackffa and the package is responsible for handling knockbackffa
isnt that the only thing the plugin does tho
ofc. He a little confused but he got the spirit
yes
wouldnt use that formatting anyways
me.amogus.knockbackffa
would be better
amogus
sus
but ye that's how you usually name packages. I do the same
Same for all development companies (atleast the ones I have worked in). Ofc they replace the me with a country code and the name with the company name
yup module or functionality
but yea can i get support?
I hate multi module projects. They are so pain xD
meh
when including build scripts its very clean
all you need to make a module in gradle
oh shit
thats big
Yeah it's definitly more painful in maven
well that's me with gradle
i know like 1% of gradle but thats enough to get a simple multi module project up
i need help
ye it's not that easy once you start messing with build pipelines in gitlab and stuff like that^^
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
I cant upload screenshot
?verify
or use like imgur
nah you need a spigot account
oh and its !verify <account name> appereantly
!verify Hikamika
A private message has been sent to your SpigotMC.org account for verification!
this looks like a #help-server issue
"Cant connect to MySQL server
are you developing a plugin?
yes
you don't wanna paste DB credentials here I guess
dont worry
lmao
coding
did you try to connect manually from phpmyadmin or something like that?
programming
ah no, configuring
ok but noone knows here
I mean it's in the middle of the night for a lot of people
This wont work for some reason
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerToggleSprintEvent;
public class PlayerDeath implements Listener {
@EventHandler
public void onPlayerDeath(PlayerDeathEvent e) {
Player player = e.getEntity().getPlayer();
e.getDrops().clear();
player.updateInventory();
player.sendMessage(ChatColor.GOLD + "KnockbackFFA: " + ChatColor.GRAY + "You have died!" );
}
}
so youre not gonna get anything here either
and yes i have registerd
I was kinda confused
does the chat message appear?
lmao
yes
The event looks fine. It's probably just not registered
The You have dies works
Oh. what isn't working then?
You are not clearing the inventory. You just clear drops
youre not clearing thei nventory
For clearing drops you don't need the updateInventory() part either
Well the drops dont clear
Are you sure you are building to the right location and everything is up to date? (open the jar and look inside it)
wdym
Unless the updateInventory causes it to fail (which it shouldn't) I would not get why they don't clear if that's the code that's running
What I'm saying is: Rebuild the jar, stop your server, place it inside and retest. Maybe there's an old version running
okay lemme try
Long grass = sus
IT WORKED
I made a plugin that is like walking through tall grass in pokemon
Ty fabsi
yw, happens to the best of us :)
you walk through tall grass and there's a chance that a creeper spawns
sounds like a jumpscare plugin to me
Reminds me of a plugin that I made. One part spawned multiple creepers around you. Then they all started charging and right before they exploded they despawned again.
Was just one of many randomly occuring events triggered by a visible timer. Can be quite scary when you stop paying attention to the timer
does anyone know why every item i generate with itemstack even if its an axe has the same attack speed as your fist?
Is it only items you generate or also Items from creative mode and such?
only items i generate
In that case no. What are you doing inside your code?
im trying to generate some custom items for a private server
ItemStack sledgeHammer = new ItemStack(Material.STONE_AXE);
ItemMeta sledgeMeta = sledgeHammer.getItemMeta();
sledgeMeta.setDisplayName(ChatColor.GREEN + "Sledgehammer");
List<String> lore = new ArrayList<>;
lore.add(ChatColor.GREEN + "" + ChatColor.BOLD + "UNCOMMON");
sledgeMeta.setLore(lore);
sledgeMeta.setUnbreakable(true);
sledgeMeta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier("generic.attackDamage", 13, AttributeModifier.Operation.ADD_NUMBER));
sledgeMeta.addAttributeModifier(Attribute.GENERIC_ATTACK_SPEED, new AttributeModifier("generic.attackSpeed", -3, AttributeModifier.Operation.ADD_NUMBER));
sledgeMeta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
sledgeMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
sledgeHammer.setItemMeta(sledgeMeta);
return sledgeHammer;
}```
i had to put the attack speed to -3 to counteract the fist attack speed
what does AttributeModifier.Operation.ADD_NUMBER do? Never needed that to change attributes. Maybe that causes your issue?
the attribute wont apply to the weapon if that isnt on there
public static final AttributeModifier.Operation ADD_NUMBER
Adds (or subtracts) the specified amount to the base value.
Someone please tell me if this is even possible.
Saving inventory data at 1:1, when the data that can be in it may have custom modded NBT tags
we talking custom made saving or you wanna use something that's existing?
I'm currently just encoding the inventory into base64 and saving it, bit that isn't working well, so anything works
Sounds a bit weird that this is necessary. But if it doesn't work without then idk what's causing the attacked speed issue :( Is the attack speed normal if you don't play with the attributes at all?
no
In that case it is definitly possible. You will have to create your own toString (or base64string) and fromString functions tho
So even if you just create the itemstack and don't do anything else on the item meta besides name and lore it's still messed up?
Also you obviously can attack with an axe as fast as you can with fists. It just won't deal full damage. But I suppose you know that
Alright then, I'll take your word for it. I'll have to research a bit more into base64 to make this possible. Thanks.
Base64 just helps you with characters that can't be saved inside a certain encoding
means theoretically you don't need base64
Unless you have weird characters in the items lore/name etc
How would I convert the Map<?, ?> that FileConfiguration.getMapList() gives you into a Map<String, Object>? Can you just do (Map<String, Object>) map?
btw, i never had problems with base64
the getMapList returns a List<Map<?, ?>>
Yup. You have to loop/stream it and place it inside another map if you want a single one
list-of-maps:
- map: map1
- map: map2```
Yeah, the map in there. I don't need a List<Map<String, Object>> since I'm iterating over the List
so you already have the Map<?, ?> in the loop
Yes
and whats the question?
^
each map returned from getmaplist only has one entry. So just iterate over entrySet() (will be only one entry anyway) and cast your key and value
Wait wdym it only has one entry?
Depending on your yaml. If you just have
mapList:
- key1: value1
- key2: value2
each one will only have one entry.
My yaml looks like this: ```yml
things:
- thing1: 1
thing2: 2
shouldn't it have multiple entries?
In that case probably yes. Try calling .size()
So It does have multiple.
So How do I do this
But the procedure is still the same. Loop over entrySet() and cast key and value
Hmmm alright.
You might be able to cast the map directly. Can't guarantee so you would have to test that
I did and it didn't work so I was wondering if thats what was wrong. I'll just start a thread and send my code one sec
Hey! These are mostly naming convention questions but here we go. If I'm using gui do I use "GUIs", "guis", or "Guis", etc. (package names) If I have a package do i name the classes "MainMenuGUI", "GMainMenu", or "MainMenu", etc. Thanks
how do I use a \ in a String? msg = msg.replaceAll(":shrug:", "ยฏ\\_(ใ)_/ยฏ"); returns ยฏ_(ใ)_/ยฏ
escape it with another backslash
oh you already did. Weird
yeah it should work
I've done that too, works for me
You may have to quadruple back slash that one. Depends on what all is happening on your server and how chat is formatted, etc.
ยฏ\\\\_(ใ)_/ยฏ
I've had to \\\\\\\\ for regex before
In all likelihood, your chat is being re-formatted again or something
Oh, yeah, realizing you're using replaceAll()
Just use replace() and it should be fine
worked ty
Just use replace() and it should be fine
Better fix ;p
replace() > replaceAll() in like 99 cases out of 100
True. The names are very misleading
Extremely
Chunk not loaded = no entities
bump
how to load chunk of for certain location?
World#loadChunk(x,y)
that would be fine?
should also work, ye
Question:
Does this look correct to you guys?
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerJoinEvent;
public class DROP implements Listener {
public void onPlayerDropItem(PlayerDropItemEvent e) {
if (e.getPlayer().getGameMode() != GameMode.CREATIVE) {
e.setCancelled(true);
e.getPlayer().sendMessage(ChatColor.GOLD + "KnockbackFFA: " + ChatColor.GRAY + "You need to be in creative to drop items");
}
}
}
anyone knows how to disguise a player as a mob?
is there a way to use Block#breakNaturally without it dropping something
your class naming is.. questionable
his package is odd as well
It's named drop for a reason. DROP your standards
lol
:<>
wow. mean
Why not?
well why are they not
java.lang.UnsupportedClassVersionError: me/javaapp/test/Main has been compiled by a more recent version of the Java Runtime (class file version 62.0), this version of the Java Runtime only recognizes class file versions up to 61.0
<groupId>org.example</groupId>
<artifactId>JavaApp</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<finalName>JavaApp</finalName>
<plugins>
<plugin>
<!-- Build an executable JAR -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<archive>
<manifest>
<!-- <addClasspath>true</addClasspath> -->
<mainClass>me.javaapp.test.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<maven.compiler.source>18</maven.compiler.source>
<maven.compiler.target>18</maven.compiler.target>
</properties>
Whats wrong here?
you need a higher java version
Im using 18
according to the error message you aren't
it's programming plugin correlated question
Entities probably don't work until there's a player nearby :x Why not do your work in the chunkunloadevent?
your class is compiled with a higher version
yea
thanks :D
are game statistics client side or server side? (if they are server side, how do i access them?)
ty
here is the problem, my plugin removes armorstands in onDisable method, but when someone close server by force armorstands are not removed
so when plugin running again it check if there are old armorstands in the certain location
But then you could add it to the ChunkLoadEvent aswell
How can i disable fall damage?
ok i will try
Cancel EntityDamageEvent when damage cause is FALL
you might be able to get it to work with chunksnapshots aswell. But iirc they are read only
Isn't there a gamerule for that?
one way is to listen to playerDamageEvent and calculate if the hit will bring the target <= 0 hp then respawning him manually
Odd. Are you not on the right version or is there incompatibility or something?
another way is packets but thats too much to explain quickly here
What is a Solid Block's way of being powered?
In this Instance, a Stone blocks way of being powered
Its BlockData is not a instance of any of these "Powerable, AnagloguePowerable, Lightable"
wdym "Powered"?
As in redstone signal?
yes
Im having trouble making it realize its not powered anymore
My plugin un powers a lever automatically, and any redstone block around it realizes when that happens and unpowers, however this stone block and any other solid block, doesnt
It probably just needs a block update?
No you wouldn't update the stone block
You'd update the redstone components
The stone block probably realizes its not powered, but the redstone doesn't
pretty sure I already tried that but I can try again I guess :\
Just try putting the lever on a stone block connected to redstone, the lever turns off, place a block next to the redstone and see if it turns off
Do it manually in the game before you try to do it in code to make sure
i can try to explain it a bit if you rlly want. but my first method is so much easier
I did that already, the redstone only went off when i connected a new piece of redstone to it
or breaking a piece of said redstone line
Well that does seem like updates still... Interesting that it needed the line to be updated though.
very weird right
I don't know if thats normal behavior or not, but I don't think it is.
uhh targetHp - finalDamage <=0 ?
So you have tried just sending every block adjacent to the attached one an update?
bump
are you referring to block.getState().update()
if so, yes
I think so. Still not too familiar with spigot (normally use fabric). I'll check
๐
nvm
Wait that might not be correct
I'm talking about tick updating the block, that function seems to sync memory and in game
Even if all relative blocks state is updated it doesn't still work?
Yeah
block.getState().update() this is the method I've been trying to use to update the block, however, that is not the only thing I have tried
I have tried manually setting all relative blocks powered point, but it didnt work because for some reason a Stone block isnt an instance of "Powerable, AnagloguePowerable, or Lightable" which is what all normal redstone blocks are, so I cant manually set if its powered
not until i figure out what it inherits to do it
ok 1 second
Can you send a video or ss of your setup
do you want this to happen on any damage, or when another entities damages a target
restarting the server to add a couple of debug messages after that sure
if it should be on any damage here.
@EventHandler
public void onDmg(EntityDamageEvent e)
{
if (e.getEntity() instanceof Player)
{
// target is a player
double finalDamage = e.getFinalDamage();
Player player = (Player) e.getEntity();
if ((player.getHealth() - finalDamage) <= 0)
{
//player should be dead now
e.setCancelled(true);
//respawn the player manually
}
}
}
as you can see, any redstone block around it realizes its not powered, but any solid block, in this case dirt, doesnt
will work on a video
How do you turn off the lever in your code
if (block == null) {return;}
BlockData d = block.getBlockData();
if (d == null) {return;}
( (Powerable) d ).setPowered(false);
block.setBlockData(d);```
with block being the lever
Usually I coded something like this before but the lever is connected directly to powerable blocks which worked fine
Looks good
Continuing to show that normal redstone blocks unpower as expected
I mean if you wanted to go more hack-y with it, replacing the block with a matching unpowered lever might circumvent this bug
I mean I could try that, its just weird that I should have to do anything other than what ive done
Yeah that is really looking like block update issues. And when I said you tried updating every adjacent, you tried updating everything adjacent to the solid block right? Not to the lever?
yup
Its really weird
Could something else be interfering?
nope
dont have anything that has anything at all to do with redstone
and I know that for sure because most of the plugins I have on this server I have looked at the source code for
Have u tried putting the lever at the side or opposide side of the dirt facing the redstone
bump
Does an observer trigger on the redstone and/or the lever when it turns off?
The redstone its connected to, that stays on, doesn't trigger an observer?
I dont see the redstone wire as a relative block
From the debug messages
If they can be updated to be not powered
ill extend the updater to do a 3 by 3 by 3 cube around it if you want
Sure
the updater doing the relatives of attached would be better if possible
ill do that then sure
would be simpler with my current setup anyways
server is restarting with the changes now ๐
Did you put only that in?
just cancel the death event
Did u update the blockstate of the redstones beside the dirt, seeing from the video you are using thee relative blocks around the lever
I actually do it in my minigame
Oh interesting, the new method of updating the blocks appears to have worked
use PlayerDeathEvent and do e.setCancelled(true)
Yeah all your doing is cancelling the damage lol, you need to respawn the player too
when you cancel the death even it auto respawns yo u
Possible bug: Try putting a crop right next to it.
I tried this previously but only tried using block.getState().update(), which had no effect, in this instance I had it catch for any type of redstone block and manually unpower that which appears to have solved it
and you can kind of just tp or something from there
wym?
nvm then
Just need to update the wire states
Though with this, try having it powered by two sources and see if it unpowers incorrectly
Try updating it after?
with?
every "update" has done nothing, the only reason this time it semi worked was because instead of trusting minecraft to update blocks properly I manually set the powered value
Yeah try after not trusting minecraft, trust it. Maybe it prefers power?
I'm doing other research atm as well to help you
I mean I already am, I guess ill make it update it 1 tick after I manually set it, I tried the same thing for unpowering it but who knows maybe it will work
anyone have a solid video/tutorial on how to make a database with a local file, not where we connect to a mysql server if yk what i mean
sqlite?
Why would you need a database in a local file?
yes exactly, forgot the name
some networks don't like hosting databases
I made a whole storage system with that in mind
i find it easier, id rather not setup a server + the way my server will be hosted will make having a mysql server a massive pain
yeah but this will bug out if the wires are powered by another block as shown above
where I can store data into proprietary files, sqlite, up to s3
why does redstone & block updates hate getting along ๐ฅฒ
I mean technically a redstone tick only happens every 2 ticks, maybe thats why
Thats another case you gotta handle, seems normal to me since only 1 wire is being updated
so make it try to update it after 2 ticks?
Not exactly? I mean maybe you could try updating it 2 ticks in a row and if thats the reason then 1 will be on the correct tick
Can anyone help me #1003790393160237136
If you just delay then youd still miss it if thats the issue
Bump
https://www.spigotmc.org/threads/set-handle-of-lever-on-or-off-not-working.406075/
According to this maybe just try adding a small delay and then updating?
I tried flipping a lever with a client-side fake block
idk why but it also refused to update in my case
my man
there are some events you can't cancel
Y2K you dumb
๐คฆ
in this thread the person is having trouble setting the state of the lever, which I have working fine, and not even to mention, mine is already on a scheduled task
@echo basalt any other ideas on my bee thing
well
beehives like to delete a lot of data
maybe external storage
or modifying the save method for some extra tags
try saving onto the compoundtag directly instead of going through pdc
Do you have a simple example of that?
PDC is something declared in the bukkit layer and doesn't transfer onto nms
How would one make a BukkitRunnable loop? What I'm trying right now errors since it's already scheduled when I try to again
Don't use BukkitRunnable
Oh?
Bukkit.getScheduler().runTaskTimer(plugin, () -> {
// Your code here
}, 1, 1);```
Where's the entity argument?
This is an example of a task that runs every tick
this is on the custom entity class
You can tweak the last two parameters to change how that works
Is this a general statement or a statement for this case?
How does one cancel this?
General statement
It returns a task ID
Which you can cancel
Wait actually it returns a BukkitTask
Which you can call cancel() on to cancel
What would one use instead of BukkitRunnable for a delayed task?
@Override
public boolean save(CompoundTag nbt) {
boolean returnVal = super.save(nbt);
nbt.putString("bee-uuid", uuid.toString());
return returnVal;
}
?tas
Bukkit.getScheduler().runTaskLater
unless save is called by default if it exists
Hm. What I read seemed to suggest that was worse then making a BukkitRunnable, thanks
Why
Guessing I also need a load @echo basalt
yeah why not
Let me guess, you were using a BukkitRunnable like this:
new BukkitRunnable() {
@Override
public void run() {
// Your code here
}
}.runTaskTimer(plugin, 1, 1);```
No
Which is much longer and uglier than:
Its its own class
Bukkit.getScheduler().runTaskTimer(plugin, () -> {
// Your code here
}, 1, 1);```
That's even more boilerplate
You can just use a lambda
Its easier for what I want to do :)
How
Plus if you don't want boilerplate then why are you using Java?
Variables independent to instances
A lot of work has been done to reduce boilerplate
see i've used BukkitRunnable for 3 years bc i didn't realize the schedular existed, i can fully say for the love of god use Bukkit.getScheduler()
You can easily do that without a separate class
Oh I'm not saying it is. It still has a lot
But suit yourself
Eh Its easier this way
It's really not that much if you know what you're doing
~lambda~
True. Compared to other languages I program in, it is.
Not exactly...
Python?
C++
Let me first write all my functions in a header file and then again in a cpp one.
Thats boilerplate.
Yeah I hate that about C++
No, very much dislike python. I use Swift
Hah
Similar enough to be fair
yeah when i first started working with unreal that was very very annoying
There are a lot of things I hate about swift though
Most people
very very difficult to use smth like java after python/swift/etc
Not really
its much more structured
Swift is comparably structured
Somewhat, yeah. Only reason I started learning java was for minecraft, and wish I could use swift more
Try kotlin
It is, but its also much nicer then java
If you're used to swift kotlin will feel right at home
Eh, debatable
It's less mature and has a lot of things that piss me off more than java does
Fair enough
Like what? Out of curiousity
Well python and javascript are both not preparing you for strongly typed languages very well.
And objects are also very very soft there.
So not a good foundation
Argument labels are extremely annoying
^^^
It can throw out of bounds exceptions with no stack trace (segfault anyone?)
You can remove them?
Ooh yes I hate the stacktraces
And doing so on your own is pretty ugly too
Yeah
@echo basalt its still not saving omg
i love stacktraces lmao, much more info then smth like python
Java stack traces ๐
Swift is bad at crashing, but it doesn't as often, so you win-lose
Oh and the string manipulation in swift SUCKS
Oh yes I love java stacktraces, I was saying I hated swift ones
You talking about string indexs...
Which is a huge issue for someone like me who loves string manipulation
Yep
hi, can I ask help?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
Java's string manipulation is quite good except for the O(n) substring
Thanks
Yeah swift is not without its problems but I still do prefer it to most others I've tried
Mostly because it just gets out of the way
That's all I really want for string manip
I think every language has its own issues, and to be honest java's just the one I feel most at home with
Yeah string manips such a pain in swift, I typically just make it a String.Element array and work on that instead
The problem i have with swift: Its associated with apple. This filthy, scamming, garbage company.
lol
I would love swift if not for those 3 things
But those 3 things are all so bad
Like, even worse than java's major issues
Is this right?
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.player.PlayerMoveEvent;
public class BitchyFallDamage implements Listener {
@EventHandler
public void onPlayerDamage(EntityDamageEvent e) {
EntityDamageEvent.DamageCause fall = EntityDamageEvent.DamageCause.FALL;
e.setCancelled(true);
}
}
Swift is open source and I wish.... so badly people used it as that.
In my opinion at least
Try it and see
oki
yk thats not proper class naming convention smh
Not sure what you're trying to do though
wdym
You can not find anything to do swift outside of apple which I wish was changed
No. Not even close.
Fair enough
What are you trying to achieve?
Only for players?
ye
Oh, then
e.setCancelled(e.isCancelled() || (e.getCause() == DamageCause.FALL && e.getEntityType() == EntityType.PLAYER));```
i feel that i am dumb
e.setCancelled(e.isCancelled() || (e.getCause() == DamageCause.FALL && e.getEntity() instanceof Player));
What do you not understand about what's going on here
That won't work
That will uncancel any cancelled damage event that is not against a player
Ok so then you have 2 conditions you need to check:
Is the damaged entity a player?
Is the damage type FALL
What do you use to check conditions in pretty much any programming language?
You have the parentheses placed wrong
ah oops
think i just fixed it
๐ค
he is our all knowing lord and savior
imo though if nothing else extensions make up for it. It is so useful. (Plus the thing you said about argument labels, you can turn them off using _)
Its a way of saying "Who fucking cares"
I know you can
But only for your own functions
Ah true
What
thats very rude young man!
If you're gonna insult people then you can just leave
We're not going to offer help if you wanna be like that
god i love better discord
I already gave you the literal solution, and 7smile is trying to walk you through a simpler one
I'm not mad I'm just telling you that you shouldn't be insulting us
Anyone

Wait it's not even the same person lol
They both had a default pfp so I mixed them up
He is not even the one that asked the question XD
Yeah lol
Rude dude just comes in to troll
๐
"Insulting people is rude"
"ok snowflake"
Owning the libs
help i can't see custom emotes anymore ๐ญ
Keep it up mate you're doing great
You cant just be literally insulting people and then call them snowflakes. Thats not how this works...
No you don't understand
Freedom of speech means that I get to say whatever I want and you can't respond in any way
Only snowflakes respect people
wait hol up, does this server not allow emotes from other servers?
why did spigot fall?
It does not
#general
Elaborate?

Yes it does
smile whats that comamnd to your workload thread
booster moment
Nitro boosters get to use custom emotes but the rest of us don't
?workdistro
Right
which would you suggest for structures
Go on your queerphobic rant now
rn im having trouble with lighting updates :/
I'll wait
spigot is down ๐ญ
rip
๐
Bullying queer people in a spigot help channel to own the libs ๐
And pretty pointless
ban people too
๐
Difficult. lightning update problems usually occur when you place blocks without physics.
You can place the blocks using a fast method, keep track of all chunks and trigger lightning updates after everything was pasted.
How does BukkitRunnable.runTaskTimer() use delay and period? Does it wait delay the first time and period ever other time, or delay + period the first time and period every other time
here ill show what i currently have
First one
Delay is the initial delay
thank
Period is the time between each successive run
declaration: package: org.bukkit.scheduler, class: BukkitRunnable
How did I not know about this... Thanks
What is a gay flag?
You mean the javadocs? 
There's a lot of flags because there are a lot of queer identities because people are complicated
How are they "gay flags"?
Maybe...
I may or may not have been using only the source code...
first off, i just wanted to make sure my process was correct
That's the asexual spectrum flag
i hadd all the workloads to the roomplacer
I like the way it looks and I fall on the asexual spectrum
Which means I'm not sexually attracted to anyone
I'm eager to hear you tell me how my lifestyle is diseased or whatever
Try it? I'm not sure, haven't done stuff like that before
is there a spectrum for when no one is sexually attracted to me
or is that just called "being a developer"
I mean, asexual people can want kids
Controversial opinion: lgbt is understandable. Everything after that is very questionable.
But I don't
Like what
q+
Asexuality?
the a is understandable
So what's not
i mean its not really up to one person and one hot take to invalidate experiences
there are societal pressures that go into identities
^^^^^
its not just a biological thing
r/onejoke
apache attack helicoptor mumbo jumbotron aethiest gigachad is an example
can someone ban this idiot?
one could say that nonbinary doesn't truly exist, but that doesn't acknoweldge the immense societal pressure there is towrads gender norms
An example you made up
But ok
I don't think you can ban someone for having a shit opinion
Sure can
being an idiot is not illegal
true
anyways i came here to get help with my structure placing :/
I doubt the staff will just ban someone for being an idiot
It's not really "having a bad opinion" it's "harassing people for being queer" lol
Well... yeah. Really depends on the person. But im having a hard time
tolerating the + when its being shoved down my throat. Just live your life like you want
but dont force me to participate.
Okay look at the demon people on tik tok then as an example
Demon/demonsexual
What do you mean
๐ this is getting a bit out of hand
I am?
fr
Done. That felt good.
๐
that was too far lol
thankss
I don't really have any context on it but it does sound pretty dumb
Some people are dumb
It happens
Serious Spigot and BungeeCord programming/development help | Ask other questions here
It doesn't automatically invalidate any other identities though
this is a serious spigot question
and im not invalidating them
yea yall making fun of tiktok leftists is the easiest thing ever
You can't just categorically say every queer identity other than lgbt is fake
this chanel is just general when there are no questions
Redempt searching in the shadows for bigotry
theyre so cannibalistic about their leftism
Exactly lmao
its just insane lol
How was I even searching
The dude literally looked at my banner and decided to insult me about it
i need help ๐ฅบ
I've once lost a job because the owner was shoving a gay lifestyle into the work culture and it felt obnoxious
so I told the dude to chill out
whats your question
How so
That sounds messed up
.
around here ish
I have:
But what do you mean by "gay lifestyle"
Cause it's not really a lifestyle it's just a sexuality
hooters?
struggling with optimizing placing structures ina good way
because lighting updates seem to just terrorize the server
for reference, i need to place around 100 structures with various sizes
taking every aspect of every individual moment of their life to explain "how gay" something is
Technically speaking
oh god thats way above me lol.
Whoa
Or starting a conversation by saying "Watched a movie where the main character was gay"
Are you making a modular base building system?
yes!
Noice
I mean, that's fine?
If it's over the top that sounds annoying
It was over the top
Alright
And pursuing all staff members to have lgbt flags on their profile pictures
they just mean the gay voice
But what I would like you to understand
Regardless of their stance
Being annoying is a problem
Forcing people to fly a flag they don't want to is a problem
I guess depending on the flag?
i see regular gay people in movies that have higher pitched voices and all the sudden the cishets are screaming about how gay the person is
its like ๐
But like
Being gay is not a problem
You have to separate these things
Identifying as demonsexual is probably just kids being kids
You gotta understand there's a lot of children on the internet and children are pretty dumb
He was an employer
It doesn't give you a pass to invalidate swathes of genuine identities people struggle with
That ran a business
Nobody sane since decades says that being gay is a problem. Being obnoxious is.
What he did is uncool
That is so untrue lol
There are SO many homophobes out and about
Like so many
Nobody sane since decades says that being gay is a problem. Being obnoxious is.
Forcing every single employee to rock a flag and docking their pay if they don't was my problem
Sure
Being obnoxious is an issue
Straight people can also be obnoxious
It's not unique to queer people
Imagine pushing lgbtq on a children's block game
And it doesn't give you a pass to invalidate their identity
What do you mean exactly
Im reading
it doesnt make sense, never understood it
Who's "pushing lgbtq"?
no one you irate ape
And what does it even mean to "push lgbtq"
I was just making a statement, I see it happen often
What are you saying? XD
Then said you see it a lot
bri'ish
nice
wales
Are you amused that he is hungry?
Portugal
I have heavy bones 
some people have weird kinks
dont shame
yes I would quite like to be hungry right now
i just think its so easy for yall to attack queer ppl just cuz of kids on tiktok
Yeah it's very easy to cherry pick
i could do it too
just gotta recognize the bullshit
also
just not even care
it dont matter
should I make pot noodles or eat one of my 19 cans of tuna ๐ค
literally dont matter
What do you mean "doesn't work"
I feel like most people on tik tok have a net iq of like 100 combined
most people, including kids, can see thru the weird stuff on tik tok
Does nothing happen? Is there an error?
i work with kids, theyre smarter than people give them credit for
?dontwork
You need to run it a tick later
whatever the command is
?notworking
woah
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
imajin knows something
"Does not working"

new BukkitRunnable() {
@Override
public void run() {
player.spigot().respawn();
}
}.runTaskLater(plugin, 0L, 1L);
Something like this
MYc odes DOES NOT WORKING
bukkit task
sheeeeesh
No
wtf
bukkitrunnable
no?
I forgot the fucking api
redempt gonna yell
I need to finish kits for my plugin :L I'm so distracted right now I'ma take a break
Bukkit.getScheduler().runTaskLater(plugin, () -> player.spigot().respawn(), 1);```
Fuck BukkitRunnable smh
getSchedular isnt optimal all the time
Deprecation ๐ฉ
discord mod for a dev community
doesnt remember dev api
Is it deprecated
okay cancel the scheduled task inside the task
its not cancellable
It's not deprecated