#help-development
1 messages · Page 467 of 1
what's 9 + 10
39
21
I mean there is a simple solution to that
accurate
Never divide
just having + and - is boring
Hey
just open an 8th grade math textbook
Don’t leave out X
Wait i did some uni stuff earlier, ill give you a question i found nice
He didn’t go to that
me omw to fail school 
my final project is due in 2 weeks and I have a "hello world" program done
Does that meet the criteria
no we've had like 6 months to work on it
What if you write it in assembly
Solve this differential equation using a laplace transformation
It looks bad but the solution is very clean
20s timer starts now
this makes me want to driink hand sanitizer
20s timer with really stressful music
Like the drowning music in the old sonic games
A heartbeat that gets faster with an abusive dad in the background yelling the
question at you
Now I want to commission someone to make the most stressful music ever
All for a fairly relaxing game like minecraft
if you've ever played rhythm games, freedom dive would frighten the fuck out of you
Eh i should continue studying... Discord distracting as always
I feel you. I need to wait for the pixel artists in between as well 
small price to pay for multi-server live updating
I came up with something really neat for that
Resource packs are all the rage these days
If your server doesn’t look like origin realms then it’s trash
Go sit in the dumpster and think about what you’re done
Exactly
my issue is just updating and displaying it
I honestly feel like resourcepacks arent needed for a server to be good
Look at Hypixel Skyblock. They didnt need one.
No of course not
because my team member was a bitch and decided to just make every menu a new WhateverMenu(plugin).open(player)
But damn to players want them these days
no interface no nothing
so I made a lil interface and a registry where I can do stuff like
updateMenus("code-management", group::containsPlayer)
and it will update all the code-management displays that the viewer is a part of
My teammate rolled his eyes and told me im exaggerating
But that sounds like a pain
yes indeed
and I was like
"ayo you got time? take these 2 interfaces and do shit" and the dude just replied "that's really smart"
Hehe
anyways it's 5am and I've worked maybe 6 hours this week so I decided to do it myself
and I kinda regret it already
but at least I'm getting cash money
didn't spend much this week
maybe I'll have enough cash to skydive next week
We'll know if you dont show up anymore
what the hell is a sealed class
It’s a class filed with seals
It basically means you can set what classes are allowed to inherit it
Bukkit could actually get some use from that by restricting people from implementing various interfaces
imagine when bukkit makes InventoryHolder a sealed class
But I don’t think MD would jump to java 17 just for that
doubt anyone will remember honestly
I'm literally just the guy that redirects everyone to your tutorials
Could also seal listener
ahem
Yes?
seals are so cool
He partying
That is so real
best commit messages: "fikxed ishuez", "fix", "add", "mmm mayonaiz", and last but not least "woops forgot to commit this ¯\_(ツ)_/¯"
"small changes" -164 files changed -43 files added
Hi I am new to spigot api. I am making a duels plugin.. Can someone help me to make a waiting lobby? Max player is 2 and min is 2 if it meets the requirements it is gonna start, and teleport players to a given location. If it dosen't the players either will stay or will exit they lobby. The player enters the lobby a command.
Create a lobby class.
Add a Set<UUID> in it
When you add players, check the set size
if it reaches N you teleport them
And dont forget to remove them from the set if they leave the lobby or server
I didn't understood set<uuid>?
You need to learn the very basics of java before you can start writing plugins.
So all primitives (int, long, float, double etc)
Control from (if statements and maybe switch statements)
Loops (for loop and while loop are enough)
Collection framework (List, Set and Map is what you should know)
Basics of Object orientation:
- Whats an Object
- Whats a class
- Whats an instance of a class
I understood every single thing you listed here except Collection FrameWork
A List is a collection of elements
[1, 2, 4, -2, 3, 3, 2]
They can be accessed by index and allows duplicates
A set is the same as a list but it doesnt allow duplicates
(1, 2, 4, -2, 3)
It also has no index access. But contains(), and remove() are
really really fast for them.
Maps simply map a key to a value
{"x": 10, "y":-3, "f": 77, "gk": -3}
You can access a value by providing a key.
It follows the same rules as a set as in: No duplicate keys are allowed
Thats all pretty much.
Thanks
So to keep track of who is in a lobby, you simply create a Set<UUID> containing the players
UUIDs which are in the lobby.
So its gonna be Set<UUID> playersInWaitingLobby = New HashSet<>(); ?
Pretty much
yo guys, im tryna add a local jar to my final plugin jar, this is a plugin that i depend on, and its provided at the runtime.
this is my pom.xml
<dependency>
<groupId>online.viestudio</groupId>
<artifactId>api</artifactId>
<version>1.0</version>
</dependency>
However, when I do maven clean install it says cannot access online.viestudio.api.EconomyApi
When you add a player you simply check the size of the set
Is the jar in your local maven repo?
Indeed, I used a command to install this jar to maven
Is there way I can check if its actually there, it did say build success in the command.
Show the (exact) command
mvn install:install-file -Dfile="./FCuc.jar" -DgroupId="online.viestudio" -DartifactId=api -Dversion=1.0 -Dpackaging=jar
Yeah looks good to me.
Check in your .m2 repo if the file is actually there
Depends on where you isntalled it
Default is /home/username/.m2 i think
Which IDE are you using
IntellIJ
Nope, getting the same error when doing mvn clean install
However IntelliJ doesnt show any errors, like in the code the classes are there.
Its just maven
Ok its intelliJ which is trash, i tried mvn clean install in a terminal window and it worked.
Sounds like you botched your project structure
i have barrel that has hp when ever i hit them i want a title to display their hp what would be the best approach for that?
the hp is in the pdc
no i mean like
a
title floating in the air
with like a armor stands name or somethng
not quite sure how its done
Display entity
whats that
hologram? lol
You should switch to display entities now
used to be but we have display entities now
and Spigot has API for it
if you are using 1.19.4 that is ofc
yes
im on 1.16 rn
rip u, armor stands it is
Time to update 😄
In 1.19.4 you can even give the barrel a hitbox with interaction entities
damn
1.19 seems cool
may try it out later
latest version is always cool
I guess you can listen for arm swing, ray trace the target block and then simulate a hit.
For the health display you can use a marker armorstand
how do you create an empty persistent data container
You need a PersistentDataHolder and then call getAdapterContext().
With this context you can create a new PDC using newPersistentDataContainer()
who is smart here
Nobody
damn
i aint
will it be empty?
Go somewhere else
Yes? Every PDC is empty on default.
what is it that you want tho @obsidian plinth
am i allowed to send a class thats like 30 lines for help
do the link thingy
?paste
thx
its ment to track when a player places a amourstand it takes the gear off the oppponet and puts it on the armorstand
does a armor stand count as a block when its placed?
so like can you get it with block place event?
its onEntityPlace
its 100% onEntityPlace
First of all: I would make Move generic
package com.person98.blockbattlesbase.movelogic;
import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityPlaceEvent;
import org.bukkit.event.entity.EntitySpawnEvent;
public interface Move {
void handleMove(Player player, Player opponent, BlockPlaceEvent event);
void handleMove(Player player, Player opponent, EntityPlaceEvent event);
}
thats move
public interface Move<T extends Event> {
void handleMove(Player player, Player opponent, T event);
}
And thats move but generic
public class ArmourStandMove implements Move<EntityPlaceEvent> {
@Override
public void handleMove(Player player, Player opponent, EntityPlaceEvent event) {
if (event.getEntity().getType() == EntityType.ARMOR_STAND) {
ArmorStand armorStand = (ArmorStand) event.getEntity();
transferGear(opponent, armorStand);
}
}
You dont need to create a million methods for different events.
anyone here speak russian?
i cant take this google translator conversations anymore
i only need onblock and on entity for this
Alright then. Whats your concern with the current implementation=?
its not taking the gear off the opp and putting it on it
are you getting the right player?
good point ill add a log rq
Add debug messages and check if the handleMove mthod is even called.
Im guessing the listener is not registered or something like that.
Everyone is having things around their pfp 🤔
new nitro feature
we get it for like 2 weeks then it will get removed again
just like crissmass
i dont use apis so idk
InventoryFramework (IF) is the only one I know and have used
I am using IF right now but its a bit weird
ChestGui gui = new ChestGui(3, "Island Manager");
OutlinePane pane = new OutlinePane(0, 0, 9, 3);
Write your own
https://www.spigotmc.org/threads/a-modern-approach-to-inventory-guis.594005/#post-4553427
how complicated can your gui be that you need a api anyways
My code to create the GUI, I add some items to it
i like guis
But this is the output
How to add an outline thing
sorry its 4am im tired
whats that
well have you ever tried them outside of spigot? trust me try to do a gui in a normal java window and you will beginn to develope a deep hatress
what do you mean "outline thing"
It's not weird, it takes time to learn. But once you master it you will never go back...
he means glass around ig
Im working on the gamemode blockbattles for a tiktoker and it allows players to pick what items they want if they are unlocked and when you stand a batlte you chose a deck
you know like the glass panes
just add the glass panes as items
OutlinePane does not put an outline around your pain :p
That's not what it's for
you can also just fill every free spot with glass thats faster
Well is there smth I can do to add them
or even faster:
Yes you just have to put a bunch of glass yourself in the main pane, then put a different pain on top with your actual clickable buttons if I remember correctly
fill every single slot with glass first and then replace the ones you want with your items
thats how i do it atleast
pretty easy
just get the armount of slots
and then
fill for every slot
after
do your normal code
it should replace the glass panes
IF
you specify a slot
How can I do stairs.setFacing() for both down and south?
thank you
thank you too
mu probelm was i wasnt tracking what player palced what stand
now i have to read a doc ew
or imma yolo and assume getPlayer() works
well depends where you put it
if you get the player from a event it will get the player that caused the event (event.getPlayer)
Player player = event.getPlayer();
if (event.getPlayer() instanceof Player) {
Player player = (Player) event.getPlayer();
worked
but i broke more crap somehow
and am crying inside
why would you test if the player is a player
@EventHandler
public void onEntityPlace(EntityPlaceEvent event) {
if (!event.getEntity().getWorld().getName().startsWith("battle-worlds/")) {
return;
}
if (event.getEntity().getType() == EntityType.ARMOR_STAND) {
ArmorStand armorStand = (ArmorStand) event.getEntity();
if (event.getPlayer() instanceof Player) {
Player player = (Player) event.getPlayer();
UUID playerUUID = player.getUniqueId();
playerArmorStands.put(playerUUID, true);
player.sendMessage("nerd");
}
}
}
good point lol
A Map<T, Boolean> can almost always be replaced by a Set<T>
i mean it works sorta so
event.getEntity().getType() and wouldnt that also get the player? not sure if it gets the placed entity or the entity that caused it
Thats for the placed entity
the doc said getplayer
oh okay
nred
lol
How is the playerArmorStands map used?
i love one thing if i make this false true it breaks every move
if (armorStandListener.getPlayerArmorStands().getOrDefault(playerUniqueId, false)) {
return new ArmourStandMove(); // Replace with your ArmourStandMove implementation
its ment if a player is it in to swap turns than remove them
yes
no im dead serious i have to clue what you tried to say x)
if a players uuid is in the map it swaps turns and removes them from the map
oh okay
better then nothing
*than
than i can rework ArmourStandMove
*then
fuck it ur my 13th reason
yes
let me be your 14th
lol

*you're
lmfao
ur = your
youre
u r
-> you are
abbreviated -> you're
is this the english class for beginners? 
Thats something even native speakers scramble up.
Together with 'a' vs 'an'
thats true
ive corrected natives about that so often
im sometimes suprised how little their know their own grammar
they*
guys im loosing hope
that said enough ig
i need a english to russian translator
google isnt doint it for us anymore
why cant russians just speak propper english
the same for Japan/China ppl
russians are just florida people who went higher up in their skill tree 
china people 
indeed
back to spigot
quick question
if i cast breaknaturally
can i stop the item from dropping
Mining a block or entity?
block
i click a block
inside the playerclick event the block is supposed to break
by
block.break naturally
but i dont want the block to drop
i would send my code but its 200 lines and 99% of that is other stuff
?paste
event.getDrops().clear(); (for Entity)
Block block = event.getBlock();
block.setType(Material.AIR);
I am using this for Block mining
Might have to set type to air and spawn particles yourself
OR look how breakNaturally is done
And remove the drops
Probably a nms method so. Ewhere
bruh whenever i click on commit and push, the check goes away and it says select files 💀 💀
cant even push my own files
skill issue tbj
yeah i need a way to add to every Purpur_Block a customID
When you placed on like X27-Y90-Z10 it will get info from the location but like when someone breaks the block and place is somewhere else, it need to have the same ID
dang
also naturally generated ones=
?
it only pushed the files i dont want 💀
no uhh like, Its a "Miner block" and you can upgrade the tier etc
but if i mine the block and place is somewhere else
it gets a new ID
just add a pdc and cancel the block break event and then drop the block you want it to be
but it need to be the same ID
get the id from the block that is being brocken and then paste it into the one being dropped
int id = minerblock.getPersistentDataContainer().get(new NamespacedKey(plugin, "id"), PersistentDataType.INTEGER);
and im back again
you understood or you want a more detailed example
i only trust my old .gitignore file now
Hey guys trying to set the player's hunger bar using protocollib
Currently the HP portion of my code is working but i'm not sure why the hunger part isnt working this is what I am currently doing
float hpAmount = ((float) currentHP / totalHP) * 20;
int mpAmount = (int)((currentMP / (double) totalMP) * 20);
health.getFloat().write(0, hpAmount);
health.getIntegers().write(0, mpAmount);
health.getFloat().write(1, 0F);
try {
protocolManager.sendServerPacket(player, health);
} catch (InvocationTargetException e) {
throw new RuntimeException(
"Cannot send packet " + health, e);
}```
i use stuff like to to track when a move is played
if (armorStandListener.getPlayerArmorStands().getOrDefault(playerUniqueId, false)) {
Bukkit.getLogger().log(Level.INFO, "Player " + playerUniqueId + " has placed an armor stand");
return new ArmourStandMove();
} else if (obsidianCount >= 4 && amethystClusterCount >= 0) {
return new AmethystWarpMove(plugin, warpsDir, this);
but the ```js
Bukkit.getLogger().log(Level.INFO, "Player " + playerUniqueId + " has placed an armor stand");
and if i make it true it only allows for the single block moves to count
fuck it imma sleep
i lied imma play stardew
heeheehee my old code
and when a player place the block it hold the same ID?
i would have to try that 1 sec
i can also link it to a GUI right
yes i just tried
you can check for the id every time its clicked
and if it matches the id the gui opens
so yes
and every purpur_block got his own id then right
you can generate them ig
okay ty
yeah
it will be a robot that can mine ores
and you can upgrade them to higher levels
oh so you save the lvl of the robot and with the id?
yes
why dont you just write the lvl of the robot AS the id
so you add the pdc lvl and then what lvl it is
or is there anything else that you need to save?
yeah the ores inside the robot
you could add ever info as a pdc
so they dont duplicate etc
okay
a custom name, upgrades, lvl, inverntory
what ever you can imagine
and when ever it gets picked up it reads it pdc and drops it with the same ones
wtf was i doing lol
Need help with creating an API
and the best was that it didnt even work
every time i see try catch i alredy know its about to be a disaster
Hey, I'm trying to get a PotionEffectType by a string. I tried PotionEffectType#getByName() and PotionEffectType#getByKey() but none seems to work (API 1.19.2).
Even with pre-created PotionEffect this isnt working :
PotionEffect potionEffect = new PotionEffect(PotionEffectType.BLINDNESS, 40, 1, true, false, false);
System.out.println(PotionEffectType.getByKey(potionEffect.getType().getKey())); //returns null
Make sure api version is set in your plugin.yml
Why lol
Why is sendMessage crossed out that way?
Is there a better way to send messages?
othr ways but not necessarily better
Paper probably
i think i will never find any GOOD tut on yt about saving block data etc
they deprecated string methods to favor adventure and minimessage
why catch an error judt make sure there is no error in the first place
No that’s not really how it works
i would say you use a tile entity instead
easier
you have errors like io ones which is stupid if u don’t handle at all
Is not that easy ahah
maybe not in spigot ig
The users of your plugins can surprise you by testing your plugins.
In any language that provide a sophisticated std library with for instance file IO
You ought to have some way of dealing with exceptional cases
That is when a method does not fulfill its contract
But personally I do think Java’s try catch finally can be a bit hard to read and maintain at times
However I don’t know any better alternatives to checked exceptions and and try catch in the way Java is doing it
Like rust have Result, but its a compromise of leniency and responsibility
well i usally just do a bunch of if check to see if everything is provided properly in the way i want it to be provided
you dont. ez.
Ig that’s one choice
Can you give me a quick example?

You can probably use sendRichMessage
no?
Yeah all good (:
you seem like a good dev what languages do you think are worth learning for the next years
in terms of job opportunitys
Brainfuq
learn smth which makes you understand how systems work on the low level
Rust, TS/JS, Py, (Cpp), Csharp
name one to start with 🥲
Befunge
Rust
Not one of those esoteric languages lol
Piet
They’re fun but quite meaningless
which ones?
Awww
Haskell it
Cobol it is
Except when U want to Work for banks
Atleast Most German Banks still use ancient cobol
If i remember correctly
You'd never get a job working for a bank using Cobol these days. 20 years ago yes
not really
the bank in my city even looks for cobol coders
lots of jobs for cobol at banks, large super market chains, etc
Because it IS still used
They still do? I made a lot of money back in the 90's doing cobol rewrites for Y2K, but I'd have expected them to move away after that shambles.
I guess they never learn
yep
who wants to be a coder for a bann
bank
sounds kinda boring
people who want to afford much crack cocaine
Its really good money
Because nobody wants to learn cobol
True, no idea why though. it's SO basic you can learn it in a few hours
time to learn cobol and make money
fr
I couldnt read nor write in the 90ies
Because i was only 4
I ain't even be born
PersistantDataContainer With tile entitys will also give every single Purpur_block other ID's right if i for every new placed block a new CustomID
Well that's a statement
how do i compile my poorly coded project with gradle? it contains some emojies in its src and gradle gets some errors.
PDC Storing on tile entity's gives every "Robot" // "Purpur_Block" his own ID right
do you what time entitys are
tile*
blocks do not have PDC
if you need PDC for blocks:
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
and purpur blocks are no tile entities
how would i go about making a custom server for the public i wanna make a factions/prisons but need adice on what host i should use and what frame work
thats why i suggested he used tile entitys
advice
how do i fix this
like chest but i guess he misunderstood me
change your IDE to UTF-8
"how"
how do i set it
compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
idk sth like this probably
ofc
especially for gradle stuff
why don't you just use it now lol
wdym i dont
I need to add the <repository>, <dependency> & <relocations> to my files right
cool it worked. where is the jar? 💀
because that's the default location that gradle uses
in what meaning
don't ask me why
weird
Why is it showing red, added all the 3 to pom.xml
maven juses target/
jesus
try (EditSession editSession = WorldEdit.getInstance().newEditSession()) {
Operation operation = new ClipboardHolder(clipboard)
.createPaste(editSession)
.to(BlockVector3.at(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ()))
// configure here
.build();
Operations.complete(operation);
} catch (WorldEditException e) {
e.printStackTrace();
}
I am using WE Api, and the newEditSession method wants a world, how do I get this world.
the <dependency> is red because you didnt reload maven yet
ahh
how do i make this
implementation 'net.dv8tion:JDA:5.0.0-beta.6'
come with jar in packages?
the relocations are red because they belong into the maven shade plugin's configuration section
BukkitAdapter
you need a third party plugin called shadowJar
Kindly elaborate
can i put a invetory holder in the same class as a listener?
relocations still red
i dont need
i was perfectly doing it on maven
other is not red anymore after reload
with the maven shade plugin
mustve been using that plugin
Wym?
BukkitAdapter.adapt(bukkitWorld)
you do, you're using gradle now
Thank you
for bungee?
so like a have a class that has a listener but also a invetory holder
why cant i do it like i was doing it on maven?
Reloaded Maven, </relocations> Is still red
Nah
the <relocations> belong into the maven shade plugin's "configuration> section, e.g. like this
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- relocations go here -->
</configuration>
</plugin>
the whole <plugin> belongs into <project><build><plugins>
Just have the inv holder class
pretty sure relocations goes in teh settings for teh shade plugin
ahh
well because gradle is not maven
And have the listener check if the inv holder is yours
if you want to do it like in maven, then use maven
@charred blaze you mustve been using that plugin, your project generator mightve added it. Check the pom.xml for the plugins section
Registering a new listener for each inv is bad
as said it belongs into the maven shade plugins config, e.g. like this https://github.com/JEFF-Media-GbR/StackResize/blob/master/pom.xml#L57
ah ok
how do i add shadowjar
google "gradle shadowjar docs"
PersistentDataContainer customBlockData = new CustomBlockData(block, plugin);
This is the only thing to add right
if you only add this, it's totally useless
you said you needed a PDC for blocks. So, you can create one using new CustomBlockData(Block, Plugin). Then do with that whatever you want to do
so i just need to shadow 'net.dv8tion:JDA:5.0.0-beta.6'?
yes
ok
it will be in libs folder right? did shadowjar changed path?
because jar doesnt contain jda
it's in the same directory, /build/libs, and it has the classifier "-all"
jar doesnt contain jda
are you using the -all jar?
how do i check that
by checking whether the file name ends with "-all"
that's not the shadow jar
only this was in libs
then you didnt run the shadowJar task
only this was in libs
you either have to explicitly run the shadowJar task in gradle, or tell gradle that build depends on shadowJar
isnt this build file good?
yumm pate
the dependency has to be set to "implementation", not "shadow"
hm
and then you gotta run the shadowJar task, or make build depend on shadowJar
how do i make it depend on shadowjar
where do i insert that
i think thats not enough. how do i tell gradle that it needs to get jda with the jar not bungee packages?
hmm ok
aaa
Its similar to mavens provided and compile scopes
are you now using the -all jar?
what did you run to compile? gradlew build?
whats the dif?
yeah
fantastic
i want my barrels to respawn after a specific time how do i messure time aka to a timer
(talking about seconds-minutes
You can use system.currentimemillis and add time to it
yes
but Id say use UUID instead of player names
why?
na
u can add a name entry also
like
Names can be changed
balances:
<uuid>:
value: 100
lastKnownName: Conclure
expending cpu cycles to save 4 characters per UUID in a file is pointless
you bought the whole cpu so you're gonna use the whole cpu
its for encryption for sure 
Be a gigachad and encrypt everything
saving lastKnown is handy (at times)
but that was mainly if you wanted to make it easier for server owners to manage that data file
eg when needing to match by name when teh player is offline, on a fresh server (retaining old data)
yes and u can write ur own bijective cache that does not expire
or manually editing the file
which is advantageous also
What algorithm does mcedit python use?
Suffering
I wanna build a efficient and optimized method for filling out any area there takes in count for CPU and memory
Not like worldedit there crashs server for large area
i remember all my threads throwing an out of memory error cuz i was messing with worldedit 🤔
Filling an area is not hard, it's just a case of startling from the bottom up and limiting how many changes you do per tick
very simple, just Y value lowest to highest
and a few things to account for. Always place with no physics unless you are replacing a liquid block or placing a fence (connectable blocks)
What if the sever resource drop?
no reason you can;t monitor that
I'd probably get a base line of the server and then allow a 5-10% load on top
adjust yoru permitted load as you see fit
in your splittable tasks you exit if you hit your cap
How to check memory and CPU usage?
I should have made a discord thread lol
Sorry for so many questions I can't currently be on a PC
Mmm yes startle it first to get it going
Ah search is over 50% of developer work
Those will be under the system package
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
It depends how efficient you want to be really
There is super efficient ways to do it that take virtually no cpu resources
Hello I want to make a hole using fake blocks (sendBlockChange), so one player could fall into this hole and another couldn’t. The problem is if I fill this hole with fake blocks, a player that see them will stuck while standing on them and then will be kicked. What is the best way to deal with it?
The most efficient way would be to unload the region file and just modify the chunk nbt data. Then load the region file back in. This takes very little resources lol.
Probably kicked for fly for non existing block
The next efficient way is to use nms and find the memory map handle and modify that way since all region files are memory mapped
The Server thinks they are flying
I like that idea
All the rest is with the api which is not hard to do
Takes chunks into a count
Yes, I was suggested to instead fill the hole with real blocks and send air fake blocks, but it will cause not being able to even fall into the hole
So idk what to do...
If only I could make a server ignore incorrect player movement
Makes them sit on armorstand
Could use falling blocks that dont fall
The new display entities ^
yeah blockdisplays
If they riding an entity they aren't flying
blockdisplays work fine and unlike falling blocks, they dont magically disappear after like 5 minutes
What is it?
I am not yet up to speed on the new stuff lol
So i guess listen to alex as he seems to know
a BlockDisplay is like a hologram block
@EventHandler
public void onPlace(BlockPlaceEvent event) {
event.setCancelled(true);
Material material = event.getItemInHand().getType();
Location loc = event.getBlock().getLocation();
event.getBlock().getWorld().spawn(loc, BlockDisplay.class, b -> {
b.setBlock(material.createBlockData());
});
}
this will cancel block place and instead spawn a "block display" like in the video
oh I sent the wrong video
this is the video I wanted to send
Nice Fake blocks
fek bloggs
It would be perfect for adventure maps
Very interesting, it doesnt require other libraries or etc, right?
Thanks!
Im developing a new minecraft minigame with a lot of new classes and abilities. I want to make one class create illusion blocks
hey so I have a list with like, a bunch of elements and I wanna randomly select 3 of them
how can I do this?
I figured out for choosing 1 element but I need 3 at once (stored in another list)
nvm
Hello I have a big Problem, I don't know how I could solve this.
- Click on an Item in a GUI. (I already have)
- Timer in Actionbar, that is counting down from 30. (I already have)
- While the timer is not 0 the player can write smth in the chat an this will be detected. (I don't have it because I don't know how I get the Integer from the first Event into the second event. ;/)
I'm on 1.12
use a map
Or the conversation api
declaration: package: org.bukkit.conversations, class: Conversation

@tawdry echo you know how to solve? ;/
per player or global?
Hey, I have a question about the FAWE API (for those who use it). I decided to write here, because there are silent guys. I have a working code that copies an area from one world and inserts it with the same coordinates into another world. The problem is that in most cases the entities disappear when the area is pasted. What can I do in this case?
Code: https://paste.md-5.net/ojuxutacoq.cs
(CreatePath)Nick:
(CreateSection)option1: true
?
Is there a way to manage multiple worlds (create and use them for my code)? And do I need to use MultiVerse for this? if yes, how to use their api.
no you don't neeed multiverse
How do I use multiple worlds then?
?jd-s
Look here or google
Thank you
Extending to that, I want to create a blank world (Done), and then divide it into multiple parts, and then generate islands there when a player (who doesnt own an island) wants one.
Kinda like skyblock, so how can I approach this?
Wont that be a bit bad performance wise?
Like creating multiple worlds per island? That would take a lot of storage?
Great
ty
Guys I'm using this code:
@EventHandler public void InventoryMoveItemEvent(InventoryMoveItemEvent event) { ItemStack item = event.getItem(); Player p = (Player) event.getSource().getHolder(); p.sendMessage(String.valueOf(item)); Bukkit.broadcastMessage("done"); }
It should broadcast "done" and message the player with the value of the item when they move an item across their inventory, however, it does not do this.
I've checked the docs already and I am confused.
Why does this code not work?
Did you register the listener?
Wait lemme check
Yeah I did already.
Other eventhandlers work fine, it's just this one.
Check console for errors
This event is for moving an item. Not for moving across their inventory quote Called when some entity or block (e.g. hopper) tries to move items directly from one inventory to another.
Don't worry I think I found a way around it.
Well as long as you misspoke as to the purpose then yeah
Whats the maximum length for a worldname, does renamingisland_PLAYERUUID cause problems?
test it
tight
Aight
Guys how can I get the inventory slot of an itemstack?
I've searched the docs, but they mostly just talk about getting the slot of the currently held item.
Wait don't worry I've fixed it.
mm I've done that a lot before
the easy way to not get kicked is to just enable flying in the server.properties iirc
how do I set the item in the main hand of a player
the non-easy way of doing this is setting a non-occludable item and masking it to the player
To bypass fly checks, you can do something like:
- Create a big empty area
- Fill it with non-occludable blocks (flowers, for example)
- For players that are meant to see blocks, send fake stone or whatever
- For players that are not meant to see blocks, send fake air
could someone help we with this please? https://discord.com/channels/690411863766466590/1095995534004736050
Is there a way I can use the vanilla map to generate a map JUST for one chunk, like its sized more, normal maps have around 5-6 chunks, I just want the map to show ONE chunk.
@EventHandler
public void onPlayerPlaceBlock(BlockPlaceEvent event) {
Player player = event.getPlayer();
if(event.getItemInHand() == DirtGenerator.createDirtGenerator()) {
player.sendMessage("This the dirt generator.");
} else {
player.sendMessage("Nah, this not the generator.");
}
}
why does this send the else message?
public class DirtGenerator {
public static ItemStack createDirtGenerator() {
ItemStack dirt = new ItemStack(Material.DIRT, 1);
ItemMeta dirtMeta = dirt.getItemMeta();
dirtMeta.setDisplayName("§eDirt §bGenerator");
List<String> lore = new ArrayList<>();
lore.add(" ");
lore.add("§e---------------------------------------");
lore.add("§aGenerator: §fDirt");
lore.add("§e---------------------------------------");
lore.add("§aDescription: §fGenerates another block §fof §eDirt");
lore.add(" §fwhen destroyed.");
lore.add("§e---------------------------------------");
dirtMeta.setLore(lore);
dirt.setItemMeta(dirtMeta);
return dirt;
}
}
DirtGenerator.java
are you sure the item in hand is the dirt u want
yeah
you'd need to make your own little parser
because the thing is like
maps have multiple resolutions
its finest is 128x128
Is it possible? I can do the other part.
am I using the right method?
And if yes, how to make my own parser
getItemInHand()?
Try doing logs to check if they are equal
uhmm that's the log check sendMessage
nevermind the scale part is just about mixing colors together
won't that be the same
so yeah a minecraft map is 128x128 pixels
you'd need to just make a 16x16 image and upscale it
by you know, grabbing each pixel and drawing an 8x8 square of it
and then you can show that image as a map
bump
Can I somehow get a hex value from the material of a block, like a close value. Like the map in vanilla does.
.equals not ==, but that probably won't solve your problem if that method is creating a new itemstack
you'll probably need to compare the nbt/persistentdatacontainer
I still don't know those, I'll check it out
?pdc
Here it is
Ask GPT to write a plugin to place a block under a player on a command execution
.isSimilar
Minor bump
when i did some stuff with maparts i had to manually do the colours for each material (yes it was hell). afaik there was nothing in the api that helped with that
if there was then i wasted hours of my life for nothing
i can link you the source for that though if that'd be useful, i forked the cameras plugin and updated it to 1.18
There’s NMS methods to get the map color of a block
oh boy
They are much more powerful when they explode
How do I replace all Entities in Chunk with others?
Loop over all entities in a chunk, remove them, spawn a new one at their location
I generally made such an option, but I don't know how to replace a chunk in the world with a new one
I read something quick yesterday
Regarding if you want to use adventure in spigot like minimessages
You need to shade it
But I feel like I'm missing something cause it says java.lang.NoSuchMethodError:
Then yes you are missing smth
Then I'll use your method. When I spawn the entity, the chunk will be loaded, right?
I thought doing scope compile was enough
You can use the libraries feature instead
To be honest, I'm just trying to move frames/minecarts/armorstands/animals from one chunk to another.
Teleport them?
is it possible? 😮
Spigot doesn't have that does it?
It does
Wut
if you are copying use the StructureManager
it will copy blocks and Entities if you tell it
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
I guess it does
But if I'm already including in maven and shading
Why
So instead of shading all the requirements like entire adventure and such
I just add them to the library>?
Mhm
okay, I'll see what it can do
That's... cool
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-bukkit</artifactId>
<version>4.2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<version>4.12.0</version>
<scope>compile</scope>
</dependency>
I assume I extract
- net.kyori:adventure-platform-bukkit:4.2.0
- net.kyori:adventure-text-minimessage:4.12.0
That's it?
Then change the scope to ?provided?
what is that
Attempts to figure out how to transfer entities, because FAWE in most cases loses them when copying from one world to another.
yeah cuz it doesn't care
chunk.getEntities().forEach(entity -> entity.teleport(newLocation()));
In fact, there is such a method, but it apparently does not work well
you'd better just get all chunks which are affected by transfer
get the minimum point
and teleport all entities to new location relative to the minimum point
so their new locationg just gonna be like minimumNewLocation + relativeOfsset
That's what I've been doing, except teleporting
Structure template = Bukkit.getStructureManager().createStructure();
template.fill(cormer1, corner2, true);
template.place(newLocation, true, StructureRotation.NONE, Mirror.NONE, 0, 1.0, new Random());```
the code you pasted looks kinda sus
I think minimessages weren't available in 1.17.1
They were
The libraries feature is 1.18 iirc
cuz he wants help asap
Asked different things
If you worried less about who asked and more about the contents
Paper natively supports adventure and I'm developing for spigot so
Even this is better for (Chunk chunk : outChunks)
yes
also you just change the world
what if chunks are also moved XYZ
I mean the zone you copied and pasted
This thing moves correctly through chunks, I checked
ok cool
Which are the algorithms designed for region filling?
I posted code above which shoudl copy an area including entities
I suspect that teleportation needs to be done via runTask
3 lines of code is all
Additional classes are needed there
Maybe the StructureManager class exists in the latest versions, I'm not aware of it, but it clearly does not exist on 1.16.5. Either it's an NMS
ah You need to do Bukkit.getStructureManager()
okay
it's not a static manager
It's not in 1.16
it's quite new
Then it won't help me, unfortunately
a shame
what exactly
on the screenshot i only see FAWE move regions, not entities
public void getConf() {
File file = new File(getDataFolder(), "config.yml");
config = YamlConfiguration.loadConfiguration(file);
}
db_type = config.getString("db_type");
#getString is returning null
I do have db_type in my config
getConf is being run
why do you use the getConf if getConfig() is provided by default
also show the entire class
I also have like, other files
and?
lang.yml
economy.yml
JavaPlugin#getConfig()
i can do it for config but what about the others ye
you init both of the files on enable
and just get them when needed
cuz rn you are creating a variable and calling several methods
but can just have one getter instead
free java lessons
do you have an example :p
call me
cant rn but in a bit
[20:40:20] [Server thread/ERROR]: [ACF] Could not find context resolver
[20:40:20] [Server thread/ERROR]: [ACF] java.lang.IllegalStateException: No context resolver defined for org.bukkit.command.Command
[20:40:20] [Server thread/ERROR]: [ACF] at acf-bukkit.acf.CommandContexts.getResolver(CommandContexts.java:351)
[20:40:20] [Server thread/ERROR]: [ACF] at acf-bukkit.acf.CommandParameter.<init>(CommandParameter.java:90)
[20:40:20] [Server thread/ERROR]: [ACF] at acf-bukkit.acf.RegisteredCommand.<init>(RegisteredCommand.java:115)
[20:40:20] [Server thread/ERROR]: [ACF] at acf-bukkit.acf.BukkitRegisteredCommand.<init>(BukkitRegisteredCommand.java:30)
[20:40:20] [Server thread/ERROR]: [ACF] at acf-bukkit.acf.BukkitCommandManager.createRegisteredCommand(BukkitCommandManager.java:387)
[20:40:20] [Server thread/ERROR]: [ACF] at acf-bukkit.acf.BaseCommand.registerSubcommand(BaseCommand.java:457)
[20:40:20] [Server thread/ERROR]: [ACF] at acf-bukkit.acf.BaseCommand.registerSubcommands(BaseCommand.java:370)
[20:40:20] [Server thread/ERROR]: [ACF] at acf-bukkit.acf.BaseCommand.onRegister(BaseCommand.java:258)
[20:40:20] [Server thread/ERROR]: [ACF] at acf-bukkit.acf.BaseCommand.onRegister(BaseCommand.java:228)
[20:40:20] [Server thread/ERROR]: [ACF] at acf-bukkit.acf.BukkitCommandManager.registerCommand(BukkitCommandManager.java:226)
[20:40:20] [Server thread/ERROR]: [ACF] at acf-bukkit.acf.BukkitCommandManager.registerCommand(BukkitCommandManager.java:259)
[20:40:20] [Server thread/ERROR]: [ACF] at dev.wonkypigs.minememer.MineMemer.registerCommands(MineMemer.java:53)
[20:40:20] [Server thread/ERROR]: [ACF] at dev.wonkypigs.minememer.MineMemer.onEnable(MineMemer.java:35)
[20:40:20] [Server thread/ERROR]: [ACF] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264)
[20:40:20] [Server thread/ERROR]: [ACF] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342)
[20:40:20] [Server thread/ERROR]: [ACF] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480)
[20:40:20] [Server thread/ERROR]: [ACF] at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:525)
[20:40:20] [Server thread/ERROR]: [ACF] at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:439)
[20:40:20] [Server thread/ERROR]: [ACF] at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:584)
[20:40:20] [Server thread/ERROR]: [ACF] at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:403)
[20:40:20] [Server thread/ERROR]: [ACF] at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:255)
[20:40:20] [Server thread/ERROR]: [ACF] at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:968)
[20:40:20] [Server thread/ERROR]: [ACF] at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:293)
[20:40:20] [Server thread/ERROR]: [ACF] at java.base/java.lang.Thread.run(Thread.java:833)
[20:40:20] [Server thread/ERROR]: Error occurred while enabling MineMemer vbeta -0.9 (Is it up to date?)
whats a context resolver? (cant find on google)
if you have a command with onCommand(Player player, String string, YourClass class)
you would need a context resolver for YourClass so acf can handle it iirc
entities are not teleported or what
?notworking
"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.
Yes, it doesn't work after loc.setWorld(in);
It just skips it
you have no message "TP ->"?
yes
can you show custom images on a map WHICH have pixels with different alphas? i want some pixels to be a bit transparent
I think maybe need to load a chunk into which the entity is teleported?
I am making sell shop now itemstack whick would have NBT data in some cases
those will be Custom Items how would I check if item in Inventory matches item in shop
by nbt
do I just compare two itemstack object with equals
isSimilar iirc
for what class?
have you declared one?
Hey so, a bunch of people have been saying using MiniMessages to allow making components from a config is a very nice option
But looking at the string in the config.yml I feel it could be confusing for the user
how would I go about making floating, rotating items that cant be picked up and wont despawn if unloaded?
test-message1 : "This is a test message! Hello %player_name%!.<newline><hover:show_text:'<rainbow>Click me!</rainbow>'>HOVER<newline><click:run_command:/rpv>Click me!</click>"
Cause that looks confusing
Item displays probably.
can u send me the wiki link
Or you can disable their gravity and set their pickup delay to MAX_INT
I don't know at all, it doesn't work even now
https://paste.md-5.net/icutozabav.cs
is there a way to also make them bigger?
