#help-development
1 messages · Page 39 of 1
EntityBee bee = ((CraftBee) bee).getHandle();
TagCompound nbt = bee.getOrCreateTag()
(or something similar to that. Again, this depends on the mappings you're using)
Using mojang maps
So instead of EntityBee it's probably just Bee
public String getBeeUUIDFromNBT(Entity bee) {
EntityBee beeEntity = ((CraftBee)bee).getHandle();
if(beeEntity.gett)
}
Its telling me to change EntityBee to just Bee
Yeah, Mojang's mappings don't prefix entities with Entity
It's just Bee
EntityBee is a CraftBukkit mapping
Might just be getTag()
nope lol thats getTags and returns a map of strings

i hate nms
seems like mobs dont store nbt on 1.19
they just serialize their internal data to an nbt tag on demand
pls help it works on my main pc btw
Bruh..
Yeah it's just got save/load methods
I already told you to override saveWithoutId and add your custom tags
Thats a different issue
hm
thats fine now
you're trying to load now?
this is where I need to check if it should be custom when it spawns
yup
So basically...
@Override
public void load(CompoundTag nbt) {
super.load(nbt);
String beeUUID = nbt.getString("bee-uuid");
this.originalBeeUUID = UUID.fromString(beeUUID);
}
I need to get this value but outside of CustomBee
because its not yet a CustomBee
Where do you have that at?
register your custom entity type
I am
EntityType around like 400-500
Oh its core
public static void registerCustomBee() {
String typeName = "custom_bee";
EntityType.Builder<Entity> builder = EntityType.Builder.of(CustomBee::new, MobCategory.CREATURE)
.sized(0.7F, 0.6F)
.clientTrackingRange(8);
Registry.register(Registry.ENTITY_TYPE, typeName, builder.build(typeName));
}
but honestly I'd just do fancy stuff like EntitiesLoadEvent and CreatureSpawnEvent
im registering this onLoad
i have know idea why this is happening and cant test why my main pc is getting fixed
this is so weird mannn.. any other ideas?
quick question, If I set to the main hand an item to a mob when it spawn, when the people kill the mob always will drop the item?
hey i'm using SpiGUI and i need to know how to ask the player a question in chat after clicking a button (e.g. click Rename and then you type the name in chat)
for that... I add the player's uuid to a hashmap along with a bukkitrunnable...start the runnable and if they type in chat and the map contains their uuid as a key, cancel their msg, act
wha
im kinda new to java please explain
ik what a hashmap is
but i dont understand how that helps accompolish this task
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
well its probably a "bad solution" according to everyone else here even though its async (thread safe) and works well
How can I send a fake invisible, invulnerable, marker, named armor stand to a player either with nms or protocollib
bump
annnnnd now im not coming back here. i knew people would go "LEARN JAVA LMAO" but still its kinda rediculous that i ask a simple question because im trying to learn and you lot go "yeah bro learn the entirety of java in a day lmao"
oh im just annoying on purpose
do u know what hashmaps are @karmic sorrel
yes they do
oh
no im just annoyed because i was told by multible people "theres no point going to spigotmc discord they will just tell u to learn java and not actually help" and i was like yeah nah thats not gunna happen right
nah it 100% does
i actually misread it at first and thought it said "idk what hashmaps are" tbh
no but how is learning the entirety of java when i already know enough to get by and make this project going to help with asking a question on gui click?
i genuinely dont understand that
don worry abt it
n e ways
they said to use a hashmap so that u can add them (the player) to some sort of registry and listen to their chat events id imagine
id say use a Set but a Map would probably work better for a timed event
idk how the fuck to make a bukkitrunnable cause i havent made a runnable in forever but
i wouldnt say this is timed but idk
do i just make a class that implements bukkitrunnable?
a bukkit runnable + just a Set would probably work pretty well
nah
No
just yourPlugin.getServer().getScheduler().runTask()
ah ic ok
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
heres something i use
i know it could be better
made this a while ago
I have a private HashMap<UUID, BukkitTask> playerNamingBeeTask;
so in my click listener i make the bukkit scheduler run the task
wonder if u could just have one infinitely repeating bukkit task and then tick all the players renaming their bees in that one runnable
Maybe...? but its got a countdown timer
I mean I definitely could if I made another map with the countdown time
could track that with a map or a custom playerdata object
yeah on click start a task
Then if you wanna cancel it, just call cancel()
ye icic from the this.cancel call
got a lead?
just editing it rn
how do i get a player from HumanEntity?
looking rn and i cant figure it out
why do you want humanentity
no i dont want a humanentity
then just use Player
and its what event.getWhoClicked returns
my guy i literally cant
oh
ye
ah okok
bump
i dont see why they dont just return player but
Yeah idk
bruh i dont understand how to start the bukkitrunnable from ur code
can i just cast it? idk
cause ur code makes a new bukkittask from a bukkitrunnable
and to add to scheduler i need a bukkitrunnable
and im assuming i can just cast it but idk
BukkitTask namingHiveTask = new BukkitRunnable(){
Creates it
}.runTaskTimer(this.cadiaBees, 0L, 20L); runs it every tick
yes no i see that
0.0
so i just need to run the method
thats why it was void lmao
i feel dumb now lmao sorry
declaration: package: org.bukkit.scheduler, class: BukkitRunnable
yeahhh
ive got this working if stone is in every slot, but i want it to run if theres nothing in those slots, and checking for air in those slots didnt work
i mean should be same in most versions but yeh
It is
can i get help with what to check for if i want to check for no item in the slot rather than checking for stone
== null or type = air
bump 👊🚋
oh so instead of Material.STONE do just null?
if (event.getCurrentItem() == null || !event.getCurrentItem().hasItemMeta() || !event.getCurrentItem().getItemMeta().hasDisplayName()) {
return;
}
I’m not 100% sure but I’m pretty sure empty inventory slots are not null
But air
i tried replacing stone with air and it didnt work
alr thanks
hey can i make an event in a bukkittask?
itemStack.setType(Material.AIR)?
And then you would use itemStack.getType().isAir() to check if it air
thats what the hashmap is for.. in the event, see if the players uuid is in the map
if it is, return the bukkittask and cancel it or whatever
no i mean making it Material.AIR instead of Material.STONE but it said it was null so it didnt run the event
so im trying null
ah ic
tyt
tyty*
bubump
im probably doing this in a very inefficient way but im inexperienced and it was the only way i found that worked, but yeah im doing if (c1.getType() == null) for every chest slot, and in the server console, it says it couldnt pass the event cause "c1 is null"
but im checking for that
so idk why its not passing the event
what is c1
chest slot 1
it works when i replace "null" with Material.STONE
oh
so then how do i check if the slot is empty
actually
if c1 == null
ItemStack c1 = e.getInventory().getItem(0);
thats what im doing for every slot
0-26 for all 27 slots
with c1-c27
well yea but im not gonna type the WHOLE thing in the middle of a game of valorant lol
lmao makes sense, thanks
It's called pseudo code lmfao
now its just passing the event regardless of whether theres items in the chest or not
we need a chunk of code not just 1 line
alr ill send my whole event handler
?paste
I use the PDC like a civilized individual 
Which use-case
This again lol
this still
be prepared, its probs very bad
i told you :/
@quaint mantle Are you capable of pinning things?
holy fuck...
I want that masterpiece on my wall
i've done that, i'm planning on having multible but idgaf how broken it is, now i need to wait until that task has finished and then grab the answer from a diff hashmap and remove it. how tf do i wait until that task has finished in an inventoryclickevent?
for(int i = 0; i < inventory.getContents().size(); i++) {
}
Google how to use a for loop. It'll blow your mind ngl
what?
0.0 nvm for other dude sorry lmao
Yes
What happened
@quaint mantle https://paste.md-5.net/oriwadahor.java
#help-development message check this out
lmao i just realized that i have two of the location stuff running
ill delete the second one, and ill also look into for loops
is this a for loop
No its a while loop
👀
lmao ill take that as a yes
just copy and paste sometimes its actually faster than looping if you copy and paste fast enough
Honestly, I think most people have been through the pre-for-loop phase of coding. Honestly that nested if is some dedication
XD i mean it works if i am checking for an item that isnt air
just not air for some reason, but ill look into loops
It's another work of art added to my collection
Reminds me of this one I have https://pastebin.com/gMaHawNC
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Rate the pfp
lmao imagine not allowing users to embed
@quaint mantle do you know nbt stuff lol
0/10
imagine not being verified
fuck naur
god thank you
imagine knowing how spigot works
I'm glad your back
imagine not knowing how spigot works
so with special source am I supposed to use the -remapped-obf.jar or -remapped.jar
neither really, you should be using maven
it outputs all versions
I know
if only 7smile7 or imillusion were on...
I just told him, he should use neither jar, he should use maven to manage the dependencies.
ok so from what i understand, this will list all of the things in a chest and then i just check if "i" is null?
yup
you would do
alr thats a lot simpler
if(inventory.get(i) == null
jesus if only i knew 💀
lol
Bruh what the fuck
it stays in the hive for 2 minutes btw
my guy
deadass it was not working
Deadass you're doing it wrong™️
Ur also doing this with bukkit entities and im using custom stuff... idk
That really shouldn't matter lmfao
Yea still aint working 😐
You're doing something wrong then™️
Pretty hard to fuck this up so something aint working like its supposed to.
what i done wrong here?
each time i call an hashmap it causes an nullerror
what do you mean by inner?
@vocal cloud
https://hastebin.com/ihigixuraf.php
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Thats my entity spawning.
Show some code pls
thanks!
You deleted it, though others can still help you correcting the code u sent
nah
They are not well done
= new map..
Public instance variables, etc
}
public HashMap<Player, Integer> Users = new HashMap<>();
public HashMap<Player, Double> X = new HashMap<>();
public HashMap<Player, Double> Y = new HashMap<>();
it would be enough i think
i forgot about doing it
so how should i do it?
uuid
what uuid?
player uuid
i just use player object
Player object changes every rejoin wanna use a uuid
im aware
the player is removed from maps once he leave
its not a data storage
its just sending the player how many blocks he passed in a second
You will face issues still
Oh boi
You should create a data class that contains your int, x, y etc and then have only one single Map<UUID, PlayerData> or Map<Player, PlayerData>
true
the whole reason memory leaks happen is because you didn't account for something in your code
you can't say there's no data leaks just because you remove them from the map in 2 situations, that's not how that works
i either loop
if the are online if not
ill add them to list and remove them from maps manually.
🐳
sounds fine?
it's just practice to use UUID
His choice though, if he prefers bad practice so be it
Check it after you set it. Also, how are you checking that it's actually set?
pdcManager.setBeeUUID(customBee.getBukkitEntity(), bee.getUniqueId());
Bukkit.broadcastMessage("UUID set to: " + pdcManager.getBeeUUID(customBee.getBukkitEntity()));
This is my check after setting
it works at this point
It also works when it enters
Its the CustomBee/nms stuff causing the issue.
This is with a bee spawned through a spawn egg
then I hit it and set the value and got it when it exited (works)
Send the custom bee class
?paste
at me.blenkc.farmingplugin.Hoe.OnTill(Hoe.java:27) ~[FarmingPlugin-1.0-SNAPSHOT.jar:?]
```how do i get rid of this error
What version is this? I can't seem to get this working on 1.19
Ugh
People can interact with their environment without having an ItemStack in their hand. So go figure.
scarry null pointer error. Use basic logic
i doubt you can, but is there a way to play an audio from an URL?
Nope. You would need a resourcepack or force the player to be connected to a website when playing.
alr, so: get request from player > update resource pack with the audio file > player needs to reload resourcepack using CTRL + T?
bruh i still don't get it though im getting this error when im holding something
You need to enforce the resourcepack when the player joins
In both hands? The interact event is fired once for every hand.
yeah, ill host it on my website > my plugin will send a request to the website > website updates resourcepack > player presses CTRL + T, requesting the server resourcepack again?
Your ide already tells you that this is not right
hoping mike is trying to figure out my entity issue
ppreciate it
Someone should do an archetype for that
I had some weird asf error.
I'm working on a plugin to handle this stuff for gradle but this is killing me ngl
@vocal cloud need my pom?
Not a pom issue, it's a maven issue
ah
@vocal cloud its 2:23 am i gotta be up for work at 7, i gotta get to bed :/ I appreciate the help and looking into this I hope we can figure it out. If you manage to figure it out, feel free to msg me ill respond when im able to get to it
Nms entitys' setCustomName take in a Component argument
anyone know how to get an instance of one of these? (a Component)
quick q if I have a location with a pitch and yaw and I want to set the direction to be "looking" towards the pitch and yaw I set is there a quick api way of doing that or am I stuck doing fun math
You can use Location#setDirection(Vector)
Oh. Then Location#setPitch(float) and Location#setYaw(float) lol
then Location#setDirection(Vector)
ok so the answer is no then
The answer is yes
If you want to set a direction then you call setDirection and
if you want to set pitch/yaw then you call setPitch/Yaw
All of them change the effective direction of the location
setting pitch and yaw doesn't modify #getDirection() which is my issue, guess I'll just go do some math then
Yes it changes the resulting direction vector
I am generating a location from text, for which I have everything but the direction vector. Setting the pitch and yaw doesn't seem to have affected the #getDIrection vector you get from the location
Im guessing that you forgot to reapply the Location to your origin because you are always dealing with copies of Location
how to create a villager trading inventory? InventoryType.VILLAGER or something like that doesnt exist
spigot software support resource pack on bedrock ?
use geyser
- there plugin can be multiprotocoles ?
i use
send in dm
PlayerInteractEvent - check if player clicked a left click
if (customitem != iteminhand) {
return;
} else {
//code
you will need get player direction vector
after wards you calculate the location you get from the vector.
List<Entity> nearbyEntities = (List<Entity>) you get nearby entites using World.getnearbyentites(location,location.location0)
Now you loop the list
and check if entity == enderman {
using Velocity you would throw them towards the location
you used to calculate the radius from.
} else {
goodevent.add(location,int)...
make another method to loop thru every 20 ticks
if it contains a value just make the cylinder of armorstands
appear using a cylinder (loop a cylinder you can be creative here.)
so if int = 10 > spawn...```
what da fluff
what's that supposed to be
some guy said this helps to make gryo wand
that's not how java works
they just explained how to do it
not spoonfed you the code
I've been at this problem for so long, this is my fourth day
I'm so close
I'm trying to make custom titles above player heads
My strategy right now is constantly teleporting named invisible armor stands above a player
They're not real armor stands, but fake client side ones sent using packets
And I've got everything working, so that the armor stand "spawns" in, "teleports", and gets "removed" correctly (I use quotation marks because the armor stands don't exist, I'm just sending packets to players)
The only issue that remains
is that the armor stand's data does not show correctly on the client
here's what I mean
this is what I'm using to create the armor stand
ServerLevel serverLevel = ((CraftWorld) player.getWorld()).getHandle();
armorStand = new ArmorStand(EntityType.ARMOR_STAND, serverLevel);
Location playerLocation = player.getLocation();
armorStand.setPos(playerLocation.getX(), playerLocation.getY() + ARMOR_STAND_Y_OFFSET, playerLocation.getZ());
armorStand.setCustomNameVisible(true);
armorStand.setNoGravity(true);
armorStand.setInvisible(true);
armorStand.setInvulnerable(true);
armorStand.setMarker(true);
for (Player otherPlayer : Bukkit.getOnlinePlayers()) {
if (player == otherPlayer) {
continue;
}
sendSpawnArmorStandPacket(otherPlayer, armorStand);
}
the armor stand shows up on the client, but it's just a default armor stand (not invisible, no custom name, etc)
anyone know why this is the case?
btw here is sendSpawnArmorStandPacket
private void sendSpawnArmorStandPacket(Player player, ArmorStand armorStand) {
((CraftPlayer) player).getHandle().connection.send(
new ClientboundAddMobPacket(armorStand)
);
}
you have to send the entity metadata packet aswell as the add mob packet
I literally just figured that out as you sent that lmao
not sure what the remapped name is though
ClientboundSetEntityDataPacket
all I did was add this code to my sendSpawnArmorStandPacket and now it almost works
((CraftPlayer) player).getHandle().connection.send(
new ClientboundSetEntityDataPacket(armorStand.getId(), armorStand.getEntityData(), false)
);
just a few more issues I have to fix and hopefully it'll all work
YES
I GOT IT
its finally done
holy crap
nms is such a pain in the ass
JPLISAgent.c?
What the heck is this error?
Are you doing anything static in NMSTransformer?
Are you making use of the Java Native Interface..?
I have no idea why I never thought of that. It's working?
If that's the case someone should make a C/C++ wrapper for Java Edition so then people could write their plugin in C and run it on both Bedrock and JE
Bedrock plugins are written in php iirc
Wait what
Exactly
php??
Make sure you dont shade in the library you are using.
is that the native minecraft server or some bukkit equivalent in bedrock?
It's Java Edition with native code. I can't help him :|
But Bedrock uses JavaScript for some reason :/
Whose idea was that
Yeah, you could modify the source
Is there an event for grass spreading?
Yes. I think its just called BlockSpreadEvent
I don't think assembly will help with that
Or BlockFormEvent
It think the latter
Cus you still won't be able to act on the address space of a private object.
And with ASM it's really difficult to act on a separate memory segment anyway
Maybe hook a .so from your plugin and in the Spigot source and write a wrapper for what you're trying to do in the shared object
Cus I have a feeling that if you try changing things from private to public in spigot source you will break the API
How can I manually put my rep inside my .m2 folder?
dep
theres a command for it
gimmie a sec
mvn install:install-file \
-Dfile=<path-to-file> \
-DgroupId=<group-id> \
-DartifactId=<artifact-id> \
-Dversion=<version> \
-Dpackaging=<packaging> \
-DgeneratePom=true```
and dfile is jar?
say I wanted to make a skeleton 20 fire an arrows in succession from something like 50m away every 5 seconds, are these attributes actually modifiable to make such a custom mob, or do I have to do some odd stuff with scheduling and spawning projectiles
Does anyone know a way to stop a player from being able to drive a boat using the VehicleMoveEvent?
I've been stuck on trying to do this for over a day
I have created something unholy
how would I make a custom villager trading inventory? this is how I did it by spawning an actual villager and editing it's Offers.Recipes NBT data, but how would I do this in spigot?
still taking suggestions
any reason why this mutates the given list of blocks in constructor of the event, when doing a blockExplodeEvent.blockList() call, it returns a different list
the docs for the event doesn't help neither
is there a way to make custom crafting recipes from items with nbt? i know that this is not possible wth datapacks so i was wondering if i can use plugins for that
what is the expected vs actual output for this?
lemme get my logs..
List is mutable
And other plugins can mess with it without cancelling the event
Mess with pathfinders within nms
Easiest route
I'd look at any internals messing with the blocklist tbh
But I'm not getting out of bed for that
what kind of internals
can i uh,not mess with nms?
Literally anything
or a toptier pathfinding lib
https://github.com/olijeffers0n/PatheticAPI
I just run paperweight and middle-click stuff
That you can't apply to mobs
because its not only meant for mobs
find the path->let the mob move along the path
You're killing 90% of the use-case scenarios if you don't make a mob impl
not really
what about GPSs, custom armostand mobs, pathfind to your base, quest systems whatever
tbh i kinda just wanna make silly bosses out of vanilla mobs
Are you able to specify a path width within the api?
for that you can make a custom strategy
uh so, custom mobs?
you can modify the pathfinders behaviour by passing in a custom strategy
Abstracting custom entities with bukkit schedulers is a very ghetto workaround
How would i verify votes by a user if i got a nickname and voteDate in yyyy-mm-ddThh:mm:ss+hh:mm
Rn im trying to do something like get today date, vote date and somehow compare them but im not sure how to
I just find it weird that the core api is there, but any tiny change requires doing stuff yourself
thats pretty surprising given how much stuff spigot by itself can do
should i change it to string and just cut out numbers of date string and compare them or there is a better way
It has potential but you need to account for common use-case scenario
Spigot was made so you can mess with minecraft features, but creating your own mobs is outside their scope
only specific stuff like a 3 block wide path
everything else is/will be granted
Bukkit's principals are to not expose nms internals or implementation details like pathfinders and direct nbt
Every person that is looking for a pathfinder api has a specific reason in mind
Do we also need to make a custom strategy for mobs that are 2 blocks tall?
no, the walkingstrategy is added soon. @noble lantern already worked something out there
also a "playerstrategy" is planned including jumps etc.
We'd need to modify burch's code to support any height and width then
Slimes, for example, would struggle
bump
most likely, yeah. we cant take every user specific usecase into account. we just provide the baseline which can be expanded if needed
and with a custom strategy you can hook into the pathfinder behaviour pretty easily
Hello, I have a question but not at all for me, I am in contact with a Dev who makes a Wands plugin, he was able to make wands with shots and particles from ghasts, withers, etc. but he hasn't found any information for the moment to make one with the Warden "Sonic attack", does anyone know where he could have the information on this attack and be able to make a wand with it. Thanks
How can I disable PlayerInteractEvent but also let players be able to shoot bows?
how about a guard clause :
if( event.getItem().getType() == Material.BOW) return;
?
But then they can interact with blocks while holding a bow even if they arent shooting
ah right
That's cool and all but he could just ask here instead of going through a middleman
maybe also add && event.clickedBlock() == null or something?
It acts on a similar way to guardians
Then they can't shoot while looking at a block
You'd need an invisible warden and an invisible target
does event.setUseInteractedBlock(Result.DENY) work?
idk why thats not working, im getting message CraftZombie but effect not working can someone help?
Nope
using the lore to identify items 🙏
thats my private plugin i just want it to work
2014 plugins be like
how else would you identify items
customname and lore ftw.
🙏🙏 obviously
did you know that 🙏 is actually a high five
im just dumb i was testing poison on zombie...
thats just discord
check it on whatsapp etc.
how to get server ip and port on bungeecord when getAddress() is deprecated?
I'm trying to access and modify itemmeta of an item but when I try to do so it doesn't work. IntelliJ just doesn't recognize it when I write "meta.setDisplayName" for example.
ItemMeta meta = item.getItemMeta();``` Am I just missing something?
could you send your imports?
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
public void setCageBlocks(Location spawnLocation, Material material) {
Location block = spawnLocation.clone();
// Floor
block.add(0, -1, 0).getBlock().setType(material);
// Wall 1
block.add(1, 0, 0).getBlock().setType(material);
block.add(1, 1, 0).getBlock().setType(material);
// Wall 2
block.add(-1, 0, 0).getBlock().setType(material);
block.add(-1, 1, 0).getBlock().setType(material);
// Wall 3
block.add(0, 0, 1).getBlock().setType(material);
block.add(0, 1, 1).getBlock().setType(material);
// Wall 4
block.add(0, 0, -1).getBlock().setType(Material.AIR);
block.add(0, 1, -1).getBlock().setType(Material.AIR);
// Top
block.add(0, 2, 0).getBlock().setType(Material.AIR);
}
``` this is supposed to create a cage 2 blocks high from the input coordinate instead I get this
Yo i have a problem and dont know how should i approach it.
Im trying to reward player for voting.
What i can do is make a request and get an Array with list of players and VoteDates
How can i verify votes to make sure people who voted get rewards once per day?
What i tried:
- A task every 30 seconds which checks if size of array changed and rewards the newest vote
- WHY IT DIDNT WORK: After a month votes are removed from website so it would trigger falsely
- A command which gets the list of votes and filters only votes newere than 3 hours and then from that list checks if player voted. Then it saves to HashMap that player voted and rewards him.
- WHY IT DIDNT WORK: After a server restart players can reclaim their rewards
I literally took out a pen and paper to try and figure out a way to verify votes but didnt come up with anything so i count on you guys to have some simple solution i didnt consider/fix one of my solutions or there is a simpler way..
i would try and check if you are using the right dependencys, but other then that i have no idea
Thanks, just wanted to make sure I wasn't being silly and there actually is something weird going on. It's a brand new plugin so I guess something just went wrong when creating the project. I'll just create it again and hope I don't get the same issue twice
Honestly I can't tell what I'm looking at. Could you get a better screenshot?
clone the location everytime you add to it
you just add to the location
you never clone it
You need some form of data storage other than memory. Save to file
Would yml do the trick?
yes
oh, so its executing prior to the last add?
and what would i save to the file? A player name and date?
is there an add or something that does not change the location but just returns?
it doesnt get reset or whatever, you just continue adding
clone copies the location
its like counting up and wondering why its already 3 and didnt stayed 1
Location#clone().add(...
i think player names are enough because the website gives names of players and it would make everything simpler
it will break if you use names
hm?
players can change name at a whim
instantly theyare not the one thats in your database
Why would a player teleport not be successful?
could you send us some sample of what data the website provides?
A json array with objects
[{"nickname":"Allowsik","createdAt":"2022-08-05T10:46:30+02:00"},{"nickname":"NORBIX","createdAt":"2022-07-26T11:05:03+02:00"}]
store the name if you need it for the website, but store teh UUID as the main key for checking who is who
name is just a visual thing
unfortunately the website doesnt have its own plugin for vote rewards nor API and it only provides an endpoint with json so it complicates things
yea then just use mojang api or some function that spigot has built in (i think?) to convert the usernames to uuid and save it together with the createdAt
it shoudl never be used to confirm who someone is
you can just delete the entry once the time period is over
do teh players not vote in game?
I assumed the website was just a visual display of the data
how do you ensure a player is who they claim to be?
i dont think thats needed
you cant harm anyone by voting
on website they input their name while voting, you can write anything you want there
It sounds like anyone can jump on and cast a vote under any name
yea, you never voted for a server before?
so player "fred" jumps on and votes under the name "tod". Tod can no longer vote as fred faked his vote
Yes but Tod gets the rewards then
and fred doesnt
here is website if you want to look at it
ah I see. its nothing meaningful in teh vote. its a server vote not voting for an outcome
yeah the votes promote the server on server list so we show up higher
main source of new player if you dont advertise
so existing players get rewarded for "bumping" the server on the list so we get more players
ah I was thinking it was something like voting for changes or elections kinda thing. Some thign you would need to validate who was who
i might have not precised it enough hah
Why would a player teleport fail?
null Location
thanks
im thinking of using the task every x seconds
so players dont have to type command to get reward and they get it automatically
but
I'd do it at teh most every minute. no need for shorter really
would it have impact on performance?
unless you do it async, it could
you are accessing data in file/website
fetch the data async, then process yoru rewards sync
a CompleteableFuture
I am using the plugin for IntelliJ that sets up a new plugin for me, so I can just get started coding. But for some reason when I try to access Itemmeta and modify it, it just doesn't recognize it.
Like I'll start to type meta.setDisplayName but nothing pops up, it's just red.
ItemMeta meta = item.getItemMeta();```
So is there anything I can do in terms of troubleshooting here to figure out the cause? Because I have another plugin I have created and I'm literally doing the exact same thing, except here it doesn't work and there it does work
send the class
worldedit how can I set a size larger than 6-7?
or a screenshot
probably config ;p
Unfortunately, I don't understand it. Also, I don't know what to open it in.
have you updated both the plugin and intellij to the newest version? because i had a similar issue yesterday and that fixed it
make sure its in the right place
Good point, I'll make sure it isn't that
Oh god. Thank you. I've just been silly haha.
setting passenger with spacing?
does anyone know how to give a player hearts
Increase the max health attribute
how do I set attributes to a player?
any way to punch through a mob
like
lets say there is a slime
and an entity on the other side
can you implement a way to get the punch to pass through the slime
raycast
Bukkit.getPlayer(PLAYER).getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(20);
i guess
ok thx
and probably call some nms method to simulate as if you hit the entity behind
and cancel original event
Is it able to save an ItemStack into a json? (String?)
anyone know how to takeaway a heart when player dies
hey whats the best/most efficient way to loop with a delay?
im thinking a runnable but im not sure how to do it if i only want it done a few times
should i put a runtasklater in the for loop or should i make a counter and use a schedulesyncrepeating
you run the loop for a couple times then cancel it
no need, just cancel the event and call entityThrough.damage(event.getFinalDamage(), damager)
soo i can use a counter and cancel when that counter reaches a number
yeah
aight thanks
I'm playing around with armorstands to try and make a flying sword, problem i'm currently having is aligning the sword to the player's direction. so i have two problems :
How do I convert pitch and yaw to an EulerAngle ?
How can i offset a location relative to a player's vision (eg : convert 1 block to the left of the player's camera to an actual usable xyz offset, similar to converting ^ ^ ^ symbols to ~ ~ ~)
Does anyone know how to make an entity walk from A to B using NMS?
How can i make detect a player who right click another player with a stick with a specif name and lore?
playerinteractatentityevent
InteractEvent + Check for type, lore and name of held item.
declaration: package: org.bukkit.event.player, class: PlayerInteractAtEntityEvent
Managed to solve a few things : problem is now down to
Q: How do i get a vector facing to the left of the player?
Get the front vector, and rotate it
because it involves math? xD
how do i handle the case where the player is looking straight up or down
I tried but it isn't working, i don't know what i make wrong
no you can actually rotate a vector around another
did you check if your listener was actually registered?
It is
mind sharing the listener ?
For the case where he is looking straight up, the "left" vector would still be a rotate vector
it's just that you have to make your rotation in a 3D space instead of a 2D space
from my experience i would get a NaN vector
since i'm rotating around the UP vector (0,1,0)
change the vector you're rotating against or use math to change the formula for each direction you want based on the starting vector
rotation matrix
in only the spigot vector api had helper methods for all of this
if you're moving an object with points through 3d space use a matrix

quick question, if I wanted to remove 64 of an item from an inventory regardless of slot, which inventory method is best used?
multiplying them is as easy as 3 loops
you're checking an itemStack against Material here
but yea before you implement your own rotation matrix, see the four or five methods on the spigot vector
i made my own lol
for rotation
it should be e.getPlayer().getItemInMainHand().getType().equals(Material.STICK)
You may want to learn a bit more the java basics ^^'
also that
i will
alright, knowing i've never played around with rotation matrixes before, what are they and how do they work (i already have used matrices and quite a bit of math if that helps)
uh, anyone?
i would've used Inventory.removeItem(ItemStack)
not sure if its the correct answer though
wouldnt that remove say, 2 stacks of similar ItemStacks since they match?
Basically, in linear algebra, it gives you each case of rotation for each dimension
you can find a lot of videos that explain how to use that matrix and understand the math behind it ^^
that's why i said i wasnt sure if it was the correct answer
i suppose you could do a for loop and a counter that increases each time you decrease the amount of a matching itemstack by one. probably not the most efficient but would work
alrighty!
oh but wait
i just understood one thing
there isnt any way to get the player relative UP vector is there?
its kinda odd since the basic minecraft clear command can do it flawlessly
you can get it by checking the viewing angle of the player
yaw and pitch?
yes, by combining them, you can get the vector you need
is it really as simple as adding 90 to the pitch?...
not always
have an example of where that would fail?
if you really want the up vector relative to the player's feet it's not
i mean pitch not yaw btw
plan here is
get up vector with pitch + 90
rotate dir by 270 or 90 depending on cw or ccw
if you want the up vector relative to his view, then you can just do +90 on the pitch
is it normal to feel that my plugin is a pile of crap even though it works
if it works it works ™️
how can I make packet entity invulnerable cant find in https://wiki.vg/Entity_metadata#Entity
…up vector?
lmao im comparing dates by formatting them to strings xD
uwu
how are you doing that? code wise
might be able to optimize it a bit
👀
dont you need money for that? 👉👈
copilot?
uhu
oh nvm im verified student
Hi, it's just me looking on my side if I can find a place where he can get info, I don't know if he comes here at all and I didn't ask him because I don't know if he is a place for that
i really recomend getting github student pack, you get intellij ultimate + bunch of other crap like free domains, hostings, microsoft azure credits
i'm a student too lol but i dont have my college email yet
so uh, anyone got any idea how to remove an x amount from inventory that matches Item.Material regardless of slot?
similar to how the clear command works
you doing a block compactor?
no, a shop interface that takes X items
also, i think when you remove an item it always takes X items no matter the slot
probably you need to get inventory and remove item stack
Bukkit.getPlayer(player).getInventory().removeItem(new ItemStack(Material.DIAMOND, X));
does removeItem take into consideration the ItemMeta of the itemstack?
because the diamonds in this case will have certain Lore attached
just create an itemstack with the itemmeta included
@real blaze
something like that
you create a new itemstack, new meta, then set meta to itemstack and remove the item from player
Nvm, i didnt reload, :bruh:
reload 🤡
yeah that should work, just to make sure:
ItemStack ori = p.getInventory().getItem(p.getInventory().first(Material.DIAMOND));
ori would be a clone of the actual item correct?
oh wait do i need .clone()
why do you get the item from inventory
because the itemmeta is different per player
oh
ItemStack ori = p.getInventory().getItem(p.getInventory().first(Material.DIAMOND)).clone();
ori.setAmount(32);
p.getInventory().removeItem(ori);
This should be good to go then
you should also check if player has 32 items of this
if(p.getInventory().all(Material.DIAMOND).values().stream().mapToInt(o -> o.getAmount()).sum() < 32){
p.sendMessage(ChatColor.RED + "You don't have enough diamonds!");
return;
}
ItemStack ori = p.getInventory().getItem(p.getInventory().first(Material.DIAMOND)).clone();
ori.setAmount(32);
p.getInventory().removeItem(ori);
its checked using this stream nonsense
can i ask what diffrent meta per player do diamond have?
@lost matrix is your PersistentBlockAPI something that's production-safe or should I make my own ghetto alternative?
cant you just use chunk PDC's?
i mean the api might be easier depending on how they do it
I usually don't mess with PDCs as the projects I work on pretty much never ask for pdc
https://paste.md-5.net/zuwokogude
is this some bug, someone shared this link in my support server and it doesnt open
"unresponsive" so its probably just massive
F12 doesn't work
yeah its stuck hah
3tb paste or whatever
they prolly shared their whole serer log 😂
i dont think you can store that much in one paste
try it and see
I might try pasting a 20gb .txt file I got
just to see what happens
doesnt even load the html tree
what
so their servers are probably crashed
20gb TXT?
yo is woodcutting one word?
I got uhh
i think yes
no
me steal your only fans
hmm
It's a voting database leak
wha
contains house addresses of tons of people
why do you have it then lol
^^
some dude dm'd me it
You shouldnt have that
and asked me to check if the youtuber I worked with was in there
"yo bro, theres this file with addresses of 40m people"
so I downloaded it, ran some checks on some clients of mine and warned them if they were there
dayum u work for ytubers too?
a few
I did work for preston
meanwhile i work for 0.05euro/h kekw
Ok but can we go back to the dox file for a sec
sometimes his mod ideas are so cringe
Anyone know if forge/minecraft have an API for setting capes? If yes which one - Thanks
You shouldnt have that lol
I made a plugin for preston
o nice
[09:54:47 WARN]: Can't keep up! Is the server overloaded? Running 32548ms or 650 ticks behind
I also forwarded the link to troy hunt
cybersecurity guy at microsoft
i had to make a "big daddy mod" where theres a zombie called big daddy and u revive it
This channel is only for programming questions
he made haveibeenpwned
What areu talking?
Well u should delete the file then
I might've deleted it already
What?
I had to make some space for call of duty
good reason
and I only had it on a clean 120gb ssd
Oh lol how many gb you have? I have 1.5tb on my pc + extra 4tb from a NAS
based
made 300gigs space for my dualbooted linux
Also is weird because im from Latam and here is not common people having NAS things if they are not buiness company
You live in a Flat in New York right?
i'm running my stuff on a pi smh
no I live in my parent's house in portugal
i hope it doesnt burn my house
Raspberry*
arduino minecraft server when
Lol not lying arduino is amazing
we could make a proxy in arduino and just relay data over the serial port
Dont swear them
Not sure you'd have the data space on most Arduinos
I have been doing arduino since i was 10y
can't we get an sd card reader board
and toss a 1tb card
or am I tripping
Yeah also they doesnt have USB in other handl raspberry allow you so you can connect external hard drive
brah so u are telling me u dont run your minecraft server on a single integrated circuit?
how do i check if an item has durability or not?
1tb of tentacle hentai? 😳
hardware-optimized server impl when
Yes there is an extension for that
eyo
hentain is cancer bruh its burn your mines
hehehehaw
^^
it's actually made of 2 hard drives
real4life
eg, differentiate between tools and armour vs blocks
that I got from free laptops
I once fixed this old dude's laptop
in exchange for another broken laptop
he only gave me that deal because he had a poker tournament to play that day
hehe i scraped the windows licenses of my old laptops
got a win education and win 10 home now
and I just had to toss the drive on my desktop, backup all data and reinstall windows
it had some fucked drivers or something
lol
ImLussion if you where from latam i would paid you a package with 10 sata hard drive between 256gb and 500 gb
I have hundred of thems
lmao what
Also my mother shit my father because he has lot of shits and now she has another one (me, who came with more things to home)
HAHAHA
I can get tons of 60-200gb hard drives
Yes!
because I interned at the school's computer lab
I managed to grab a sound card with a rare daughterboard
and flipped it for 80$
In theory its illegal
Because you are working there and they are not your own things
😂
the teacher running it likes me
they were tossing old stuff out
like
tossing?
it's not that regulated?
anything older than 2004 was getting scrapped
my job was to test the machine, do some debugging
if it worky (even with a ram change or something), good
if it doesn't, grab cpu, ram, cables and drives and toss the rest out
may i ask how old you are? 👀
around 18
hmm maybe i've to do such stuff in college too then
I'm in what we call a "professional course"
meaning you gotta do mandatory unpaid internships and such
um?
check if the meta instanceof Damageable
then getDamage is not 0
anyways that internship was fun
I ended up redoing all electrical work for the computer lab
i can imagine that
sounds fun if you know what youre doing lol
AH even better
I made a power cable too short and had to rewire the entire wall
then we got a new server rack
if(!(item.getItemMeta() instanceof Damageable)){
p.sendMessage(ChatColor.RED + "Target has no durability!");
return;
}
doesnt seem to work
lmao
and I had to wire like 10 ethernet cables around the entire wall
and I made 2 slightly too short
had to rip out all the covers from the wall
make sure you got the right import
it's the inventory one
its not free lmao
i just tried tabnine out yesterday
import org.bukkit.inventory.meta.Damageable;
yep
than the 50$/session for therapy
after wasting all night trying to figure out why something ain't working
when I inverted that one if statement
There's going to be a huge influx of people using copilot to write code and then ask questions why it isn't working properly
That's why I instruct my underlings to only start using copilot once they know what they're doing
I've been doing spigot for the past 5-6 years, copilot is just a work tool that makes me more productive
i had issues with gson yesterday cuz it didnt know what to do with the Location::WeakReference<World> lmao
The 10$ it costs me is a lot less than the revenue it brings back
just to confirm, only items that can take damage have the Damageable interface implemented in their item meta, correct?
That is ilegal working for non paid you should make a note and take legal actions
Yessir
umm no
I asked about the legality
it's illegal to pay students for "on-the-job training"
then why the heck is it still letting granite blocks through lol
great question
Atleast here exists some shity society called "gremios" which ne suppouse to help the workers to claim things but they just complain for stupid things
Man, here in Canada internships are all paid. Y'all wack
imagine being from a developed and economically-stable country
🤓
That why i thought its ilegall in most country every course that involve works AND more than 4-5hrs should be paid
it was full-time in our case
In Canada if you work even 10 minutes they have to pay you minimum 3 hours worth of work.
and I had to do extra hours because I caught covid
we arent paid for anything lmao
I'd just bring my laptop and make plugins while the classrooms were busy
they tasked us with manually deleting files that were older than a certain date
from the student's download folders
Okay so you just make a good use of BASH
